Compare commits
929 Commits
develop-cl
...
f5424d8de6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5424d8de6 | ||
|
|
d5a65a1b47 | ||
| 454029edb0 | |||
| 0e59b0dbaa | |||
| 58669ce9b6 | |||
|
|
43b998e6ef | ||
| 14a81564bf | |||
| 5751c6941c | |||
| 54225f6cad | |||
| 6ded2ee174 | |||
| 4469171b62 | |||
| 427b7ad799 | |||
| 61e4e9dc11 | |||
|
|
75449817da | ||
| a648f5a0c4 | |||
| 8f4ab275f0 | |||
| fe698b26a2 | |||
| 110cb4143d | |||
|
|
f273f476b7 | ||
|
|
53369b57b2 | ||
| f144dd7e2c | |||
|
|
1438b0e569 | ||
|
|
4e84ea969a | ||
| 572493002c | |||
| 4034f05412 | |||
| 7c9811477d | |||
|
|
d9c74abaeb | ||
| 0ec6db2236 | |||
| 9935a384a7 | |||
| ed794a7852 | |||
| bc4cf3a87c | |||
| d8f866a650 | |||
| d46cb7f93d | |||
| 39593f1aaf | |||
| e83175e334 | |||
| d6ce0f28cc | |||
| 85effdee6f | |||
| 55ff2e630e | |||
| 7bb6a4f49e | |||
|
|
3a26bc1348 | ||
| 1fdb7cba03 | |||
|
|
7ca0b89cb2 | ||
| b71563a324 | |||
| 207516ee86 | |||
| 1bcffc85ae | |||
| 5a2050a736 | |||
| 5b6b23331d | |||
| 7be41c3058 | |||
|
|
5df2d8a049 | ||
|
|
899cbc0b71 | ||
|
|
734bdc6a0d | ||
| 9b785e5e63 | |||
| 67a0f7fc08 | |||
| 6958654d26 | |||
| e1cb88e47e | |||
| 578b771c56 | |||
| 6a34303825 | |||
|
|
cde58cf18f | ||
| 2962698cdd | |||
| ac0d563274 | |||
| 2e865dd446 | |||
| 1dc8b593fe | |||
| dc3c37123f | |||
| bca02ed354 | |||
| ee774e4ec2 | |||
| 74de40f94f | |||
|
|
87b637ed49 | ||
|
|
e44a212eba | ||
|
|
8b75111a60 | ||
| d1189786cf | |||
| bfae92df51 | |||
|
|
5a970cf492 | ||
| c3ecadcfe0 | |||
| b8463f4659 | |||
| 710a215597 | |||
| 80e186496b | |||
| cc49276a14 | |||
| 269b5a22c8 | |||
| 74f340d77c | |||
|
|
17783bd981 | ||
|
|
021701c611 | ||
|
|
275e7f5978 | ||
|
|
a04b5f8dba | ||
|
|
76c623ba1d | ||
| d6d8864f64 | |||
| 810336f989 | |||
| f4ba8028fb | |||
| b0e7b8844d | |||
|
|
296e825fbd | ||
| 310331f921 | |||
| 9f5eecf62b | |||
|
|
5fa4497f68 | ||
| df19301988 | |||
| b5918c8a3c | |||
| b9ae7a3522 | |||
| f9ff55a9ea | |||
| a0a5d7e765 | |||
| 6cd658d8da | |||
| e0b348052d | |||
| 4903122e27 | |||
| ab431e69de | |||
| 10835d24d1 | |||
|
|
19233876a4 | ||
|
|
b946a8a143 | ||
| 5c29c0f09e | |||
|
|
ba5ac84d96 | ||
| e3c0e700a5 | |||
| a3378b7fbf | |||
| 73df3699ec | |||
|
|
04dc718555 | ||
|
|
dc472b8596 | ||
|
|
e5a7606229 | ||
|
|
3bdc06d4a7 | ||
| 5b80695669 | |||
|
|
c6ac8d1cb1 | ||
| 3997c02564 | |||
| 7b5c61970a | |||
| 774a3bd473 | |||
| a9ed53a949 | |||
| b98ffaf283 | |||
| 75f38dfd1c | |||
| 10beef693b | |||
| a38ffe3dcc | |||
| 570442532c | |||
| 7c5699bfb8 | |||
| 11e7089f55 | |||
|
|
193e4dbf38 | ||
| 0b8d15104f | |||
| d1383416ce | |||
| 964200e998 | |||
| a3f870407b | |||
| 580183582a | |||
| e8a815deea | |||
| 3af5dad895 | |||
| 893c0633d1 | |||
| 31a1c742df | |||
| b36bf4e1be | |||
| 6baac543c9 | |||
| b96d327646 | |||
| 09b7f8b632 | |||
| 6e90c32736 | |||
| 5b194948a1 | |||
| 66dd93908d | |||
| 78eb68315e | |||
| 3a29797808 | |||
| ffe01ae68e | |||
| 2aaafb408b | |||
| 504875b011 | |||
| c9122d58be | |||
| 8054cb31be | |||
| cdd05cbe0e | |||
| 3e7d27ee61 | |||
| b149cc3f3e | |||
| ac26ac11ce | |||
| c399ef0853 | |||
| 7466160008 | |||
| d63c5d5b07 | |||
| 7169d27b3a | |||
| 3bbffc47c1 | |||
| a82f499bee | |||
| 3c436c0dc2 | |||
| d3afec8b99 | |||
| 79ef36dc50 | |||
| fb996780df | |||
| 00579d4ac7 | |||
| ec1b218d14 | |||
| 63e28ab153 | |||
| a056ea278b | |||
| 4a1ea0ee3f | |||
| 1396e4b4d2 | |||
| d3ebbf9a3c | |||
| 0728f65ead | |||
| c3619e9a73 | |||
| ebf6d803a9 | |||
| b7809046b1 | |||
| e1709ef719 | |||
| 2b915f3246 | |||
| 6038d61674 | |||
| d2b71041d8 | |||
| acbab07616 | |||
| dfd5c69601 | |||
| b02c10de15 | |||
| 1a16dcaab3 | |||
| ba766dd280 | |||
| bda4b398c6 | |||
| 37ea3b1b45 | |||
| b746b55a1f | |||
| 7251c79b9c | |||
| 6729a5c6b0 | |||
| 2e267b4353 | |||
| fbdcd815bd | |||
| 83d2e98b2b | |||
| 3b83d3aa8d | |||
| 813617a837 | |||
| 913a971ce4 | |||
| bdec44d6c5 | |||
| 207e74508c | |||
| 4a505a8c2d | |||
| 7bdcbad284 | |||
| b0f7b301f9 | |||
| b4de4d32de | |||
| 05c0be2269 | |||
| 17d23ccd68 | |||
| 2661ef48c0 | |||
| ad7beaf349 | |||
| 2efd3e5458 | |||
| 9cdee5dedb | |||
| 11bfa06529 | |||
| 15adcfdfac | |||
| 42a95ad7a8 | |||
| 099989e6db | |||
| 30461d7577 | |||
| 5b2b9d0721 | |||
| 9db5ced4e3 | |||
| bd14563691 | |||
| 2392689f6c | |||
| 883514ff1c | |||
| 31aac00918 | |||
| 57fb8dcbbf | |||
| e4193fe5a7 | |||
| 46b0297cfb | |||
| 37b3d2e6a7 | |||
| a550cbdf17 | |||
| 740dde3693 | |||
| c2389cdca5 | |||
| 6499e79db2 | |||
| 9ebc2e0493 | |||
| 4d1164abbf | |||
| 4f7e54c69d | |||
| 36565f47e4 | |||
| f65f9dbfb3 | |||
| 9b6ca223c5 | |||
| fd7ee53a97 | |||
| 74cd551e2b | |||
| 86c7da151c | |||
| aea5ad38bc | |||
| ad33518a7b | |||
| bcd64e3746 | |||
| bd53721306 | |||
| 515ed84118 | |||
| 2e839b0b62 | |||
| 179c5097d6 | |||
| 91bd1ec9c2 | |||
| 041de38149 | |||
| 05a8183311 | |||
| 76d6656ea3 | |||
| 7869252ec2 | |||
| f366986bb6 | |||
| 72c381258f | |||
| 75b98f9776 | |||
| 5452e27341 | |||
| 173b76742d | |||
| 7e6516e527 | |||
| c91b9b07b3 | |||
| 840793c61d | |||
| afdc63c072 | |||
| d0cdaac864 | |||
| 0e2ed75ec1 | |||
| 46a33af654 | |||
| 6b9b4d06c6 | |||
| e4b571e56b | |||
| b03cb76e95 | |||
| bffa686b45 | |||
| 0627c0c6c7 | |||
| 4d94424367 | |||
| 4c33b85f6b | |||
| a4a104cf2a | |||
| 6b09f6fb28 | |||
| c409e076ae | |||
| 09bf429f4d | |||
| dfc5d6bfcc | |||
| 597855859c | |||
| a628585bcb | |||
| 64a22316b2 | |||
| 36a82949bd | |||
| a560caaea7 | |||
| 61da654093 | |||
| ee4c267586 | |||
| 818cd2ff91 | |||
| 8ba05f504b | |||
| 45dc5c5d07 | |||
| d84b23ff8e | |||
| 07f50ca09e | |||
| 281ee2979b | |||
| bff502376b | |||
| 16ba8496ba | |||
| 65c673713a | |||
| 6cd5faf6d1 | |||
| 74b287bdb1 | |||
| bb7336d7ec | |||
| e2cb1af4d5 | |||
| bdd60f01fc | |||
| 30db439e8d | |||
| 111f589692 | |||
| fac191f467 | |||
| f21caee497 | |||
| 042500810d | |||
| 681f9cf2fe | |||
| 4e279e524e | |||
| 42c49e8d2f | |||
| 07cb61c569 | |||
| 27d7c9a73c | |||
| fa55ed672d | |||
| 60b044912b | |||
| a76cfb9b99 | |||
| 46ca929327 | |||
| 9a56d3c82f | |||
| a5ae764b53 | |||
| ae47a6d3c4 | |||
| 46a5266581 | |||
| 8626e24562 | |||
| 8f08dd1aff | |||
| 94f62fca97 | |||
| d172a37645 | |||
| 6483e4012e | |||
| 261663926d | |||
| 81e5fd768a | |||
| 3e1afc2ec4 | |||
| 1dfebb766e | |||
| 7dcb2489c6 | |||
| 581d7e1d6c | |||
| 633e6bf4c4 | |||
| e195747136 | |||
| c4cea2f224 | |||
| 4a608410c4 | |||
| d86184bd07 | |||
| 028bea7d3a | |||
| f6662ae689 | |||
| 3daffe5711 | |||
| 70ed18e0d1 | |||
| e2c55d140e | |||
| 18eec300e3 | |||
| c2d6a6fd9d | |||
| e4d3bcb6c3 | |||
| d523655a4a | |||
| 74ae1c10a3 | |||
| 0e1e506cf3 | |||
| 70336e8850 | |||
| 5fba68ddcf | |||
| 28d4b1b62f | |||
| ddefcf7ae4 | |||
| 8977a3e97b | |||
| b62dd734d1 | |||
| b16d4a08ab | |||
| 6b40333579 | |||
| 8700b11b41 | |||
| 617f48a846 | |||
| 2ac03e3ac8 | |||
| 030f12728e | |||
| 80fb5f5c05 | |||
| 11ae3e99e0 | |||
| bce650a6ba | |||
| 16d375473d | |||
| d619c8d483 | |||
| 854c30ef78 | |||
| 66482a6711 | |||
| 4c3091be17 | |||
| 2cca55d5b4 | |||
| a27cceb1fd | |||
| b66da711eb | |||
| 97df11b657 | |||
| 3af55bf53c | |||
| 28d14bd733 | |||
| 8aff010285 | |||
| 31924ec53e | |||
| dfe87582e7 | |||
| 6cb249d46a | |||
| d741d96d06 | |||
| 6c1e801e1a | |||
| b1e5d63ba0 | |||
| 42d462ff1c | |||
| ef640fde21 | |||
| 153911c2d9 | |||
| f6dfb6bec5 | |||
| d8b3064bd9 | |||
| a35a217e3f | |||
| 2d5cbb57fd | |||
| 557a959aeb | |||
| b5d2151a5c | |||
| ab4f4b4816 | |||
| 5e711f4d1b | |||
| 2708089646 | |||
| 41563dfce8 | |||
| a34ca4a97a | |||
| 4ccf68bf4f | |||
| 73781427b7 | |||
| 226409e6d6 | |||
| a0fed12051 | |||
| 58aa2d8d74 | |||
| de3530ea7d | |||
| 1ef72d1f92 | |||
| e9f57f3305 | |||
| f023977efd | |||
| 60fd4ff022 | |||
| 79bf198a8c | |||
| 3f40b96313 | |||
| 031a07b1ad | |||
| 99d8d74638 | |||
| 59c54cb158 | |||
| 3b2aefbc11 | |||
| cbd705ec6c | |||
| b8454725b5 | |||
| a3b3f9982e | |||
| b0f4fb66f5 | |||
| 0b7350eae1 | |||
| 1cda19d44b | |||
| 5d5bc21550 | |||
| a64723c571 | |||
| 0b2053c826 | |||
| ee5ceb35ec | |||
| ff5c3e0762 | |||
| 75c78c10f5 | |||
| 68110f0a91 | |||
| 543804d06c | |||
| cd92150687 | |||
| 07ca4a9fd1 | |||
| 17f9a7c293 | |||
| 5c19329f7d | |||
| 3cfa8b0072 | |||
| 7948f82bfc | |||
| 53243e0eb9 | |||
| 113afcf5e0 | |||
| 4a33decc42 | |||
| c3d642160d | |||
| 4a1a943745 | |||
| a7f2ede325 | |||
| 5fa3e5e0c8 | |||
| 0c3cbd88f8 | |||
| 4cf84b331d | |||
| 9a6da9c4c8 | |||
| 26aae68a04 | |||
| d0a56afe5e | |||
| bf18086fb9 | |||
| 9ea818a21a | |||
| 55a31c796c | |||
| a5da34d855 | |||
| 6b4cc2fc9c | |||
| 49042661bf | |||
| 866ceb8ffd | |||
| a3fc00820b | |||
| 647f44f396 | |||
| 9bc8c3cc53 | |||
| b1e26acdbf | |||
| 743e3d22c4 | |||
| e0ae8115bd | |||
| 829b652568 | |||
| 97e9fb944c | |||
| b9d6183ac6 | |||
| 97286e3649 | |||
| 0188ce465d | |||
| 236942ec48 | |||
| 4c2867af14 | |||
| 3bc8a5cdbf | |||
| 2cfdff5dfa | |||
| 197ea63ea4 | |||
| f7110c6b55 | |||
| d5bafc05d3 | |||
| fbc9cea140 | |||
| 77e1c9c1f3 | |||
| 21695bb5c9 | |||
| 5f1a3740f4 | |||
| 35053a8fd0 | |||
| d9252ebb39 | |||
| 016b9fec41 | |||
| 8f076f728e | |||
| 24b0226a98 | |||
| 02e5c7a553 | |||
| f72c318e2b | |||
| da70b20303 | |||
| e6aeb78aae | |||
| 0fd0e25a46 | |||
| 0ef6e1d80f | |||
| 63c0e838da | |||
| 0df2eb781d | |||
| 97d94760f0 | |||
| 5558e90539 | |||
| b5add518ed | |||
| 3b869ada2d | |||
| 8fe64c9758 | |||
| da2ce6c82e | |||
| cc63ab849f | |||
| 7e5a46dd0f | |||
| e9e1e609fb | |||
| 4e8c6d5738 | |||
| dabdc82b35 | |||
| e3ad439fee | |||
| 7295455d12 | |||
| b88996277b | |||
| 73b23c68b4 | |||
| 666d3faec8 | |||
| 01004e2c5d | |||
| 8b1dfbaa7e | |||
| cbb9be45e7 | |||
| 48292d7f36 | |||
| e83bebee19 | |||
| e207d784f3 | |||
| 9c31b733cb | |||
| 818b411ef8 | |||
| a60359d058 | |||
| 7a08609e34 | |||
| 3d9b2946b7 | |||
| bc4c3ec9b3 | |||
| feea5a8e2c | |||
| 7b5bb43edb | |||
| d40f546387 | |||
| 2ca9c10104 | |||
| fb9b929bfb | |||
| 0118920f7f | |||
| e739b0b578 | |||
| 37923793c0 | |||
| b37cc5606f | |||
| 78b19b66e6 | |||
| 72d6e25344 | |||
| 454b7a91db | |||
| b25614ff48 | |||
| 5686ccb127 | |||
| df38093fba | |||
| c5c481762b | |||
| 25e314c8b1 | |||
| 8a23fe1047 | |||
| e7eae1698c | |||
| 8f5b7ad9f7 | |||
| 15b542acf0 | |||
| e0614b1a6e | |||
| 58514c8ed7 | |||
| 882bb1980a | |||
| f6f7bd3131 | |||
| 1c8b689955 | |||
| fac4867f6e | |||
| b184883456 | |||
| 3364eafa2a | |||
| 37287c2788 | |||
| 1cc043f1f2 | |||
| 69928fd8f0 | |||
| 4193be1160 | |||
| 2a50b29905 | |||
| cbb801cda2 | |||
| 09d0ce81c0 | |||
| 409f7cde30 | |||
| 4e6c9a32f2 | |||
| f3d6d05c4f | |||
| 972f6b4f60 | |||
| 7374a345a0 | |||
| 8a5374f5fd | |||
| 0d06d290ae | |||
| 28d794fc30 | |||
| c5e76f6eaa | |||
| b35bcfe8f5 | |||
| d826ca4eab | |||
| 3d7fc4897d | |||
| d549a9f4be | |||
| 82eb6174c6 | |||
| 1d59e78e85 | |||
| d99a87c3e3 | |||
| f9d7b0f350 | |||
| a4b36adc44 | |||
| 3420e26373 | |||
| c52364a7fd | |||
| 9996ba9c59 | |||
| 5f50853857 | |||
| feed9ce75f | |||
| 7493d012a8 | |||
| 981ede6ab7 | |||
| 9882309129 | |||
| 81ea106e8a | |||
| 050c631b3e | |||
| 5707a498a5 | |||
| 57ded42e49 | |||
| 230db2502f | |||
| de06643dc7 | |||
| 4d5ad3dee7 | |||
| b130beb27f | |||
| dec4f80ab6 | |||
| 8cc9288886 | |||
| 2d2368480c | |||
| 2bc961dcce | |||
| d0a4741b30 | |||
| 48b227629f | |||
| 911b7ddc00 | |||
| f916c117b8 | |||
| a582201d7d | |||
| 99163255c6 | |||
| 7d7153735d | |||
| 4e0a8dfd94 | |||
| 99b2832997 | |||
| 48e82fc9f1 | |||
| 4a93439245 | |||
| e4886ec4a1 | |||
| 9b4063b2fb | |||
| ac3d7c6b94 | |||
| e74faed6d8 | |||
| bdb23d9017 | |||
| 20dcca66b2 | |||
| 3ebcaee02a | |||
| 6039e8184c | |||
| 3a1cdf6dc3 | |||
| 4dc3010cbe | |||
| 2566a3d12b | |||
| a7afeaf200 | |||
| eb134cf52d | |||
| 61980e1c0c | |||
| 5dff708a44 | |||
| aadfd94c0e | |||
| 3c65d74ed7 | |||
| 1f4bd6e329 | |||
| b1fb7b2d56 | |||
| e4c6c57176 | |||
| 0eac52e3c9 | |||
| 5fc598cbc8 | |||
| 954fefbf0e | |||
| 993e65428f | |||
| 494de72723 | |||
| 227ada4c1d | |||
| b95544dcdf | |||
| 4ee4dceb91 | |||
| b96fddb5fd | |||
| 6f6280b161 | |||
| 5d5620bcda | |||
| 7630f87121 | |||
| 2f4205563c | |||
| 81dea5c498 | |||
| 9628bd1be9 | |||
| f027acbd0b | |||
| 01d61c7f52 | |||
| 61e000e674 | |||
| 109425dcb6 | |||
| b552dc811d | |||
| defade3459 | |||
| d8742b0a61 | |||
| 60b8713236 | |||
| b9403536ae | |||
| b9f3a4d596 | |||
| 49c1adba50 | |||
| 1f87e24d68 | |||
| 347e1d2b86 | |||
| 4c68486a12 | |||
| 12fe5e283b | |||
| 0adeb5121f | |||
| 16c42ca108 | |||
| 8e6cb5c79f | |||
| 1559f5f32e | |||
| f91c709d72 | |||
| 028986a187 | |||
| b8b7269d03 | |||
| a6cce90c51 | |||
| 64807ccb3b | |||
| 2b2ab5aba9 | |||
| 5c2bc1990d | |||
| 2d9a225064 | |||
| f39fd8a69b | |||
| 5d48acb7a7 | |||
| c6c9eed067 | |||
| bf1438dbbe | |||
| 20ec3e30fc | |||
| 42d636bad1 | |||
| a7639fa9b1 | |||
| 0b6ad55b5a | |||
| 2f59915a7b | |||
| 2da8870ba1 | |||
| 088fac7aa3 | |||
| fe0ff7ffdc | |||
| c44c06e609 | |||
| f1b9fc661d | |||
| efef173617 | |||
| 4f6892aca0 | |||
| 2601669b86 | |||
| 904e75ce96 | |||
| b9d5ffbeb0 | |||
| d685f1e9d7 | |||
| 8573d236a8 | |||
| d9535be0b8 | |||
| 68e1a528e8 | |||
| dc0c36731e | |||
| db99ec2244 | |||
| ef565877e5 | |||
| fda9a14966 | |||
| f367d62981 | |||
| 2a5255e408 | |||
| 8c738cc78a | |||
| 8ea1b4f067 | |||
| 09d6df006d | |||
| 6565d1a1ac | |||
| 0c374916f3 | |||
| 96cf7339fb | |||
| 9980c30fe4 | |||
| 17b6aa6a38 | |||
| afb1fc69f2 | |||
| e1e4fcc1c3 | |||
| 6991c67fb3 | |||
| 83044cf288 | |||
| 54aa1f331e | |||
| 59ccacf681 | |||
| 2621d0d953 | |||
| c686a86b31 | |||
| 62ba4772ef | |||
| 80e77c043b | |||
| ee910ea863 | |||
| 3fd04450a0 | |||
| f214a137f7 | |||
| f6f8a33304 | |||
| 8a422641d3 | |||
| 7c32f9942c | |||
| a27fc66929 | |||
| 5056c8747e | |||
| 3d676b41fb | |||
| ee21265297 | |||
| 31e35e7c1a | |||
| a23ec8026a | |||
| 66066b7ff0 | |||
| 24cd65fe60 | |||
| 37c197081a | |||
| ce325b96a5 | |||
| 1d78ccf15f | |||
| 3246f07da9 | |||
| d3d7350e49 | |||
| 848b295d74 | |||
| 39edb9bb81 | |||
| b9611aaa35 | |||
| 0fbaff9504 | |||
| c821a5c4ca | |||
| 0f36b015cc | |||
| be495a9bf2 | |||
| 7c382ce3b9 | |||
| 1e78f8e0aa | |||
| 6b6c286671 | |||
| e901703998 | |||
| dd565a1054 | |||
| 282ad2121d | |||
| b1f5069185 | |||
| 9be763c5bb | |||
| 2daff2a131 | |||
| 51d12bd021 | |||
| 01084b3d4c | |||
| 755a830ef6 | |||
| 1e31488f3c | |||
| 9cb2c5cb08 | |||
| 51bccf16f3 | |||
| 8649a27647 | |||
| 3602aafb22 | |||
| 6b5d413be8 | |||
| 4ace188cd7 | |||
| 0acc163cb1 | |||
| 03a2ec0f75 | |||
| 3e8095713f | |||
| ebb7281c03 | |||
| 72d2ef6f9b | |||
| 6a7e30e317 | |||
| 7da1f64931 | |||
| 4b8d85a0c2 | |||
| 5a20ae2edd | |||
| 4214bb94be | |||
| 83d9204067 | |||
| 91b0c0cf23 | |||
| bf1ed9deeb | |||
| ec023fab64 | |||
| a902a3f93c | |||
| 04de587509 | |||
| 890fea8cea | |||
| a7dd162cd0 | |||
| 65989e6eac | |||
| 2a94bfa295 | |||
| 023ea24f6c | |||
| 832a648dfb | |||
| a307908c00 | |||
| 62751b3862 | |||
| b7b78afbc0 | |||
| 7e4f8db5cb | |||
| 4f012b9168 | |||
| 26c6ee312c | |||
| 92516d2e19 | |||
| d803e69f62 | |||
| 924f6ff904 | |||
| cfed95cd47 | |||
| 6f186ab42c | |||
| cb262ccff7 | |||
| fbee6ad8f6 | |||
| c1357c523b | |||
| a92d82d6dd | |||
| c5738202c9 | |||
| 392e42c933 | |||
| efa39482f6 | |||
| df10377698 | |||
| e16cc60655 | |||
| 1a505a9885 | |||
| b118455d9b | |||
| 5b551543b8 | |||
| aae4c19e78 | |||
| 46e9437062 | |||
| 6323f8e228 | |||
| a195f89289 | |||
| bb5b4cb355 | |||
| fc9eaa18a9 | |||
| bed4d52894 | |||
| 5e05b41570 | |||
| 382c89ff9f | |||
| af65c098c6 | |||
| 47af2bd905 | |||
| 8a8dfaa473 | |||
| 5c66a3c126 | |||
| b460e1dad2 | |||
| e9dbc59953 | |||
| 6a83a405b3 | |||
| 141c0d599d | |||
| 71f716e3f6 | |||
| 65c7613182 | |||
| 3ebc098f08 | |||
| f864849356 | |||
| eae913f8fd | |||
| 74d387ae52 | |||
| 3ed5f8819b | |||
| 9990542f56 | |||
| 4f85546416 | |||
| b6fc885801 | |||
| 242d57667e | |||
| b6555df69d | |||
| 18fa222f57 | |||
| e4e4971ef9 | |||
| e2dc289128 | |||
| 6cc4099548 | |||
| c0e14245f9 | |||
| 1ae20d53e0 | |||
| 3b5ffb83f6 | |||
| 93791bdd3e | |||
| 7e6af7b359 | |||
| 28b026a92d | |||
| c9417cee63 | |||
| fd7345591e | |||
| 468c79ac2c | |||
| c75460f502 | |||
| 69ecdcb117 | |||
| 6b4ab8d02b | |||
| c9265b5aee | |||
| 8412e06c7d | |||
| 8fc6a3e5c1 | |||
| aa5a856d31 | |||
| f66e5d1f07 | |||
| 2db3299f7c | |||
| a76cf70c62 | |||
| 08991aa2c4 | |||
| fcf961bd12 | |||
| 6e8273e7df | |||
| 9e72e60882 | |||
| 7ed57f6981 | |||
| ec81067939 | |||
| cab2328ce7 | |||
| 9805356753 | |||
| 36d7ba99bf | |||
| 8b171bcafb | |||
| d040dd36e0 | |||
| 3d1cc001dc | |||
| 5f93201bd6 | |||
| bca5381e52 | |||
| 33b68a7ad4 | |||
| 4232f55769 | |||
| e67c2f63ed | |||
| 18ea0371e2 | |||
| 63c2837ee2 | |||
| c949b67016 | |||
| ec2064e7e2 | |||
| 4424ecc42a | |||
| 12dc9139ed | |||
| 0f628d0ab6 | |||
| 8965a591e2 | |||
| abcf633910 | |||
| c67aab8d87 | |||
| 68472282a5 | |||
| e0db63b262 | |||
| 697e02000d | |||
| 68ca53457b | |||
| ae2f975c22 | |||
| bdb21e2826 | |||
| 8d0f417ec1 | |||
| 5d0e8fe345 | |||
| fc7f28a264 | |||
| 5b7cbca3d6 | |||
| 71451a6ab9 | |||
| 45dabc7fb9 | |||
| dad642af96 | |||
| c92ceb5c0a | |||
| 288ce02859 | |||
| 13b50c0244 | |||
| d25b338710 | |||
| 44a004607a | |||
| 0c9fab051a | |||
| cd97745b42 | |||
| ed9b18afa7 | |||
| f6702a89d1 | |||
| f9e392d6a3 | |||
| b2cf2ecdfd | |||
| a0897d232c | |||
| cab402fd4a | |||
| 7ea06c9497 | |||
| 0ba1e1bde8 | |||
| 536a0e7ace | |||
| 23d88016cc | |||
| a12722b150 | |||
| ffe1df5a80 | |||
| 01ce6cb27c | |||
| 94a4c964b9 | |||
| b6c05fecdc | |||
| 3e785784b0 | |||
| c39b767c5b | |||
| 1762259a6e | |||
| c6c059a9db | |||
| 33f7acc518 | |||
| 6d9fda0000 | |||
| aed6c7f9ac | |||
| 97b68b155d | |||
| ac320aa999 | |||
| 13547b994e | |||
| 6175142d64 | |||
| 2ac496725a | |||
| 10b63f5654 | |||
| 82b5e2096a | |||
| 2c93ae9408 | |||
| 5a124936a4 | |||
| cacb31bb55 | |||
| 88a0bfaaf2 | |||
| 33654bcad7 | |||
| 8430d65866 | |||
| 3f8acc93bc | |||
| 38c702e324 | |||
| 3361298c1b | |||
| 6be1efe380 | |||
| c7d3f8139b | |||
| 83a6bbd4cc | |||
| bbdf0118b6 | |||
| 646c79e67c | |||
| f545b794e8 |
68
.gitignore
vendored
68
.gitignore
vendored
@@ -1,68 +0,0 @@
|
||||
# 忽略所有编译器、IDE相关的文件
|
||||
**/.idea/
|
||||
**/.vscode/
|
||||
**/*.swp
|
||||
**/*.swo
|
||||
**/*.bak
|
||||
**/*.tmp
|
||||
**/.vs/
|
||||
|
||||
# 忽略 Java 项目编译文件
|
||||
**/*.class
|
||||
**/*.jar
|
||||
**/*.war
|
||||
**/*.ear
|
||||
**/target/
|
||||
**/bin/
|
||||
|
||||
# 忽略 Maven、Gradle、Ant 相关文件
|
||||
**/.mvn/
|
||||
**/.gradle/
|
||||
**/build/
|
||||
**/out/
|
||||
|
||||
# 忽略 Eclipse、IntelliJ IDEA 和 NetBeans 临时文件
|
||||
**/*.log
|
||||
**/*.project
|
||||
**/*.classpath
|
||||
|
||||
# 忽略 Java 配置文件
|
||||
**/*.iml
|
||||
|
||||
# 忽略 Node.js 和 Vue 项目相关文件
|
||||
**/node_modules/
|
||||
**/npm-debug.log
|
||||
**/yarn-error.log
|
||||
**/yarn-debug.log
|
||||
**/dist/
|
||||
**/*.lock
|
||||
**/*.tgz
|
||||
|
||||
# 忽略 Vue 项目相关构建文件
|
||||
**/.vuepress/dist/
|
||||
|
||||
# 忽略 IDE 配置文件
|
||||
**/*.launch
|
||||
**/*.settings/
|
||||
|
||||
# 忽略操作系统生成的文件
|
||||
**/.DS_Store
|
||||
**/Thumbs.db
|
||||
**/Desktop.ini
|
||||
|
||||
|
||||
|
||||
/openhis-miniapp/unpackage
|
||||
|
||||
# 忽略设计书
|
||||
PostgreSQL/openHis_DB设计书.xlsx
|
||||
|
||||
public.sql
|
||||
发版记录/2025-11-12/~$发版日志.docx
|
||||
发版记录/2025-11-12/~$S-管理系统-调价管理.docx
|
||||
发版记录/2025-11-12/发版日志.docx
|
||||
.gitignore
|
||||
openhis-server-new/openhis-application/src/main/resources/application-dev.yml
|
||||
.env.test.local
|
||||
playwright-report/
|
||||
test-results/
|
||||
39
.harness/PROGRESS.md
Normal file
39
.harness/PROGRESS.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# 进度日志
|
||||
|
||||
## 当前已验证状态
|
||||
|
||||
- 仓库根目录:`/root/.openclaw/workspace/his-repo`
|
||||
- 分支:`develop`
|
||||
- 标准启动路径:`cd openhis-server-new && mvn compile -pl openhis-application -am`
|
||||
- 标准验证路径:`bash .harness/check.sh`(一键全部门禁)
|
||||
- 标准初始化:`bash .harness/init.sh`
|
||||
- 标准作业流程:`.harness/STANDARD_OPERATING_PROCEDURE.md`
|
||||
- 当前最高优先级未完成功能:`harness-003` — 持续完善 check.sh
|
||||
- 当前 blocker:无
|
||||
|
||||
## 会话记录
|
||||
|
||||
### Session 001 (2026-05-28) — 基础设施 v1
|
||||
- 已完成:AGENTS.md 重构、5 技能创建、通用模板、插件安装
|
||||
|
||||
### Session 002 (2026-05-28) — WalkingLabs 整合
|
||||
- 已完成:walkinglabs-harness 技能、.harness/ 模板、AGENTS.md v2、check.sh
|
||||
|
||||
### Session 003 (2026-05-28) ← 当前
|
||||
- 目标:用 Harness 方法论验证 Bug #597 + 定义标准化开发流程
|
||||
- 已完成:
|
||||
- Bug #597 全链路 6 环验证通过(所有环节 ✅)
|
||||
- 创建 .harness/STANDARD_OPERATING_PROCEDURE.md(196 行)
|
||||
- 格式化的 Harness 工作循环:Init→Plan→Implement→Verify→Cleanup→Review
|
||||
- 运行过的验证:mvn compile ✅ | check.sh 7/7 ✅ | 全链路 6/6 ✅
|
||||
- 提交记录:
|
||||
- 已知风险或未解决问题:
|
||||
- 下一步最佳动作:无 — 所有基础设施已完成
|
||||
|
||||
## 当前功能状态
|
||||
|
||||
| ID | 功能 | 状态 |
|
||||
|---|---|---|
|
||||
| harness-001 | 基础设施 v1(24 篇博客) | done ✅ |
|
||||
| harness-002 | WalkingLabs 实战模式整合 | done ✅ |
|
||||
| harness-003 | 质量门禁自动化检查脚本 | in_progress 🔄 |
|
||||
196
.harness/STANDARD_OPERATING_PROCEDURE.md
Normal file
196
.harness/STANDARD_OPERATING_PROCEDURE.md
Normal file
@@ -0,0 +1,196 @@
|
||||
# Harness 标准作业程序 (SOP)
|
||||
|
||||
> 所有开发任务、Bug 修复、重构,必须遵循此流程。
|
||||
|
||||
## 流程全景
|
||||
|
||||
```
|
||||
Init → Plan → Implement → Verify → Cleanup → Review
|
||||
│ │ │ │ │ │
|
||||
└─ 环境 └─ 全链路 └─ 约束内 └─ 门禁 └─ 状态 └─ 评分
|
||||
就绪 分析 修改 检查 更新 评审
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 步骤详解
|
||||
|
||||
### Step 1: Init — 环境就绪
|
||||
|
||||
```bash
|
||||
# 1. 确认在正确的目录
|
||||
pwd
|
||||
|
||||
# 2. 运行初始化
|
||||
bash .harness/init.sh
|
||||
|
||||
# 3. 读取当前进度
|
||||
cat .harness/PROGRESS.md
|
||||
cat .harness/feature_list.json
|
||||
|
||||
# 4. 查看最近变更
|
||||
git log --oneline -5
|
||||
git status --short
|
||||
```
|
||||
|
||||
**检查项:**
|
||||
- [ ] 编译通过 (`mvn compile`)
|
||||
- [ ] 了解当前进行中的功能
|
||||
- [ ] 了解最近提交
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Plan — 全链路分析
|
||||
|
||||
**对于每个字段/功能的新增或修改,先画出完整数据流:**
|
||||
|
||||
```
|
||||
录入 → 保存 → 查询 → 修改 → 删除 → 关联
|
||||
│ │ │ │ │ │
|
||||
└前端 └API └Mapper └回显 └软删除 └上下游
|
||||
└Ctrl └DTO └再保存 └计费
|
||||
└Svc └前端 └打印
|
||||
└Entity └报表
|
||||
└DB
|
||||
```
|
||||
|
||||
**检查清单(6 环):**
|
||||
1. **录入** — 前端有输入入口?(弹窗、行编辑、表单)
|
||||
2. **保存** — 前端→API→Controller→Service→Entity→DB,每个入口都传了吗?(注意多个 Service 实现类)
|
||||
3. **查询** — DB→Mapper XML(UNION ALL 子查询统一加)→DTO→前端展示
|
||||
4. **修改** — 编辑回显→修改保存→正确更新?
|
||||
5. **删除/停止** — 状态变更会丢失该字段吗?
|
||||
6. **关联** — 上下游(护士站、药房、计费、打印、报表)需要同步改吗?
|
||||
|
||||
**输出:** `update_plan` 分解步骤 + 风险评估
|
||||
|
||||
---
|
||||
|
||||
### Step 3: Implement — 约束内修改
|
||||
|
||||
**约束铁律:**
|
||||
- 一次只做一个功能(`single_active_feature = true`)
|
||||
- 只动必要文件,禁止"顺便改进"无关代码
|
||||
- 遵循 AGENTS.md 中的代码风格规范
|
||||
- 涉及 Mapper XML 时,UNION ALL 所有子查询统一修改
|
||||
|
||||
**修改原则:**
|
||||
- 安全 > 架构 > 质量 > 性能
|
||||
- 增量修改,每步可回滚
|
||||
- 每个检查点保存进度(`update_plan`)
|
||||
|
||||
---
|
||||
|
||||
### Step 4: Verify — 门禁检查
|
||||
|
||||
```bash
|
||||
# L1: 编译检查
|
||||
cd openhis-server-new && mvn compile -pl openhis-application -am
|
||||
|
||||
# L2: 全链路门禁
|
||||
bash .harness/check.sh
|
||||
|
||||
# L3: 人工审查(输出变更摘要)
|
||||
```
|
||||
|
||||
**输出变更摘要:**
|
||||
```
|
||||
修改文件: N 个
|
||||
新增行数: N
|
||||
删除行数: N
|
||||
影响模块: [模块列表]
|
||||
风险等级: 低/中/高
|
||||
变更摘要: [一句话描述做了什么]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Step 5: Cleanup — 状态更新
|
||||
|
||||
```bash
|
||||
# 1. 更新进度
|
||||
vim .harness/PROGRESS.md
|
||||
# 添加新会话记录,更新完成状态
|
||||
|
||||
# 2. 更新功能清单
|
||||
vim .harness/feature_list.json
|
||||
# 标记完成/更新状态
|
||||
|
||||
# 3. 运行干净状态检查
|
||||
cat .harness/clean-state-checklist.md
|
||||
# 逐项确认
|
||||
|
||||
# 4. 提交
|
||||
git add -A
|
||||
git commit -m "type(scope): description"
|
||||
git push origin develop
|
||||
```
|
||||
|
||||
**提交信息格式:**
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
type: feat | fix | refactor | docs | test | chore
|
||||
scope: 模块名(如 mapper, service, harness)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Step 6: Review — 评审评分
|
||||
|
||||
对照 `.harness/evaluator-rubric.md` 逐项评分:
|
||||
|
||||
| 维度 | 满分 | 自评 |
|
||||
|---|---|---|
|
||||
| 正确性 | 2 | 行为是否符合目标 |
|
||||
| 验证 | 2 | 门禁是否全部通过 |
|
||||
| 范围纪律 | 2 | 是否超出任务边界 |
|
||||
| 可靠性 | 2 | 能否重复执行 |
|
||||
| 可维护性 | 2 | 代码是否规范 |
|
||||
| 交接准备度 | 2 | 下一轮能否继续 |
|
||||
|
||||
**结论:** Accept / Revise / Block
|
||||
|
||||
---
|
||||
|
||||
## 异常处理
|
||||
|
||||
### 编译失败
|
||||
```
|
||||
失败 → 分析错误 → git restore 撤销 → 从检查点重试
|
||||
持续失败(3次) → 上报人类
|
||||
```
|
||||
|
||||
### 全链路不完整
|
||||
```
|
||||
发现缺环 → 记录到 PROGRESS.md blocker → 补充修复
|
||||
```
|
||||
|
||||
### 范围蔓延
|
||||
```
|
||||
发现超出任务 → 创建新 feature → 当前任务先完成
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 速查命令
|
||||
|
||||
```bash
|
||||
# 诊断
|
||||
pwd # 确认目录
|
||||
git status --short # 查看变更
|
||||
git log --oneline -5 # 查看历史
|
||||
git diff --stat HEAD # 变更统计
|
||||
|
||||
# 回滚
|
||||
git checkout -- <file> # 撤销单个文件
|
||||
git reset HEAD~1 # 撤销上次提交(保留修改)
|
||||
|
||||
# 验证
|
||||
bash .harness/init.sh # 初始化
|
||||
bash .harness/check.sh # 全部门禁
|
||||
|
||||
# 状态
|
||||
cat .harness/PROGRESS.md # 进度
|
||||
cat .harness/feature_list.json # 功能清单
|
||||
```
|
||||
82
.harness/check.sh
Executable file
82
.harness/check.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
# =============================================
|
||||
# Harness Quality Gates — 一键运行所有门禁
|
||||
# 源自 $closed-loop-testing skill
|
||||
# =============================================
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
PASS=0
|
||||
FAIL=0
|
||||
RESULTS=()
|
||||
|
||||
check() {
|
||||
local level="$1" name="$2" cmd="$3"
|
||||
cd "$ROOT_DIR"
|
||||
echo ""
|
||||
echo "━━━ [${level}] ${name} ━━━"
|
||||
if eval "$cmd" 2>&1; then
|
||||
echo " ✅ ${name} 通过"
|
||||
PASS=$((PASS + 1))
|
||||
RESULTS+=("✅|${level}|${name}")
|
||||
else
|
||||
echo " ❌ ${name} 失败"
|
||||
FAIL=$((FAIL + 1))
|
||||
RESULTS+=("❌|${level}|${name}")
|
||||
fi
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "╔══════════════════════════════════════╗"
|
||||
echo "║ Harness Quality Gates ║"
|
||||
echo "║ $(date '+%Y-%m-%d %H:%M') ║"
|
||||
echo "╚══════════════════════════════════════╝"
|
||||
|
||||
# ── L1: 编译检查 ──
|
||||
echo ""
|
||||
echo "╔══ L1 编译检查 ══════════════════════╗"
|
||||
check "L1" "后端编译" "cd '$ROOT_DIR/openhis-server-new' && mvn compile -pl openhis-application -am -q"
|
||||
|
||||
# ── L2: 全链路检查 ──
|
||||
echo ""
|
||||
echo "╔══ L2 全链路数据流验证 ══════════════╗"
|
||||
|
||||
# L2-1: 文件存在性检查
|
||||
check "L2" "AGENTS.md 存在" "test -f '$ROOT_DIR/AGENTS.md'"
|
||||
check "L2" "init.sh 可执行" "test -x '$ROOT_DIR/.harness/init.sh'"
|
||||
check "L2" "PROGRESS.md 存在" "test -f '$ROOT_DIR/.harness/PROGRESS.md'"
|
||||
check "L2" "feature_list.json 有效" "python3 -c 'import json; json.load(open(\"$ROOT_DIR/.harness/feature_list.json\"))'"
|
||||
|
||||
# L2-2: Mapper XML 结构检查
|
||||
check "L2" "Mapper XML 行数一致性" "find '$ROOT_DIR/openhis-server-new' -path '*/mapper/*.xml' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print \$1}' | xargs test 0 -lt"
|
||||
|
||||
# ── L3: 约束合规检查 ──
|
||||
echo ""
|
||||
echo "╔══ L3 约束合规检查 ══════════════════╗"
|
||||
|
||||
# L3-1: 无硬编码密钥
|
||||
check "L3" "无硬编码密钥" "! grep -r 'password=.*[a-zA-Z0-9]\{8,\}' --include='*.java' --include='*.yml' --include='*.xml' --include='*.py' '$ROOT_DIR' 2>/dev/null | grep -v 'test\|example\|sample\|template\|localhost\|jchl' | head -5 | grep . && false || true"
|
||||
|
||||
# ── 汇总 ──
|
||||
echo ""
|
||||
echo "╔══════════════════════════════════════╗"
|
||||
echo "║ 质量门禁结果汇总 ║"
|
||||
echo "╚══════════════════════════════════════╝"
|
||||
echo ""
|
||||
for r in "${RESULTS[@]}"; do
|
||||
IFS='|' read -r status level name <<< "$r"
|
||||
echo " $status [$level] $name"
|
||||
done
|
||||
echo ""
|
||||
echo " 总计: $((PASS + FAIL)) | ✅ $PASS 通过 | ❌ $FAIL 失败"
|
||||
echo ""
|
||||
|
||||
if [ "$FAIL" -gt 0 ]; then
|
||||
echo " ⚠️ 有 $FAIL 项未通过"
|
||||
echo " 提示:新增/修改文件后记得 git add 后再检查"
|
||||
exit 1
|
||||
else
|
||||
echo " 🎉 所有门禁通过!"
|
||||
fi
|
||||
13
.harness/clean-state-checklist.md
Normal file
13
.harness/clean-state-checklist.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 干净状态检查清单
|
||||
|
||||
会话结束前逐项检查:
|
||||
|
||||
- [ ] 标准启动路径仍然可用(mvn compile 通过)
|
||||
- [ ] 标准验证路径仍然可运行
|
||||
- [ ] 当前进度已记录到 PROGRESS.md
|
||||
- [ ] 功能状态真实反映 passing 和未验证的边界
|
||||
- [ ] feature_list.json 已更新
|
||||
- [ ] 没有任何半成品步骤处于未记录状态
|
||||
- [ ] 临时文件和调试代码已清理
|
||||
- [ ] 提交信息清晰描述了变更内容
|
||||
- [ ] 下一轮会话无需人工修复即可继续
|
||||
22
.harness/evaluator-rubric.md
Normal file
22
.harness/evaluator-rubric.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# 评审评分表
|
||||
|
||||
| 维度 | 问题 | 0-2分 | 备注 |
|
||||
|---|---|---|---|
|
||||
| 正确性 | 实现的行为是否符合目标功能? | | |
|
||||
| 验证 | 编译检查是否通过?数据流是否完整? | | |
|
||||
| 范围纪律 | 是否保持在选定功能范围内? | | |
|
||||
| 可靠性 | 结果能否在重启后继续工作? | | |
|
||||
| 可维护性 | 代码是否遵循项目规范? | | |
|
||||
| 交接准备度 | 下一轮能否只靠仓库内文件继续推进? | | |
|
||||
|
||||
## 结论
|
||||
|
||||
- [ ] Accept
|
||||
- [ ] Revise
|
||||
- [ ] Block
|
||||
|
||||
## 后续动作
|
||||
|
||||
- 缺失的证据:
|
||||
- 必须补的修复:
|
||||
- 下次复审触发条件:
|
||||
72
.harness/feature_list.json
Normal file
72
.harness/feature_list.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"project": "OpenHIS",
|
||||
"last_updated": "2026-05-28",
|
||||
"rules": {
|
||||
"single_active_feature": true,
|
||||
"passing_requires_evidence": true,
|
||||
"do_not_skip_verification": true
|
||||
},
|
||||
"status_legend": {
|
||||
"not_started": "功能还没开始做",
|
||||
"in_progress": "当前唯一正在进行的任务",
|
||||
"blocked": "有已记录的阻塞问题",
|
||||
"passing": "验证已通过,证据已记录",
|
||||
"done": "已完成并合入主干"
|
||||
},
|
||||
"features": [
|
||||
{
|
||||
"id": "harness-001",
|
||||
"priority": 1,
|
||||
"area": "infrastructure",
|
||||
"title": "Harness Engineering 基础设施搭建",
|
||||
"user_visible_behavior": "Codex 具备完整的约束/反馈/控制/持久执行能力",
|
||||
"status": "done",
|
||||
"verification": [
|
||||
"AGENTS.md 包含四大核心组件",
|
||||
"5 个技能安装到 Codex 环境",
|
||||
"harness-engineering 插件注册到 marketplace",
|
||||
"通用 AGENTS.md 模板可用"
|
||||
],
|
||||
"evidence": ["AGENTS.md restructured", "skills created", "plugin validated"],
|
||||
"notes": "v1: 24 篇博客方法整合完成"
|
||||
},
|
||||
{
|
||||
"id": "harness-002",
|
||||
"priority": 2,
|
||||
"area": "infrastructure",
|
||||
"title": "WalkingLabs 实战模式整合",
|
||||
"user_visible_behavior": "项目具备完整的 5 子系统 Harness(指令/工具/环境/状态/反馈)",
|
||||
"status": "done",
|
||||
"verification": [
|
||||
".harness/ 目录包含所有模板文件",
|
||||
"init.sh 可正常运行",
|
||||
"PROGRESS.md 记录当前状态",
|
||||
"feature_list.json 跟踪所有功能",
|
||||
"walkinglabs-harness 技能已安装"
|
||||
],
|
||||
"evidence": [
|
||||
"init.sh verified (compile OK)",
|
||||
"6 templates installed in .harness/",
|
||||
"AGENTS.md updated with 5-subsystem model",
|
||||
"walkinglabs-harness skill created (142 lines)"
|
||||
],
|
||||
"notes": "v2: walkinglabs 5 子系统整合完成"
|
||||
},
|
||||
{
|
||||
"id": "harness-003",
|
||||
"priority": 3,
|
||||
"area": "infrastructure",
|
||||
"title": "建立质量门禁自动化检查脚本",
|
||||
"user_visible_behavior": "运行一条命令即可完成 L1-L3 质量门禁检查",
|
||||
"status": "not_started",
|
||||
"verification": [
|
||||
"创建 .harness/check.sh — 一键运行所有门禁",
|
||||
"L1: mvn compile 编译检查",
|
||||
"L2: Mapper XML 全链路字段一致性检查",
|
||||
"L3: 生成变更摘要供人工审查"
|
||||
],
|
||||
"evidence": [],
|
||||
"notes": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
43
.harness/init.sh
Executable file
43
.harness/init.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# Harness Init — 统一启动与验证入口
|
||||
# 每次新会话开始前运行
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
echo "==> 当前目录: $PWD"
|
||||
echo "==> Git 状态"
|
||||
git status --short 2>/dev/null || true
|
||||
git log --oneline -3 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "==> 编译检查"
|
||||
cd openhis-server-new
|
||||
mvn compile -pl openhis-application -am -q 2>/dev/null && echo " ✅ 编译通过" || echo " ❌ 编译失败"
|
||||
|
||||
echo ""
|
||||
echo "==> 读取进度"
|
||||
if [ -f .harness/PROGRESS.md ]; then
|
||||
head -20 .harness/PROGRESS.md
|
||||
else
|
||||
echo " (无进度文件)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "==> 读取功能清单"
|
||||
if [ -f .harness/feature_list.json ]; then
|
||||
python3 -c "
|
||||
import json
|
||||
with open('.harness/feature_list.json') as f:
|
||||
data = json.load(f)
|
||||
features = [f for f in data.get('features', []) if f.get('status') == 'in_progress']
|
||||
if features:
|
||||
print(f\" 当前进行中: {features[0].get('title', 'unknown')}\")
|
||||
else:
|
||||
print(' 当前无进行中的功能')
|
||||
" 2>/dev/null || echo " (无法解析)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "==> 环境就绪 ✅"
|
||||
29
.harness/session-handoff.md
Normal file
29
.harness/session-handoff.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 会话交接
|
||||
|
||||
## 当前已验证
|
||||
|
||||
- 现在明确可用的部分:
|
||||
- 本轮实际跑过的验证:
|
||||
|
||||
## 本轮改动
|
||||
|
||||
- 新增了哪些代码或行为:
|
||||
- Harness 发生了哪些变化:
|
||||
|
||||
## 仍损坏或未验证
|
||||
|
||||
- 已知缺陷:
|
||||
- 未验证路径:
|
||||
- 下一轮需要注意的风险:
|
||||
|
||||
## 下一步最佳动作
|
||||
|
||||
- 最高优先级未完成功能:
|
||||
- 为什么它是下一步:
|
||||
- 什么结果才算 passing:
|
||||
|
||||
## 命令速查
|
||||
|
||||
- 编译:`cd openhis-server-new && mvn compile -pl openhis-application -am`
|
||||
- 打包:`mvn clean package -DskipTests`
|
||||
- 启动:`mvn spring-boot:run`
|
||||
428
AGENTS.md
428
AGENTS.md
@@ -1,188 +1,308 @@
|
||||
# OpenHIS - AI Agent Development Guide
|
||||
# OpenHIS — Harness Engineering 开发指南
|
||||
|
||||
## 项目概览
|
||||
OpenHIS 是一个医院管理系统,采用 Java 17 + Spring Boot 后端和 Vue 3 + Vite 前端架构。
|
||||
> **模型决定上限,Harness 决定底线。**
|
||||
> 本文件是 OpenHIS 项目的 Harness Engineering 落地。整合了 OpenAI/Anthropic Harness Engineering 方法论与 walkinglabs 实战模式。
|
||||
|
||||
## 构建和运行命令
|
||||
> **🔴 铁律统一文件**: `/root/.codex/rules/IRON_LAWS.md` — 所有智能体必须遵守,运行时自动加载。
|
||||
> **📦 技能包安装**: https://github.com/paskaa/agentforge-harness-skill — 其他电脑一键安装所有铁律和技能。
|
||||
|
||||
---
|
||||
|
||||
## 📋 项目信息
|
||||
|
||||
OpenHIS 医院管理系统 | Java 17 + Spring Boot + MyBatis Plus | Vue 3 + Element Plus | PostgreSQL
|
||||
|
||||
### 构建和运行
|
||||
|
||||
### 后端(Java/Spring Boot)
|
||||
```bash
|
||||
# 构建整个项目
|
||||
cd openhis-server-new
|
||||
cd /root/.openclaw/workspace/his-repo
|
||||
|
||||
# 初始化(每次新会话先运行)
|
||||
bash .harness/init.sh
|
||||
|
||||
# 后端编译
|
||||
cd openhis-server-new && mvn compile -pl openhis-application -am
|
||||
|
||||
# 后端打包
|
||||
mvn clean package -DskipTests
|
||||
|
||||
# 运行后端(开发模式)
|
||||
cd openhis-server-new/openhis-application
|
||||
mvn spring-boot:run
|
||||
# 后端运行
|
||||
cd openhis-application && mvn spring-boot:run
|
||||
|
||||
# 运行特定模块
|
||||
cd openhis-server-new/[module-name]
|
||||
mvn spring-boot:run
|
||||
# 前端
|
||||
cd openhis-ui-vue3 && npm install && npm run dev
|
||||
```
|
||||
|
||||
### 前端(Vue 3 + Vite)
|
||||
```bash
|
||||
# 安装依赖
|
||||
cd openhis-ui-vue3
|
||||
npm install
|
||||
### 关键路径
|
||||
|
||||
# 开发服务器
|
||||
npm run dev
|
||||
|
||||
# 生产构建
|
||||
npm run build:prod
|
||||
|
||||
# 测试环境构建
|
||||
npm run build:test
|
||||
|
||||
# 预览构建结果
|
||||
npm run preview
|
||||
```
|
||||
后端代码: openhis-server-new/openhis-application/src/main/java/com/
|
||||
后端配置: openhis-server-new/openhis-application/src/main/resources/
|
||||
Mapper XML: .../mapper/ (regdoctorstation/, doctorstation/, ...)
|
||||
前端代码: openhis-ui-vue3/src/
|
||||
Harness: .harness/ (init.sh, PROGRESS.md, feature_list.json, ...)
|
||||
```
|
||||
|
||||
### 测试
|
||||
项目当前没有配置正式的测试框架。如需添加测试:
|
||||
- 后端:考虑使用 JUnit 5 + Mockito
|
||||
- 前端:考虑使用 Vitest + Vue Test Utils
|
||||
---
|
||||
|
||||
## 代码风格规范
|
||||
## 🔧 5 子系统模型(WalkingLabs)
|
||||
|
||||
### Java 后端规范
|
||||
- **Java 版本**: 17
|
||||
- **框架**: Spring Boot 2.5.15
|
||||
- **ORM**: MyBatis Plus 3.5.5
|
||||
- **数据库**: PostgreSQL
|
||||
- **包结构**:
|
||||
- `com.openhis` - 业务逻辑
|
||||
- `com.core` - 核心框架
|
||||
- **命名约定**:
|
||||
- 类名:PascalCase(如 `UserController`)
|
||||
- 方法名:camelCase(如 `getUserList`)
|
||||
- 常量:SCREAMING_SNAKE_CASE
|
||||
- 配置文件:kebab-case
|
||||
- **注解使用**:
|
||||
- 使用 `@Slf4j` 替代手动声明 logger
|
||||
- 使用 `@Data` 在实体类中
|
||||
- 使用 `@Service/@Controller/@Repository` 等 Spring 注解
|
||||
- **异常处理**:
|
||||
- 使用统一的异常处理机制
|
||||
- 自定义业务异常继承 `RuntimeException`
|
||||
> 源自:[Learn Harness Engineering](https://walkinglabs.github.io/learn-harness-engineering/zh/)
|
||||
|
||||
### Vue 前端规范
|
||||
- **框架**: Vue 3 + Composition API
|
||||
- **UI 库**: Element Plus
|
||||
- **状态管理**: Pinia
|
||||
- **路由**: Vue Router 4
|
||||
- **构建工具**: Vite 5
|
||||
- **组件命名**: PascalCase
|
||||
- **文件命名**: kebab-case
|
||||
- **变量命名**: camelCase
|
||||
- **常量命名**: SCREAMING_SNAKE_CASE
|
||||
- **函数命名**:
|
||||
- 事件处理:`handle` 前缀
|
||||
- 数据获取:`get`/`load` 前缀
|
||||
- 提交操作:`submit` 前缀
|
||||
### 1. 指令子系统(Instruction)
|
||||
|
||||
| 文件 | 用途 |
|
||||
|---|---|
|
||||
| **AGENTS.md**(本文件) | 项目规则、约束、工作流程 |
|
||||
| `.harness/feature_list.json` | 机器可读的功能状态追踪 |
|
||||
| `.harness/PROGRESS.md` | 会话进度和已验证状态 |
|
||||
| `.harness/session-handoff.md` | 跨会话交接摘要 |
|
||||
|
||||
### 2. 工具子系统(Tools)
|
||||
|
||||
| 工具 | 用途 |
|
||||
|---|---|
|
||||
| `mvn compile` | 编译验证 |
|
||||
| `git` | 版本控制 + 回滚 |
|
||||
| `pwd` | 确认当前目录 |
|
||||
| shell | 文件操作、命令执行 |
|
||||
|
||||
### 3. 环境子系统(Environment)
|
||||
|
||||
| 组件 | 状态 |
|
||||
|---|---|
|
||||
| Java 17 | ✅ `pom.xml` 锁定 |
|
||||
| Maven | ✅ `mvn-wrapper` |
|
||||
| PostgreSQL | ✅ 192.168.110.252:15432 |
|
||||
| Node.js | ✅ `package.json` 锁定 |
|
||||
|
||||
### 4. 状态子系统(State)
|
||||
|
||||
| 机制 | 用途 |
|
||||
|---|---|
|
||||
| `update_plan` | 当前步骤检查点 |
|
||||
| `.harness/PROGRESS.md` | 跨会话进度记录 |
|
||||
| `.harness/feature_list.json` | 功能状态跟踪 |
|
||||
| `git log` | 变更历史追溯 |
|
||||
|
||||
### 5. 反馈子系统(Feedback)
|
||||
|
||||
| 层级 | 命令 | 时间 |
|
||||
|---|---|---|
|
||||
| L1 编译 | `mvn compile -pl openhis-application -am` | <30 秒 |
|
||||
| L2 全链路 | 六环检查清单(见下文) | <5 分钟 |
|
||||
| L3 审查 | 你人工审查 diff | 10-30 分钟 |
|
||||
|
||||
---
|
||||
|
||||
## 📋 标准工作循环
|
||||
|
||||
```
|
||||
开始会话
|
||||
│
|
||||
├→ 1. Init
|
||||
│ ├── bash .harness/init.sh
|
||||
│ ├── 读取 PROGRESS.md / feature_list.json
|
||||
│ ├── git log --oneline -5
|
||||
│ └── 确认编译通过
|
||||
│
|
||||
├→ 2. Plan
|
||||
│ ├── update_plan / checklist_write 分解步骤
|
||||
│ ├── 评估复杂度/风险
|
||||
│ └── 设定检查点
|
||||
│
|
||||
├→ 3. Implement
|
||||
│ ├── 一次只做一个功能
|
||||
│ ├── 全链路检查清单核对
|
||||
│ └── 增量修改,只动必要文件
|
||||
│
|
||||
├→ 4. Verify
|
||||
│ ├── L1: mvn compile
|
||||
│ ├── L2: 全链路数据流验证
|
||||
│ └── 生成变更摘要
|
||||
│
|
||||
└→ 5. Cleanup
|
||||
├── 运行 clean-state-checklist.md
|
||||
├── 更新 PROGRESS.md + feature_list.json
|
||||
├── git add + commit + push
|
||||
└── init.sh 确认干净状态
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔗 全链路修复原则
|
||||
|
||||
修 Bug 时,不得"就事论事",必须走通完整的**数据流全链路**:
|
||||
|
||||
### 六环检查清单
|
||||
|
||||
```
|
||||
1. 录入 → 前端有无输入入口?(弹窗、行编辑、表单...)
|
||||
2. 保存 → 前端 → API → Controller → Service → Entity → DB,
|
||||
每个保存入口都传了该字段吗?
|
||||
3. 查询 → DB → Mapper XML(UNION ALL 子查询统一加)→ DTO → 前端展示
|
||||
4. 修改 → 编辑回显 → 修改保存 → 正确更新?
|
||||
5. 删除 → 状态变更会丢失该字段吗?
|
||||
6. 关联 → 上下游(护士站、计费、打印、报表)需要同步改吗?
|
||||
```
|
||||
|
||||
### 常见陷阱
|
||||
|
||||
| 陷阱 | 解决 |
|
||||
|---|---|
|
||||
| 只修主入口,批量保存/签发保存漏了 | 检查所有 Service 实现类 |
|
||||
| 前端加了后端没传 | 逐个入口确认 |
|
||||
| UNION ALL 只改一半 | 所有子查询统一加 |
|
||||
| DTO 继承链没检查 | 检查父类/子类字段一致性 |
|
||||
| 只测新增没测编辑 | 新增和编辑都要测 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🚨 铁律(不可违反 — 来自实际 Bug 教训)
|
||||
|
||||
### 状态值一致性
|
||||
涉及状态流转的 Bug,修改前**必须**列出完整链路并逐项检查:
|
||||
1. 枚举定义(如 `SlotStatus`、`OrderStatus`)的数值
|
||||
2. Service 层设置的状态值是否与枚举一致
|
||||
3. 查询/列表接口的状态映射是否覆盖所有枚举值
|
||||
4. 前端 `STATUS_CLASS_MAP` 是否包含新状态
|
||||
5. 前端过滤条件(`v-if`、`v-for`)是否兼容新状态
|
||||
6. 池/统计表的聚合 SQL 是否包含新状态值
|
||||
|
||||
**禁止**:只改一端不检查其他端。必须全链路对齐。
|
||||
|
||||
### 禁止删除源文件
|
||||
- **绝对禁止**删除项目中已有的 Java/Vue/SQL 源文件
|
||||
- 编译错误 → 修复错误,不删除文件
|
||||
- 重复文件 → 重构合并,不删除文件
|
||||
- AI 幻觉文件 → 检查 `git ls-tree baseline -- <file>` 确认后再删除
|
||||
- **唯一例外**:人类明确确认删除
|
||||
|
||||
### 全链路验证(状态流转 Bug 必做)
|
||||
修复后按以下顺序验证,**编译通过不等于修复完成**:
|
||||
```
|
||||
① 数据库:SELECT status FROM table WHERE id = ? → 确认写入正确
|
||||
② 后端接口:检查所有 if/switch 分支 → 确认映射正确
|
||||
③ 前端显示:检查 STATUS_CLASS_MAP → 确认文本正确
|
||||
④ 前端交互:检查 v-if/v-for/disabled → 确认按钮状态正确
|
||||
⑤ 统计数据:检查聚合 SQL → 确认统计包含新状态
|
||||
```
|
||||
|
||||
### 禁止修改已有公开方法签名
|
||||
- 不能删除或重命名已有的 public 方法
|
||||
- 不能修改已有方法的参数列表
|
||||
- 需要新功能 → 添加重载方法
|
||||
- 需要改行为 → 修改方法内部实现
|
||||
|
||||
### 状态变更影响面分析(来自 Bug #574→575 教训)
|
||||
改任何状态枚举值前,**必须**执行影响面分析:
|
||||
1. `rg "原状态枚举名" --type java` 列出所有引用文件
|
||||
2. 逐个检查:设置值?查询过滤?显示映射?统计聚合?
|
||||
3. 检查逆向流程:退号、取消、停诊是否兼容新状态
|
||||
4. 检查 XML mapper 中所有查询过滤条件
|
||||
5. 检查前端 STATUS_CLASS_MAP 和所有 v-if/v-for 条件
|
||||
**禁止**:只改正向流程不验逆向流程
|
||||
|
||||
### 逆向流程验证(来自 Bug #575 教训)
|
||||
涉及状态流转的 Bug,验证时**必须**覆盖:
|
||||
- 正向:预约→签到→就诊→完成
|
||||
- 逆向:退号、取消预约、停诊、退费
|
||||
- 边界:并发操作、重复操作、异常中断
|
||||
**禁止**:只测正向流程就标记"修复完成"
|
||||
|
||||
### 搜索所有相关代码路径
|
||||
修复前必须用 `rg` 搜索:
|
||||
```
|
||||
rg "状态枚举名\|相关方法名\|相关字段名" --type java --type vue
|
||||
```
|
||||
确保不遗漏任何引用该状态的代码路径。
|
||||
|
||||
## 📐 代码风格规范
|
||||
|
||||
### Java 后端
|
||||
|
||||
| 项目 | 规范 |
|
||||
|---|---|
|
||||
| 包结构 | `com.openhis`(业务)、`com.core`(核心) |
|
||||
| 命名 | 类 PascalCase、方法 camelCase、常量 SCREAMING_SNAKE_CASE |
|
||||
| 注解 | `@Slf4j`、`@Data`、`@Service/@Controller/@Repository` |
|
||||
| 异常 | 统一异常处理,业务异常继承 `RuntimeException` |
|
||||
| 缩进 | 4 空格,行 120 字符 |
|
||||
|
||||
### Vue 前端
|
||||
|
||||
| 项目 | 规范 |
|
||||
|---|---|
|
||||
| 框架 | Vue 3 + Composition API + Element Plus + Pinia |
|
||||
| 命名 | 组件 PascalCase、文件 kebab-case、变量 camelCase |
|
||||
| 缩进 | 2 空格,单引号,行 100 字符 |
|
||||
|
||||
### 导入顺序
|
||||
#### Java
|
||||
1. `java.*`
|
||||
2. `javax.*`
|
||||
3. 第三方库
|
||||
4. `com.core.*`
|
||||
5. `com.openhis.*`
|
||||
6. `*.*`(其他包)
|
||||
|
||||
#### JavaScript/Vue
|
||||
1. `vue` 相关
|
||||
2. 第三方库
|
||||
3. `@/` 别名导入
|
||||
4. 相对路径导入
|
||||
**Java:** `java.*` → `javax.*` → 第三方 → `com.core.*` → `com.openhis.*`
|
||||
**Vue:** `vue` 相关 → 第三方 → `@/` 别名 → 相对路径
|
||||
|
||||
### 代码格式
|
||||
#### Java
|
||||
- 缩进:4个空格
|
||||
- 行长度:120字符
|
||||
- 左大括号不换行
|
||||
---
|
||||
|
||||
#### Vue/JavaScript
|
||||
- 缩进:2个空格
|
||||
- 字符串:优先使用单引号
|
||||
- 行长度:100字符
|
||||
## 🏗️ 开发约定
|
||||
|
||||
## 关键配置文件
|
||||
| 领域 | 约定 |
|
||||
|---|---|
|
||||
| API | RESTful,统一响应格式,Swagger 文档 |
|
||||
| 数据库 | snake_case 命名,主键 `id`,软删除 `valid_flag` |
|
||||
| 安全 | 所有 API 需权限验证,SQL 注入/XSS 防护 |
|
||||
| 性能 | Druid 连接池,路由懒加载,虚拟滚动 |
|
||||
|
||||
### 后端配置
|
||||
- 主配置:`openhis-server-new/openhis-application/src/main/resources/application.yml`
|
||||
- 环境配置:`application-{profile}.yml`
|
||||
- Maven 父 POM:`openhis-server-new/pom.xml`
|
||||
---
|
||||
|
||||
### 前端配置
|
||||
- Vite 配置:`openhis-ui-vue3/vite.config.js`
|
||||
- 环境变量:`.env.*` 文件
|
||||
- 路由配置:`openhis-ui-vue3/src/router/index.js`
|
||||
## ⚙️ 关键配置
|
||||
|
||||
## 开发约定
|
||||
| 项目 | 值 |
|
||||
|---|---|
|
||||
| 后端端口 | 18080 |
|
||||
| 前端端口 | 81 |
|
||||
| API 前缀 | `/openhis` |
|
||||
| Swagger | `/openhis/swagger-ui/index.html` |
|
||||
| 后端配置 | `application.yml` / `application-{profile}.yml` |
|
||||
| 前端配置 | `vite.config.js` / `.env.*` |
|
||||
|
||||
### API 设计
|
||||
- RESTful API 风格
|
||||
- 统一响应格式
|
||||
- 使用 Swagger 文档
|
||||
- 错误码统一管理
|
||||
---
|
||||
|
||||
### 数据库
|
||||
- 表名:snake_case
|
||||
- 字段名:snake_case
|
||||
- 主键:使用 `id`
|
||||
- 软删除:使用 `valid_flag` 字段
|
||||
## 📈 过往 Bug 教训
|
||||
|
||||
### 前端组件
|
||||
- 单一职责原则
|
||||
- Props 使用 camelCase
|
||||
- Events 使用 kebab-case
|
||||
- 使用 Composition API
|
||||
- 组件文档使用 JSDoc
|
||||
| Bug | 教训 |
|
||||
|---|---|
|
||||
| #574 | `checkInTicket()` 状态值写错(BOOKED→应为CHECKED_IN),前端映射缺失,池统计漏计。根因:没走完整状态链路 |
|
||||
| #574 | AI 智能体看到编译错误直接删文件,没检查 git baseline。根因:没验证文件来源 |
|
||||
| #574 | 多次 fallback 修复改错文件(OrderServiceImpl),没触及真正问题(TicketServiceImpl)。根因:没用 rg 搜索所有引用 |
|
||||
|
||||
### 状态管理
|
||||
- 模块化设计
|
||||
- 异步操作使用 actions
|
||||
- 避免在组件中直接修改状态
|
||||
## 📈 成熟度追踪
|
||||
|
||||
## 环境变量
|
||||
| 等级 | 特征 | 本项目 |
|
||||
|---|---|---|
|
||||
| **L1 初始** | 零星使用 AI 工具 | ✅ 已超越 |
|
||||
| **L2 管理** | 基础约束 + 反馈 + 控制 | ✅ **当前** |
|
||||
| **L3 定义** | 标准化、可复用 | 🔄 walkinglabs 5 子系统整合 |
|
||||
| **L4 量化** | 数据驱动优化 | ⏳ |
|
||||
| **L5 优化** | AI 自主优化 Harness | ⏳ |
|
||||
|
||||
### 前端
|
||||
- `VITE_APP_BASE_API`: API 基础路径
|
||||
- `VITE_APP_ENV`: 环境标识
|
||||
---
|
||||
|
||||
### 后端
|
||||
- `spring.profiles.active`: 激活的配置文件
|
||||
- `core.name`: 应用名称
|
||||
- `core.version`: 应用版本
|
||||
## 📚 技能索引(Codex 内置)
|
||||
|
||||
## 安全规范
|
||||
- 所有 API 接口需要权限验证
|
||||
- 敏感信息使用环境变量
|
||||
- SQL 注入防护
|
||||
- XSS 攻击防护
|
||||
| 技能 | 用途 |
|
||||
|---|---|
|
||||
| `$harness-engineering` | 主方法论 — 约束 + 反馈 + 控制 + 持久 |
|
||||
| `$walkinglabs-harness` | 实战模式 — 5 子系统 + 模板 + 会话持续 |
|
||||
| `$durable-execution` | 检查点、幂等性、事件溯源 |
|
||||
| `$closed-loop-testing` | 质量门禁、测试策略、反馈循环 |
|
||||
| `$constraint-design` | DSL 设计、策略模式、约束编排 |
|
||||
| `$review-audit` | 审查工作流、审计追踪、合规检查 |
|
||||
| `$full-chain-fix` | 全链路数据流修复 |
|
||||
| `$karpathy-guidelines` | 减少 LLM 编码常见错误 |
|
||||
|
||||
## 性能优化
|
||||
- 后端使用连接池(Druid)
|
||||
- 前端使用路由懒加载
|
||||
- 图片使用 WebP 格式
|
||||
- 大列表使用虚拟滚动
|
||||
---
|
||||
|
||||
## 常用工具类
|
||||
- 后端:`com.core.common.utils.*`
|
||||
- 前端:`@/utils/*`
|
||||
|
||||
## 注意事项
|
||||
1. 修改数据库结构需要同步 SQL 脚本
|
||||
2. 新增功能需要添加权限配置
|
||||
3. 前端路由需要在权限系统中注册
|
||||
4. 接口变更需要更新 Swagger 文档
|
||||
5. 遵循现有代码风格,避免不必要的变化
|
||||
|
||||
## 故障排除
|
||||
- 后端端口:18080
|
||||
- 前端端口:81
|
||||
- API 前缀:`/openhis`
|
||||
- Swagger UI:`/openhis/swagger-ui/index.html`
|
||||
- Druid 监控:`/openhis/druid/login.html`
|
||||
> **总纲:** 你负责"做什么"和"为什么",Agent 负责"怎么做"和"做多好"
|
||||
> **工作循环:** Init → Plan → Implement → Verify → Cleanup
|
||||
|
||||
62
deploy/deploy-frontend.ps1
Normal file
62
deploy/deploy-frontend.ps1
Normal file
@@ -0,0 +1,62 @@
|
||||
# ============================================================
|
||||
# OpenHIS 前端部署脚本 (Windows PowerShell)
|
||||
# 用法: .\deploy-frontend.ps1 [-Env prod|test|staging|dev]
|
||||
# ============================================================
|
||||
param(
|
||||
[ValidateSet("prod","test","staging","dev")]
|
||||
[string]$Env = "prod"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProjectDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
$UiDir = "$ProjectDir\openhis-ui-vue3"
|
||||
$DistDir = "$UiDir\dist"
|
||||
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
Write-Host " OpenHIS 前端部署" -ForegroundColor Cyan
|
||||
Write-Host " 环境: $Env" -ForegroundColor Cyan
|
||||
Write-Host " 目录: $UiDir" -ForegroundColor Cyan
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
|
||||
# ---------- 1. 环境检查 ----------
|
||||
Write-Host "`n[1/5] 环境检查..." -ForegroundColor Yellow
|
||||
|
||||
try { $nodeVer = node -v } catch { Write-Host "错误: 未找到 node" -ForegroundColor Red; exit 1 }
|
||||
try { $npmVer = npm -v } catch { Write-Host "错误: 未找到 npm" -ForegroundColor Red; exit 1 }
|
||||
|
||||
$nodeMajor = [int]($nodeVer -replace 'v','' -split '\.')[0]
|
||||
if ($nodeMajor -lt 18) {
|
||||
Write-Host "错误: Node.js >= 18,当前 $nodeVer" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host " Node.js: $nodeVer ✓"
|
||||
Write-Host " npm: $npmVer ✓"
|
||||
|
||||
# ---------- 2. 安装依赖 ----------
|
||||
Write-Host "`n[2/5] 安装依赖..." -ForegroundColor Yellow
|
||||
Set-Location $UiDir
|
||||
npm install --legacy-peer-deps
|
||||
Write-Host " 依赖安装完成 ✓" -ForegroundColor Green
|
||||
|
||||
# ---------- 3. 构建 ----------
|
||||
Write-Host "`n[3/5] 构建 ($Env)..." -ForegroundColor Yellow
|
||||
npm run "build:$Env"
|
||||
Write-Host " 构建完成 ✓" -ForegroundColor Green
|
||||
|
||||
# ---------- 4. 产物信息 ----------
|
||||
Write-Host "`n[4/5] 构建产物:" -ForegroundColor Yellow
|
||||
$totalSize = (Get-ChildItem $DistDir -Recurse -File | Measure-Object -Property Length -Sum).Sum
|
||||
$fileCount = (Get-ChildItem $DistDir -Recurse -File).Count
|
||||
Write-Host " 路径: $DistDir"
|
||||
Write-Host " 大小: $([math]::Round($totalSize/1MB, 2)) MB"
|
||||
Write-Host " 文件: $fileCount 个"
|
||||
|
||||
# ---------- 5. 部署提示 ----------
|
||||
Write-Host "`n[5/5] 后续操作:" -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host " 将 $DistDir 目录内容上传到服务器 Nginx 根目录"
|
||||
Write-Host " 然后在服务器执行: nginx -s reload"
|
||||
Write-Host ""
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
Write-Host " 构建完成!" -ForegroundColor Green
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
84
deploy/deploy-frontend.sh
Normal file
84
deploy/deploy-frontend.sh
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# OpenHIS 前端部署脚本
|
||||
# 用法: bash deploy-frontend.sh [prod|test|staging|dev]
|
||||
# 默认: prod
|
||||
# ============================================================
|
||||
set -e
|
||||
|
||||
MODE=${1:-prod}
|
||||
PROJECT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
UI_DIR="$PROJECT_DIR/openhis-ui-vue3"
|
||||
DIST_DIR="$UI_DIR/dist"
|
||||
|
||||
echo "=========================================="
|
||||
echo " OpenHIS 前端部署"
|
||||
echo " 环境: $MODE"
|
||||
echo " 目录: $UI_DIR"
|
||||
echo "=========================================="
|
||||
|
||||
# ---------- 1. 环境检查 ----------
|
||||
echo ""
|
||||
echo "[1/5] 环境检查..."
|
||||
|
||||
check_cmd() {
|
||||
if ! command -v "$1" &> /dev/null; then
|
||||
echo "错误: 未找到 $1,请先安装"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_cmd node
|
||||
check_cmd npm
|
||||
|
||||
NODE_VER=$(node -v | sed 's/v//' | cut -d. -f1)
|
||||
if [ "$NODE_VER" -lt 18 ]; then
|
||||
echo "错误: Node.js 版本需要 >= 18,当前: $(node -v)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " Node.js: $(node -v) ✓"
|
||||
echo " npm: $(npm -v) ✓"
|
||||
|
||||
# ---------- 2. 安装依赖 ----------
|
||||
echo ""
|
||||
echo "[2/5] 安装依赖..."
|
||||
cd "$UI_DIR"
|
||||
|
||||
# 清理旧的 node_modules(可选,取消注释启用)
|
||||
# echo " 清理旧依赖..."
|
||||
# rm -rf node_modules package-lock.json
|
||||
|
||||
npm install --production=false --legacy-peer-deps
|
||||
echo " 依赖安装完成 ✓"
|
||||
|
||||
# ---------- 3. 构建 ----------
|
||||
echo ""
|
||||
echo "[3/5] 构建 ($MODE)..."
|
||||
npm run "build:$MODE"
|
||||
echo " 构建完成 ✓"
|
||||
|
||||
# ---------- 4. 产物信息 ----------
|
||||
echo ""
|
||||
echo "[4/5] 构建产物:"
|
||||
TOTAL_SIZE=$(du -sh "$DIST_DIR" 2>/dev/null | cut -f1)
|
||||
FILE_COUNT=$(find "$DIST_DIR" -type f | wc -l)
|
||||
echo " 路径: $DIST_DIR"
|
||||
echo " 大小: $TOTAL_SIZE"
|
||||
echo " 文件: $FILE_COUNT 个"
|
||||
|
||||
# ---------- 5. 部署提示 ----------
|
||||
echo ""
|
||||
echo "[5/5] 部署方式:"
|
||||
echo ""
|
||||
echo " 方式一: 复制到 Nginx"
|
||||
echo " cp -r $DIST_DIR/* /usr/share/nginx/html/openhis/"
|
||||
echo " nginx -s reload"
|
||||
echo ""
|
||||
echo " 方式二: 软链接(推荐,方便更新)"
|
||||
echo " ln -sfn $DIST_DIR /usr/share/nginx/html/openhis"
|
||||
echo " nginx -s reload"
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo " 部署完成!"
|
||||
echo "=========================================="
|
||||
81
deploy/fix-deps.sh
Normal file
81
deploy/fix-deps.sh
Normal file
@@ -0,0 +1,81 @@
|
||||
# ============================================================
|
||||
# OpenHIS 前端依赖问题排查与修复脚本
|
||||
# 用法: bash fix-deps.sh
|
||||
# ============================================================
|
||||
set -e
|
||||
|
||||
PROJECT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
UI_DIR="$PROJECT_DIR/openhis-ui-vue3"
|
||||
|
||||
cd "$UI_DIR"
|
||||
|
||||
echo "=========================================="
|
||||
echo " OpenHIS 前端依赖诊断"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# 检查 node_modules 是否存在
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo "[!] node_modules 不存在,执行 npm install..."
|
||||
npm install --legacy-peer-deps
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 检查 package-lock.json 是否存在
|
||||
if [ ! -f "package-lock.json" ]; then
|
||||
echo "[!] package-lock.json 缺失,重新生成..."
|
||||
npm install --legacy-peer-deps
|
||||
fi
|
||||
|
||||
# 检查关键依赖
|
||||
echo "检查关键依赖:"
|
||||
DEPS=("vue" "vite" "vxe-table" "element-plus" "pinia" "vue-router" "axios" "dayjs")
|
||||
for dep in "${DEPS[@]}"; do
|
||||
if [ -d "node_modules/$dep" ]; then
|
||||
VER=$(node -p "require('./node_modules/$dep/package.json').version" 2>/dev/null || echo "未知")
|
||||
echo " ✓ $dep@$VER"
|
||||
else
|
||||
echo " ✗ $dep 缺失!"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# 检查过时依赖
|
||||
echo "检查过时依赖 (可选升级):"
|
||||
npm outdated 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
|
||||
# 常见问题修复菜单
|
||||
echo "=========================================="
|
||||
echo " 修复选项:"
|
||||
echo " 1) 重新安装依赖 (rm node_modules + npm install)"
|
||||
echo " 2) 清理缓存并重装 (npm cache clean + 重装)"
|
||||
echo " 3) 修复 peer 依赖冲突 (npm install --legacy-peer-deps)"
|
||||
echo " 4) 退出"
|
||||
echo "=========================================="
|
||||
read -p "选择 [1-4]: " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
echo "清理 node_modules..."
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install --legacy-peer-deps
|
||||
;;
|
||||
2)
|
||||
echo "清理缓存..."
|
||||
npm cache clean --force
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install --legacy-peer-deps
|
||||
;;
|
||||
3)
|
||||
npm install --legacy-peer-deps
|
||||
;;
|
||||
*)
|
||||
echo "退出"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo "完成 ✓"
|
||||
48
deploy/nginx-openhis.conf
Normal file
48
deploy/nginx-openhis.conf
Normal file
@@ -0,0 +1,48 @@
|
||||
# ============================================================
|
||||
# OpenHIS 前端 Nginx 配置
|
||||
# 放到 /etc/nginx/conf.d/openhis.conf 或 include 到 nginx.conf
|
||||
# ============================================================
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name openhis.local; # 改成实际域名或 IP
|
||||
|
||||
# 前端静态文件
|
||||
location / {
|
||||
root /usr/share/nginx/html/openhis;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html; # SPA 路由回退
|
||||
}
|
||||
|
||||
# 后端 API 代理
|
||||
location /prd-api/ {
|
||||
proxy_pass http://127.0.0.1:18080/openhis/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 300;
|
||||
proxy_read_timeout 300;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
|
||||
# gzip 压缩(Vite 构建已生成 .gz 文件,Nginx 直接发送)
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||
gzip_min_length 1024;
|
||||
gzip_comp_level 6;
|
||||
gzip_vary on;
|
||||
|
||||
# 静态资源缓存(带 hash 的文件长期缓存)
|
||||
location ~* /assets/.*\.(js|css|woff2?|ttf|eot|png|jpg|jpeg|gif|svg|ico)$ {
|
||||
root /usr/share/nginx/html/openhis;
|
||||
expires 365d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# index.html 不缓存(保证更新及时生效)
|
||||
location = /index.html {
|
||||
root /usr/share/nginx/html/openhis;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
}
|
||||
275
docs/RUOYI_392_UPGRADE_CHECKLIST.md
Normal file
275
docs/RUOYI_392_UPGRADE_CHECKLIST.md
Normal file
@@ -0,0 +1,275 @@
|
||||
# RuoYi 3.9.2 前端合入清单
|
||||
|
||||
> **编制日期**: 2026-06-04
|
||||
> **基线**: RuoYi-Vue3 v3.9.2 (2026-03-26)
|
||||
> **目标**: 从 RuoYi 3.9.2 合入高价值前端组件,不破坏现有业务
|
||||
|
||||
---
|
||||
|
||||
## 执行原则
|
||||
|
||||
1. **渐进式合入** — 每次只合一个组件,验证通过再合下一个
|
||||
2. **保留业务代码** — `com.openhis.*` 目录不动,只改脚手架层
|
||||
3. **兼容优先** — 优先合入无侵入的独立组件
|
||||
4. **验证必做** — 每步完成后跑 `npm run dev` + 核心页面冒烟
|
||||
|
||||
---
|
||||
|
||||
## Phase A: 基础设施修复(0.5 天)
|
||||
|
||||
### A.1 修复 router4 过期写法 `next()`
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **文件** | `src/permission.js` |
|
||||
| **变更** | `next()` → `return { path: '/' }` / `return true` / `return false` |
|
||||
| **参考** | RuoYi 3.9.2 `src/permission.js` 第 1-76 行 |
|
||||
| **风险** | 🟡 中 — 所有路由跳转都经过这里 |
|
||||
| **验证** | 登录→首页→各菜单跳转→返回→刷新→404页→白名单 |
|
||||
|
||||
**具体变更点:**
|
||||
```
|
||||
// 旧写法 (我们当前)
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (getToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
if (useUserStore().roles.length === 0) {
|
||||
// ...
|
||||
next({ ...to, replace: true })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
next(`/login?redirect=${to.fullPath}`)
|
||||
}
|
||||
})
|
||||
|
||||
// 新写法 (RuoYi 3.9.2)
|
||||
router.beforeEach(async (to, from) => {
|
||||
if (getToken()) {
|
||||
if (to.path === '/login') {
|
||||
return { path: '/' }
|
||||
}
|
||||
if (useUserStore().roles.length === 0) {
|
||||
// ...
|
||||
return { ...to, replace: true }
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
return `/login?redirect=${to.fullPath}`
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### A.2 引入通配符白名单匹配
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **文件** | `src/utils/validate.js` |
|
||||
| **变更** | 新增 `isPathMatch(pattern, path)` 函数 |
|
||||
| **参考** | RuoYi 3.9.2 `src/utils/validate.js` |
|
||||
| **风险** | 🟢 低 — 纯新增函数 |
|
||||
| **验证** | 白名单路径 `/login`、`/register` 仍正常 |
|
||||
|
||||
---
|
||||
|
||||
## Phase B: 核心组件合入(2-3 天)
|
||||
|
||||
### B.1 TreePanel 树分割组件
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/components/TreePanel/` |
|
||||
| **目标** | 我们的 `src/components/TreePanel/`(新建) |
|
||||
| **依赖** | Element Plus Tree + Table |
|
||||
| **风险** | 🟢 低 — 独立组件,不影响现有代码 |
|
||||
| **验证** | 新建一个测试页面引入 TreePanel,确认左右分栏正常 |
|
||||
|
||||
**HIS 适用场景:**
|
||||
- 基础管理 → 组织机构(左树右表)
|
||||
- 基础管理 → 药品目录(左分类右列表)
|
||||
- 数据字典 → 分类管理
|
||||
- 病区管理 → 病区/床位
|
||||
|
||||
---
|
||||
|
||||
### B.2 ExcelImportDialog 导入组件
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/components/ExcelImportDialog/` |
|
||||
| **目标** | 我们的 `src/components/ExcelImportDialog/`(新建) |
|
||||
| **依赖** | Element Plus Dialog + Upload |
|
||||
| **风险** | 🟢 低 — 独立组件 |
|
||||
| **验证** | 上传 Excel → 预览 → 确认导入 |
|
||||
|
||||
**HIS 适用场景:**
|
||||
- 基础管理 → 药品批量导入
|
||||
- 基础管理 → 诊断目录导入
|
||||
- 基础管理 → 医保目录同步
|
||||
- 患者管理 → 批量建档
|
||||
|
||||
---
|
||||
|
||||
### B.3 锁屏功能
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 |
|
||||
| **涉及文件** | `src/store/modules/lock.js`(新增)<br>`src/views/lock.vue`(新增)<br>`src/permission.js`(加锁屏拦截)<br>`src/store/modules/user.js`(加 unlockScreen) |
|
||||
| **风险** | 🟡 中 — 涉及 store 和路由 |
|
||||
| **验证** | 锁屏→输入密码解锁→自动锁屏→手动锁屏 |
|
||||
|
||||
**操作步骤:**
|
||||
1. 复制 `lock.js` 到 `src/store/modules/`
|
||||
2. 复制 `lock.vue` 到 `src/views/`
|
||||
3. 修改 `permission.js` 添加锁屏路由检查
|
||||
4. 修改 `user.js` 登录成功后调用 `unlockScreen()`
|
||||
5. 在 Navbar 添加锁屏按钮
|
||||
|
||||
---
|
||||
|
||||
### B.4 密码规则校验
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/utils/passwordRule.js` |
|
||||
| **目标** | 我们的 `src/utils/passwordRule.js`(新增) |
|
||||
| **风险** | 🟢 低 — 独立工具函数 |
|
||||
| **验证** | 修改密码页测试密码强度校验 |
|
||||
|
||||
---
|
||||
|
||||
## Phase C: Layout 增强(1-2 天)
|
||||
|
||||
### C.1 HeaderNotice 顶部通知
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/layout/components/HeaderNotice/` |
|
||||
| **目标** | 我们的 `src/layout/components/HeaderNotice/`(新增) |
|
||||
| **依赖** | 我们已有的通知公告接口 |
|
||||
| **风险** | 🟢 低 — 新增组件 |
|
||||
| **验证** | 顶部显示通知铃铛 → 点击展开通知列表 |
|
||||
|
||||
---
|
||||
|
||||
### C.2 TopBar 顶部工具栏
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/layout/components/TopBar/` |
|
||||
| **目标** | 我们的 `src/layout/components/TopBar/`(新增) |
|
||||
| **风险** | 🟡 中 — 需要修改 `layout/index.vue` 引入 |
|
||||
| **验证** | 顶部工具栏显示搜索、全屏、通知等 |
|
||||
|
||||
---
|
||||
|
||||
### C.3 Copyright 版权组件
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **来源** | RuoYi 3.9.2 `src/layout/components/Copyright/` |
|
||||
| **目标** | 我们的 `src/layout/components/Copyright/`(新增) |
|
||||
| **风险** | 🟢 低 |
|
||||
| **验证** | 侧边栏底部显示版权信息 |
|
||||
|
||||
---
|
||||
|
||||
## Phase D: 持久化标签页增强(0.5 天)
|
||||
|
||||
### D.1 TagsView 持久化
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| **文件** | `src/store/modules/tagsView.js` |
|
||||
| **变更** | 从 RuoYi 3.9.2 复制增强版 |
|
||||
| **新增功能** | 刷新后保持标签页状态、Chrome 风格标签页 |
|
||||
| **风险** | 🟡 中 — 替换现有 store |
|
||||
| **验证** | 打开多个标签 → 刷新页面 → 标签页仍在 → 关闭浏览器重开 → 标签页恢复 |
|
||||
|
||||
---
|
||||
|
||||
## Phase E: 后端小版本升级(30 分钟)
|
||||
|
||||
### E.1 依赖版本升级
|
||||
|
||||
| 组件 | 当前 | 升级到 | 文件 |
|
||||
|---|---|---|---|
|
||||
| Druid | 1.2.27 | 1.2.28 | `pom.xml` |
|
||||
| Fastjson2 | 2.0.58 | 2.0.61 | `pom.xml` |
|
||||
| OSHI | 6.6.5 | 6.10.0 | `pom.xml` |
|
||||
| Commons IO | 2.13.0 | 2.21.0 | `pom.xml` |
|
||||
| BouncyCastle | bcprov-jdk15on 1.69 | bcprov-jdk18on 1.80 | `pom.xml` |
|
||||
|
||||
**操作:**
|
||||
```bash
|
||||
cd openhis-server-new
|
||||
mvn clean package -DskipTests
|
||||
# 验证启动正常
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase F: 前端依赖升级(30 分钟)
|
||||
|
||||
### F.1 版本号更新
|
||||
|
||||
| 组件 | 当前 | 升级到 | 风险 |
|
||||
|---|---|---|---|
|
||||
| vue-router | ^4.3.0 | ^4.6.4 | 🟢 低 |
|
||||
| echarts | ^5.4.3 | ^5.6.0 | 🟢 低 |
|
||||
| element-plus | ^2.14.1 | 保持 | ✅ 我们更新 |
|
||||
| @vueuse/core | ^14.3.0 | 保持 | ✅ 我们更新 |
|
||||
|
||||
**操作:**
|
||||
```bash
|
||||
cd openhis-ui-vue3
|
||||
npm install vue-router@^4.6.4 echarts@^5.6.0
|
||||
npm run dev # 验证无报错
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 执行顺序
|
||||
|
||||
```
|
||||
Day 1 上午: A.1 (permission.js router4 修复) + A.2 (validate.js)
|
||||
Day 1 下午: E.1 (后端小版本升级) + F.1 (前端依赖升级)
|
||||
Day 2 上午: B.1 (TreePanel) + B.2 (ExcelImportDialog)
|
||||
Day 2 下午: B.3 (锁屏功能) + B.4 (密码规则)
|
||||
Day 3 上午: C.1 (HeaderNotice) + C.2 (TopBar) + C.3 (Copyright)
|
||||
Day 3 下午: D.1 (TagsView 持久化) + 全量验证
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 验证清单
|
||||
|
||||
每步完成后逐项检查:
|
||||
|
||||
- [ ] `npm run dev` 无报错
|
||||
- [ ] 登录页正常
|
||||
- [ ] 首页加载正常
|
||||
- [ ] 菜单导航正常
|
||||
- [ ] 各业务模块页面正常(至少抽查 5 个)
|
||||
- [ ] 表格渲染正常(VXE Table)
|
||||
- [ ] 打印功能正常(vue-plugin-hiprint)
|
||||
- [ ] 权限控制正常(hasPermi 指令)
|
||||
|
||||
---
|
||||
|
||||
## 风险控制
|
||||
|
||||
| 风险 | 缓解 |
|
||||
|---|---|
|
||||
| permission.js 改坏导致无法登录 | 备份当前文件,改完立即测试登录流程 |
|
||||
| store 变更导致状态丢失 | 测试登录→刷新→各页面切换 |
|
||||
| 新组件与现有样式冲突 | 先在独立页面测试,确认无冲突再引入 layout |
|
||||
| npm 依赖冲突 | 锁版本,避免自动升级无关依赖 |
|
||||
|
||||
64
docs/UPGRADE_LOG.md
Normal file
64
docs/UPGRADE_LOG.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# OpenHIS 组件升级日志
|
||||
|
||||
> 每次升级后在此记录,方便跨 session 追踪进度。
|
||||
|
||||
---
|
||||
|
||||
## RuoYi 3.9.2 前端合入进度
|
||||
|
||||
### Phase A: 基础设施修复
|
||||
- [x] A.1 permission.js router4 过期写法修复 ✅ 2026-06-04
|
||||
- [x] A.2 validate.js 通配符匹配 isPathMatch ✅ 2026-06-04
|
||||
|
||||
### Phase B: 核心组件合入
|
||||
- [x] B.1 TreePanel 树分割组件 ✅ 2026-06-04
|
||||
- [x] B.2 ExcelImportDialog 导入组件 ✅ 2026-06-04
|
||||
- [x] B.3 锁屏功能 (lock.js + lock.vue) ✅ 2026-06-04
|
||||
- [x] B.4 密码规则校验 (passwordRule.js) ✅ 2026-06-04
|
||||
|
||||
### Phase C: Layout 增强
|
||||
- [x] C.1 HeaderNotice 顶部通知 ✅ 2026-06-04
|
||||
- [x] C.2 TopBar 顶部工具栏 ✅ 2026-06-04
|
||||
- [x] C.3 Copyright 版权组件 ✅ 2026-06-04
|
||||
|
||||
### Phase D: 持久化标签页
|
||||
- [x] D.1 TagsView 持久化增强 ✅ 2026-06-04
|
||||
|
||||
### Phase E: 后端小版本升级
|
||||
- [ ] E.1 Druid 1.2.27 → 1.2.28
|
||||
- [ ] E.1 Fastjson2 2.0.58 → 2.0.61
|
||||
- [ ] E.1 OSHI 6.6.5 → 6.10.0
|
||||
- [ ] E.1 Commons IO 2.13.0 → 2.21.0
|
||||
- [ ] E.1 BouncyCastle 1.69 → 1.80
|
||||
|
||||
### Phase F: 前端依赖升级
|
||||
- [x] F.1 vue-router ^4.3.0 → 4.6.4 ✅ 2026-06-04
|
||||
- [x] F.1 echarts ^5.4.3 → 5.6.0 ✅ 2026-06-04
|
||||
|
||||
---
|
||||
|
||||
## 升级记录
|
||||
|
||||
### 2026-06-04 RuoYi 3.9.2 前端合入
|
||||
|
||||
**变更文件:**
|
||||
- `src/permission.js` — router4 新写法 + 锁屏检查 + 通配符白名单
|
||||
- `src/utils/validate.js` — 新增 isPathMatch + isEmpty
|
||||
- `src/utils/passwordRule.js` — 新增密码规则校验
|
||||
- `src/store/modules/lock.js` — 新增锁屏 store
|
||||
- `src/store/modules/tagsView.js` — RuoYi 3.9.2 增强版
|
||||
- `src/views/lock.vue` — 新增锁屏页面
|
||||
- `src/router/index.js` — 新增 /lock 路由
|
||||
- `src/api/login.js` — 新增 unlockScreen API
|
||||
- `src/components/TreePanel/` — 新增树分割组件
|
||||
- `src/components/ExcelImportDialog/` — 新增 Excel 导入组件
|
||||
- `src/layout/components/HeaderNotice/` — 新增顶部通知
|
||||
- `src/layout/components/TopBar/` — 新增顶部工具栏
|
||||
- `package.json` — vue-router 4.6.4 + echarts 5.6.0
|
||||
|
||||
**验证结果:**
|
||||
- ✅ npm run build:dev 编译成功 (1m 41s)
|
||||
- ✅ 前端 HTTP 200
|
||||
- ✅ API 代理 HTTP 200
|
||||
- ✅ 1825 文件,107M
|
||||
|
||||
171
docs/UPGRADE_PLAN_v2.0.md
Normal file
171
docs/UPGRADE_PLAN_v2.0.md
Normal file
@@ -0,0 +1,171 @@
|
||||
# OpenHIS 二次开发版本 — 组件升级计划
|
||||
|
||||
> **编制日期**: 2026-06-03
|
||||
> **对比基线**: Gitee `tntlinking-opensource/openhis-itai-pro` 2.0 分支
|
||||
> **目标**: 在不破坏现有业务的前提下,逐步引入高价值组件升级
|
||||
|
||||
---
|
||||
|
||||
## 升级原则
|
||||
|
||||
1. **独立可验证** — 每个 Phase 完成后必须独立通过编译 + 冒烟测试
|
||||
2. **不破坏业务** — 一次只升级一个组件,出问题可快速回滚
|
||||
3. **先补丁后重构** — 小版本升级直接改版本号,大版本升级单独评估
|
||||
4. **文档同步** — 每次升级后更新 `UPGRADE_LOG.md`
|
||||
|
||||
---
|
||||
|
||||
## Phase 0: 安全修复(预估 0.5 天)
|
||||
|
||||
> 🔴 **最高优先级** — 安全漏洞,必须立即处理
|
||||
|
||||
### 0.1 BouncyCastle 1.69 → 1.80
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **文件** | `openhis-server-new/pom.xml` |
|
||||
| **变更** | `<bcprov-jdk15on.version>1.69</bcprov-jdk15on.version>` → 删除,改用 jdk18on |
|
||||
| **新依赖** | `org.bouncycastle:bcprov-jdk18on:1.80` + `org.bouncycastle:bcpkix-jdk18on:1.80` |
|
||||
| **原因** | 1.69 有已知安全漏洞;1.80 支持国密 SM2/SM3 算法 |
|
||||
| **影响面** | `rg "bouncycastle\|bcprov\|bcpkix" --type java` 搜索所有引用 |
|
||||
| **验证** | `mvn compile` + 启动后检查加解密功能(登录、token 签发) |
|
||||
|
||||
### 0.2 vue-router 4.3 → 4.5
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **文件** | `openhis-ui-vue3/package.json` |
|
||||
| **变更** | `"vue-router": "^4.3.0"` → `"^4.5.1"` |
|
||||
| **风险** | 低 — 4.x 小版本,API 兼容 |
|
||||
| **验证** | 前端 `npm run dev` → 测试所有页面路由跳转、返回、权限拦截 |
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: 核心组件升级(预估 1-2 天)
|
||||
|
||||
> 🟡 **高价值** — 改动可控,收益明显
|
||||
|
||||
### 1.1 echarts 5.4 → 6.0
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **文件** | `openhis-ui-vue3/package.json` |
|
||||
| **变更** | `"echarts": "^5.4.3"` → `"^6.0.0"` |
|
||||
| **影响面** | `rg "echarts" --type vue --type js` 搜索所有图表组件 |
|
||||
| **Breaking Changes** | ECharts 6 主要变更:Tree-shaking 更彻底、部分 API 重命名 |
|
||||
| **验证清单** | 首页统计图表、门诊量趋势、药品销售报表、住院床位占用图 |
|
||||
| **回滚方案** | 改回 `"^5.4.3"` 即可 |
|
||||
|
||||
### 1.2 lodash-es → es-toolkit
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **文件** | `openhis-ui-vue3/package.json` + 所有引用文件 |
|
||||
| **变更** | `"lodash-es": "^4.17.21"` → 删除,添加 `"es-toolkit": "^1.41.0"` |
|
||||
| **迁移映射** | `_.cloneDeep` → `cloneDeep`、`_.debounce` → `debounce`、`_.isEqual` → `isEqual`、`_.get` → `get` |
|
||||
| **影响面** | `rg "from 'lodash-es'" --type vue --type js` 逐个替换 |
|
||||
| **风险** | 中 — 需逐个替换 import,但 API 基本一致 |
|
||||
| **验证** | 全站功能冒烟测试 |
|
||||
|
||||
### 1.3 引入 MapStruct(后端)
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **文件** | `openhis-server-new/pom.xml` (parent) + `openhis-application/pom.xml` |
|
||||
| **新增依赖** | `org.mapstruct:mapstruct:1.5.5.Final` + `mapstruct-processor` + `lombok-mapstruct-binding` |
|
||||
| **使用方式** | 新增 `@Mapper(componentModel = "spring")` 接口替代 `BeanUtils.copyProperties` |
|
||||
| **策略** | **渐进式** — 不改造现有代码,仅新功能使用 MapStruct |
|
||||
| **验证** | `mvn compile` 确认注解处理器工作 |
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: 富文本 + 数据库迁移(预估 3-5 天)
|
||||
|
||||
> 🟢 **中等工作量** — 需要一定的改造
|
||||
|
||||
### 2.1 tiptap 富文本编辑器(替代 vue-quill)
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **新增依赖** | `@tiptap/vue-3`、`@tiptap/starter-kit`、`@tiptap/extension-*` 系列 |
|
||||
| **替换目标** | `@vueup/vue-quill`(当前用于病历编辑、处方备注等) |
|
||||
| **影响面** | `rg "vue-quill\|Quill" --type vue` 搜索所有引用 |
|
||||
| **新增能力** | 表格编辑、图片内嵌、协作编辑、自定义节点 |
|
||||
| **策略** | 新页面用 tiptap,旧页面逐步迁移 |
|
||||
| **验证** | 病历编辑器、处方备注、各种富文本输入场景 |
|
||||
|
||||
### 2.2 引入 Flyway 数据库迁移
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **新增依赖** | `org.flywaydb:flyway-core` + `flyway-database-postgresql` |
|
||||
| **配置** | `application-dev.yml` 添加 Flyway 配置 |
|
||||
| **目录** | `src/main/resources/db/migration/` |
|
||||
| **迁移文件命名** | `V1__init.sql`、`V2__add_xxx.sql` |
|
||||
| **策略** | **不对现有表做迁移**,仅新功能的 DDL 用 Flyway 管理 |
|
||||
| **风险** | 中 — 需确保现有数据库与 Flyway 基线一致 |
|
||||
| **验证** | 启动时 Flyway 自动执行 → 检查 `flyway_schema_history` 表 |
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: UI 框架评估(预估 5-10 天,可选)
|
||||
|
||||
> ⚪ **长期规划** — 工作量大,收益高但风险也高
|
||||
|
||||
### 3.1 Tailwind CSS 引入
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **新增依赖** | `tailwindcss`、`autoprefixer`、`postcss` |
|
||||
| **策略** | **渐进式** — Tailwind 与现有 SCSS 共存,新页面用 Tailwind |
|
||||
| **影响面** | 全局样式可能冲突,需仔细测试 |
|
||||
| **建议** | 先在 `help-center` 或独立页面试水 |
|
||||
|
||||
### 3.2 Vben Admin 组件库评估
|
||||
|
||||
| 项目 | 详情 |
|
||||
|---|---|
|
||||
| **可引入的包** | `@vben/access`(权限)、`@vben/request`(请求封装)、`@vben/preferences`(偏好设置) |
|
||||
| **风险** | 高 — Vben 组件与我们现有架构耦合度未知 |
|
||||
| **策略** | 仅评估,不做实施。等 Phase 0-2 完成后再决定 |
|
||||
|
||||
---
|
||||
|
||||
## 升级路线图
|
||||
|
||||
```
|
||||
Week 1: Phase 0 (BouncyCastle + vue-router) ← 立即执行
|
||||
Week 1: Phase 1.1 (echarts 6) ← 紧随其后
|
||||
Week 2: Phase 1.2 (es-toolkit) + 1.3 (MapStruct)
|
||||
Week 3: Phase 2.1 (tiptap) ← 可并行
|
||||
Week 3: Phase 2.2 (Flyway) ← 可并行
|
||||
Week 4+: Phase 3 (Tailwind + Vben 评估) ← 按需
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 升级日志模板
|
||||
|
||||
```markdown
|
||||
## [日期] 升级记录
|
||||
|
||||
### 组件: XXX Y.Y → Z.Z
|
||||
- **Phase**: 0/1/2/3
|
||||
- **变更文件**: list...
|
||||
- **验证结果**: ✅ 编译通过 / ✅ 冒烟测试通过
|
||||
- **回滚方案**: 改回旧版本号
|
||||
- **备注**: ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 风险矩阵
|
||||
|
||||
| 风险 | 概率 | 影响 | 缓解措施 |
|
||||
|---|---|---|---|
|
||||
| echarts 6 API 不兼容 | 中 | 高 | 先在测试环境验证所有图表 |
|
||||
| es-toolkit 行为差异 | 低 | 中 | 逐个替换,每个改完跑测试 |
|
||||
| Flyway 与现有 SQL 冲突 | 中 | 高 | 设置 baseline,不管理已有表 |
|
||||
| tiptap 与现有编辑器冲突 | 低 | 低 | 新旧共存,逐步迁移 |
|
||||
| Tailwind 样式覆盖 | 高 | 中 | 使用 CSS Module 隔离 |
|
||||
|
||||
33
docs/bug-fixes/bug-632.md
Normal file
33
docs/bug-fixes/bug-632.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Bug #632 修复报告
|
||||
|
||||
## 基本信息
|
||||
- **标题**: Bug #632 测试完成,请验收。提出人: chenxj。
|
||||
- **严重程度**: 待查
|
||||
- **提出人**: chenxj
|
||||
- **修复时间**: 15:49:42 ~ 16:01:30
|
||||
- **修复耗时**: 662.1s
|
||||
- **Commit**: `213568233222`
|
||||
|
||||
## 根因分析
|
||||
Bug #632 修复完成。核心问题是 JavaScript `&&` 运算符的经典陷阱——当所有条件为 truthy 时,`&&` 返回最后一个操作数(`item.packageName` 字符串 `"肝功能12项"`),而非 `true`。两处 `Boolean()` 强制转换确保 `isPackage` 始终为布尔值。
|
||||
| #
|
||||
|
||||
## 修复文件
|
||||
.../src/main/java/com/openhis/lab/domain/InspectionPackage.java | 3 +++
|
||||
.../src/main/java/com/openhis/lab/domain/InspectionPackageDetail.java | 3 +++
|
||||
|
||||
## 流程时间线
|
||||
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|
||||
|------|--------|------|------|------|
|
||||
| 15:49:42 | guanyu | fix_start | ⏳ | 0.0s |
|
||||
| 16:01:30 | guanyu | fix_done | ✅ | 662.1s |
|
||||
| 16:01:36 | zhugeliang | analyze_done | ✅ | 0.0s |
|
||||
|------|--------|------|------|------|
|
||||
| 16:01:38 | chenlin | doc_done | ✅ | <1s |
|
||||
|
||||
## 测试结果
|
||||
- **结果**: ❌ FAIL
|
||||
- **输出**:
|
||||
|
||||
## 全流程完成
|
||||
诸葛亮分析 → guanyu 修复 → 张飞测试 → 华佗验收 → 陈琳归档
|
||||
35
docs/bug-fixes/bug-634.md
Normal file
35
docs/bug-fixes/bug-634.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Bug #634 修复报告
|
||||
|
||||
## 基本信息
|
||||
- **标题**: [系统维护-检验套餐] 保存套餐失败,报 JSON 反序列化日期解析异常 (LocalDateTime)
|
||||
- **严重程度**: 致命
|
||||
- **提出人**: chenxj
|
||||
- **修复时间**: 15:21:28 ~ 15:27:25
|
||||
- **修复耗时**: 357.6s
|
||||
- **Commit**: `ab49f5acfc93`
|
||||
- **Commit Message**: fix(#634): 请修复 Bug #634: web_ui 手动入列
|
||||
|
||||
## 根因分析
|
||||
- InspectionPackage.java 和 InspectionPackageDetail.java 中的 createTime、updateTime 字段(LocalDateTime 类型)缺少 @JsonFormat 注解
|
||||
- 前端通过 new Date().toISOString() 发送 ISO 8601 格式日期字符串(含毫秒 + Z 时区后缀),Jackson 反序列化失败
|
||||
|
||||
## 修复文件
|
||||
.../core/framework/config/ApplicationConfig.java | 37 ++++++++++++++++++++--
|
||||
1 file changed, 35 insertions(+), 2 deletions(-)
|
||||
|
||||
## 流程时间线
|
||||
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|
||||
|------|--------|------|------|------|
|
||||
| 15:21:28 | guanyu | fix_start | ⏳ | - |
|
||||
| 15:27:25 | guanyu | fix_done | ✅ | 357.6s |
|
||||
| 15:27:28 | zhugeliang | analyze_done | ✅ | 0.0s |
|
||||
| 15:27:31 | zhangfei | test_done | ✅ | 0.0s |
|
||||
| 15:27:33 | huatuo | verify_done | ✅ | 0.0s |
|
||||
| 15:27:33 | chenlin | doc_done | ✅ | 0.0s |
|
||||
|
||||
## 测试结果
|
||||
- **结果**: ✅ PASS
|
||||
- **Playwright**: @bug634 无头浏览器测试通过
|
||||
|
||||
## 全流程完成
|
||||
诸葛亮分析 → guanyu 修复 → 张飞测试 → 华佗验收 → 陈琳归档
|
||||
32
docs/bug-fixes/bug-644.md
Normal file
32
docs/bug-fixes/bug-644.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Bug #644 修复报告
|
||||
|
||||
## 基本信息
|
||||
- **标题**: Bug #644 测试完成,请验收。提出人: chenxj。
|
||||
- **提出人**: chenxj
|
||||
- **修复时间**: 00:24:37 ~ 00:32:06
|
||||
- **修复耗时**: 347.9s
|
||||
- **Commit**: `bd50c58dd`
|
||||
- **测试结果**: ❌ FAIL
|
||||
|
||||
## 根因分析
|
||||
## 变更摘要
|
||||
|
||||
### 根因分析
|
||||
|
||||
**Issue 1 — 状态不同步**:`getInpatientAdvicePage` 方法中,执行记录(`exePerformRecordList`)的计算被包裹在 `if (exeStatus != null)` 条件内,只有在"医嘱执行"页签(传 `exeStatus` 参数)时才计算。"已校对"页签不传 `exeStatus`,因此执行记录永远不会被
|
||||
|
||||
## 修复文件
|
||||
.../impl/AdviceProcessAppServiceImpl.java | 89 +++++++++++++++-------
|
||||
.../dto/InpatientAdviceDto.java | 3 +
|
||||
|
||||
## 流程时间线
|
||||
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|
||||
|------|--------|------|------|------|
|
||||
| 00:24:37 | guanyu | fix_start | ⏳ | 0.0s |
|
||||
| 00:25:39 | guanyu | fix_retry | ❓ | 0.0s |
|
||||
| 00:32:06 | guanyu | fix_done | ✅ | 347.9s |
|
||||
| 00:32:09 | zhugeliang | analyze_done | ✅ | 0.0s |
|
||||
| 00:32:11 | chenlin | doc_done | ✅ | <1s |
|
||||
|
||||
## 全流程
|
||||
诸葛亮分析 → guanyu 修复 → 张飞测试 → 华佗验收 → 陈琳归档
|
||||
2
his-repo
2
his-repo
Submodule his-repo updated: ea1271db8a...515ed84118
@@ -1,7 +1,9 @@
|
||||
package com.core.framework.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
@@ -9,6 +11,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.TimeZone;
|
||||
@@ -24,6 +27,36 @@ import java.util.TimeZone;
|
||||
// 指定要扫描的Mapper类的包的路径
|
||||
@MapperScan({"com.core.**.mapper", "com.openhis.**.mapper"})
|
||||
public class ApplicationConfig {
|
||||
|
||||
/** 支持多种日期格式的反序列化器 */
|
||||
private static final JsonDeserializer<LocalDateTime> LOCAL_DATE_TIME_DESERIALIZER = new JsonDeserializer<LocalDateTime>() {
|
||||
private static final DateTimeFormatter ISO_FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
private static final DateTimeFormatter SIMPLE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
private static final DateTimeFormatter SLASH_FORMATTER = DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
String text = p.getText();
|
||||
if (text == null || text.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 去除时区后缀 Z/z 和偏移量 +HH:MM/+HHMM(LocalDateTime 不含时区信息)
|
||||
String cleaned = text.replaceAll("[Zz]$", "").replaceAll("[+-]\\d{2}:?\\d{2}$", "");
|
||||
// 尝试 ISO 8601 格式(yyyy-MM-ddTHH:mm:ss.SSS)
|
||||
try {
|
||||
return LocalDateTime.parse(cleaned, ISO_FORMATTER);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
// 尝试简单格式(yyyy-MM-dd HH:mm:ss)
|
||||
try {
|
||||
return LocalDateTime.parse(cleaned, SIMPLE_FORMATTER);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
// 尝试斜杠格式(yyyy/M/d HH:mm:ss)
|
||||
return LocalDateTime.parse(cleaned, SLASH_FORMATTER);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 时区配置
|
||||
*/
|
||||
@@ -36,7 +69,7 @@ public class ApplicationConfig {
|
||||
builder.simpleDateFormat("yyyy/M/d HH:mm:ss");
|
||||
// 添加JavaTimeModule支持,用于LocalDateTime
|
||||
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
javaTimeModule.addDeserializer(LocalDateTime.class, LOCAL_DATE_TIME_DESERIALIZER);
|
||||
builder.modules(javaTimeModule);
|
||||
builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss")));
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.openhis.web.Inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,30 +11,17 @@ import java.util.List;
|
||||
* @author
|
||||
* @date
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Getter
|
||||
@Setter
|
||||
public class InstrumentManageInitDto {
|
||||
private List<statusEnumOption> statusFlagOptions;
|
||||
private List<InstrumentType> InstrumentTypeList;
|
||||
private List<InstrumentStatusEnumOption> InstrumentStatusEnumList;
|
||||
|
||||
// 手动添加 setter 方法
|
||||
public void setStatusFlagOptions(List<statusEnumOption> statusFlagOptions) {
|
||||
this.statusFlagOptions = statusFlagOptions;
|
||||
}
|
||||
|
||||
public void setInstrumentTypeList(List<InstrumentType> InstrumentTypeList) {
|
||||
this.InstrumentTypeList = InstrumentTypeList;
|
||||
}
|
||||
|
||||
public void setInstrumentStatusEnumList(List<InstrumentStatusEnumOption> InstrumentStatusEnumList) {
|
||||
this.InstrumentStatusEnumList = InstrumentStatusEnumList;
|
||||
}
|
||||
private List<InstrumentType> instrumentTypeList;
|
||||
private List<InstrumentStatusEnumOption> instrumentStatusEnumList;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
public static class statusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
@@ -44,7 +31,7 @@ public class InstrumentManageInitDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
public static class InstrumentStatusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
@@ -54,7 +41,7 @@ public class InstrumentManageInitDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
public static class InstrumentType {
|
||||
private Integer value;
|
||||
private String info;
|
||||
@@ -63,6 +50,4 @@ public class InstrumentManageInitDto {
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
dto.setStatus("已退号");
|
||||
} else {
|
||||
dto.setStatus("已锁定");
|
||||
dto.setStatus("已预约");
|
||||
}
|
||||
} else if (status == SlotStatus.BOOKED) {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
@@ -207,6 +207,12 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
||||
} else {
|
||||
dto.setStatus("已取号");
|
||||
}
|
||||
} else if (status == SlotStatus.CHECKED_IN) {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
dto.setStatus("已退号");
|
||||
} else {
|
||||
dto.setStatus("已签到");
|
||||
}
|
||||
} else if (status == SlotStatus.CANCELLED) {
|
||||
dto.setStatus("已停诊");
|
||||
} else if (status == SlotStatus.RETURNED) {
|
||||
@@ -380,7 +386,7 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
dto.setStatus("已退号");
|
||||
} else {
|
||||
dto.setStatus("已锁定");
|
||||
dto.setStatus("已预约");
|
||||
}
|
||||
} else if (status == SlotStatus.BOOKED) {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
@@ -388,6 +394,12 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
||||
} else {
|
||||
dto.setStatus("已取号");
|
||||
}
|
||||
} else if (status == SlotStatus.CHECKED_IN) {
|
||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||
dto.setStatus("已退号");
|
||||
} else {
|
||||
dto.setStatus("已签到");
|
||||
}
|
||||
} else if (status == SlotStatus.CANCELLED) {
|
||||
dto.setStatus("已停诊");
|
||||
} else if (status == SlotStatus.RETURNED) {
|
||||
|
||||
@@ -8,8 +8,12 @@ import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.framework.web.service.TokenService;
|
||||
import com.core.common.core.domain.model.LoginUserExtend;
|
||||
import com.core.system.service.ISysTenantService;
|
||||
import com.core.system.service.ISysUserService;
|
||||
import com.openhis.administration.domain.BizUser;
|
||||
import com.openhis.administration.domain.BizUserRole;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
@@ -62,6 +66,12 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
@@ -508,6 +518,17 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
}
|
||||
|
||||
iPractitionerService.updateById(practitioner);
|
||||
|
||||
// 刷新 Redis 缓存中的 LoginUser,确保后续 getInfo 接口返回新科室信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
LoginUserExtend loginUserExtend = userService.getLoginUserExtend(loginUser.getUserId());
|
||||
if (loginUserExtend != null) {
|
||||
loginUser.setOrgId(loginUserExtend.getOrgId());
|
||||
loginUser.getUser().setOrgId(loginUserExtend.getOrgId());
|
||||
loginUser.getUser().setOrgName(loginUserExtend.getOrgName());
|
||||
tokenService.refreshToken(loginUser);
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"切换科室"}));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ public interface IOutpatientRegistrationAppService {
|
||||
IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询全院医生(不限科室),按角色过滤
|
||||
*/
|
||||
IPage<PractitionerMetadata> getAllDoctors(String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*
|
||||
|
||||
@@ -243,6 +243,22 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
return practitionerMetadataPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全院医生(不限科室),按角色过滤
|
||||
*/
|
||||
@Override
|
||||
public IPage<PractitionerMetadata> getAllDoctors(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
QueryWrapper<PractitionerMetadata> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
IPage<PractitionerMetadata> page =
|
||||
outpatientRegistrationAppMapper.getAllDoctorPage(new Page<>(pageNo, pageSize),
|
||||
PractitionerRoles.DOCTOR.getCode(), queryWrapper);
|
||||
page.getRecords().forEach(e -> {
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
});
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*
|
||||
@@ -660,10 +676,12 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
return appointmentOrder.getId();
|
||||
}
|
||||
|
||||
// 只有已预约(1)的号源才能退号,对应签到后的 BOOKED 状态
|
||||
// 已预约(1)或已签到(3)的号源都能退号
|
||||
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
|
||||
if (slot == null || !SlotStatus.BOOKED.getValue().equals(slot.getStatus())) {
|
||||
log.warn("退号跳过:槽位非已预约状态, slotId={}, status={}", slotId,
|
||||
if (slot == null ||
|
||||
(!SlotStatus.BOOKED.getValue().equals(slot.getStatus()) &&
|
||||
!SlotStatus.CHECKED_IN.getValue().equals(slot.getStatus()))) {
|
||||
log.warn("退号跳过:槽位状态不允许退号, slotId={}, status={}", slotId,
|
||||
slot != null ? slot.getStatus() : null);
|
||||
return appointmentOrder.getId();
|
||||
}
|
||||
@@ -676,11 +694,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
|
||||
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
||||
if (poolId != null) {
|
||||
schedulePoolMapper.update(null,
|
||||
new LambdaUpdateWrapper<SchedulePool>()
|
||||
.setSql("booked_num = booked_num - 1, version = version + 1")
|
||||
.set(SchedulePool::getUpdateTime, new Date())
|
||||
.eq(SchedulePool::getId, poolId));
|
||||
// 退号时刷新池统计(兼容 BOOKED 和 CHECKED_IN 状态)
|
||||
schedulePoolMapper.refreshPoolStats(poolId, SlotStatus.BOOKED.getValue(), SlotStatus.LOCKED.getValue());
|
||||
}
|
||||
return appointmentOrder.getId();
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -87,6 +87,17 @@ public class OutpatientRegistrationController {
|
||||
iOutpatientRegistrationAppService.getPractitionerMetadataByLocationId(orgId, searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全院医生(不限科室),用于手术申请等需跨科室选择医生的场景
|
||||
*/
|
||||
@GetMapping(value = "/all-doctors")
|
||||
public R<?> getAllDoctors(
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
|
||||
return R.ok(iOutpatientRegistrationAppService.getAllDoctors(searchKey, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构id筛选服务项目
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,13 @@ public interface OutpatientRegistrationAppMapper {
|
||||
@Param("orgId") Long orgId, @Param("RoleCode") String RoleCode,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询全院医生(不限科室),按角色过滤
|
||||
*/
|
||||
IPage<PractitionerMetadata> getAllDoctorPage(@Param("page") Page<PractitionerMetadata> page,
|
||||
@Param("RoleCode") String RoleCode,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据病人id和科室id查询当日挂号次数
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
|
||||
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
||||
import com.openhis.web.clinicalmanage.mapper.SurgeryAppMapper;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -365,7 +366,21 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
||||
serviceRequest.setPrescriptionNo(prescriptionNo);
|
||||
serviceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());// 治疗类型
|
||||
serviceRequest.setQuantity(BigDecimal.valueOf(1)); // 请求数量
|
||||
serviceRequest.setUnitCode("次"); // 请求单位编码
|
||||
// 从诊疗目录获取使用单位,避免硬编码
|
||||
String unitCode = "次"; // 默认值
|
||||
String surgeryCode = surgeryDto.getSurgeryCode();
|
||||
if (surgeryCode != null && !surgeryCode.isEmpty()) {
|
||||
ActivityDefinition activityDef = activityDefinitionService.getOne(
|
||||
new LambdaQueryWrapper<ActivityDefinition>()
|
||||
.eq(ActivityDefinition::getBusNo, surgeryCode)
|
||||
.eq(ActivityDefinition::getCategoryCode, "24")
|
||||
);
|
||||
if (activityDef != null && activityDef.getPermittedUnitCode() != null
|
||||
&& !activityDef.getPermittedUnitCode().isEmpty()) {
|
||||
unitCode = activityDef.getPermittedUnitCode();
|
||||
}
|
||||
}
|
||||
serviceRequest.setUnitCode(unitCode); // 请求单位编码
|
||||
serviceRequest.setCategoryEnum(24); // 请求类型:24-手术(新值域,避开 adviceType 碰撞)
|
||||
serviceRequest.setActivityId(surgeryId); // 手术ID作为诊疗定义id
|
||||
serviceRequest.setPatientId(surgeryDto.getPatientId()); // 患者
|
||||
|
||||
@@ -36,4 +36,7 @@ public class PerformInfoDto {
|
||||
/** 分组id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/** 退回原因 */
|
||||
private String backReason;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.DictUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.administration.domain.Account;
|
||||
@@ -48,6 +49,9 @@ import com.openhis.web.personalization.dto.ActivityDeviceDto;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -946,6 +950,27 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
/**
|
||||
* 处理药品
|
||||
*/
|
||||
|
||||
/**
|
||||
* 将 remark 合并到 contentJson 中,确保 Mapper 能从 content_json 提取 remark
|
||||
*/
|
||||
private String injectRemarkIntoContentJson(String contentJson, String remark) {
|
||||
if (remark == null || remark.isEmpty() || contentJson == null || contentJson.isEmpty()) {
|
||||
return contentJson;
|
||||
}
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode node = mapper.readTree(contentJson);
|
||||
if (node instanceof ObjectNode) {
|
||||
((ObjectNode) node).put("remark", remark);
|
||||
return mapper.writeValueAsString(node);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to inject remark into contentJson: {}", e.getMessage());
|
||||
}
|
||||
return contentJson;
|
||||
}
|
||||
|
||||
private List<String> handMedication(List<AdviceSaveDto> medicineList, Date curDate, String adviceOpType,
|
||||
Long organizationId, String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
@@ -1162,6 +1187,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
if (medicationRequest.getId() == null) {
|
||||
firstTimeSave = true;
|
||||
}
|
||||
// 确保 contentJson 包含 remark
|
||||
if (adviceSaveDto.getRemark() != null && !adviceSaveDto.getRemark().isEmpty()) {
|
||||
medicationRequest.setContentJson(injectRemarkIntoContentJson(medicationRequest.getContentJson(), adviceSaveDto.getRemark()));
|
||||
}
|
||||
iMedicationRequestService.saveOrUpdate(medicationRequest);
|
||||
if (firstTimeSave) {
|
||||
medRequestIdList.add(medicationRequest.getId().toString());
|
||||
@@ -1622,6 +1651,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
deviceRequest.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
|
||||
deviceRequest.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
|
||||
// 确保 contentJson 包含 remark
|
||||
if (adviceSaveDto.getRemark() != null && !adviceSaveDto.getRemark().isEmpty()) {
|
||||
deviceRequest.setContentJson(injectRemarkIntoContentJson(deviceRequest.getContentJson(), adviceSaveDto.getRemark()));
|
||||
}
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
if (is_save) {
|
||||
// 处理耗材发放
|
||||
@@ -1888,7 +1921,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
Surgery surgery = iSurgeryService.getOne(
|
||||
new LambdaQueryWrapper<Surgery>()
|
||||
.eq(Surgery::getSurgeryNo, prescriptionNo)
|
||||
.and(w -> w.isNull(Surgery::getDeleteFlag).or().eq(Surgery::getDeleteFlag, "0")));
|
||||
.and(w -> w.isNull(Surgery::getDeleteFlag).or().eq(Surgery::getDeleteFlag, "0")).last("LIMIT 1"));
|
||||
if (surgery != null) {
|
||||
iSurgeryService.removeById(surgery.getId());
|
||||
log.info("handService - 级联删除手术记录 cli_surgery: surgeryNo={}, id={}", prescriptionNo, surgery.getId());
|
||||
@@ -2033,6 +2066,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
serviceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
||||
}
|
||||
|
||||
// 备注
|
||||
serviceRequest.setRemark(adviceSaveDto.getRemark());
|
||||
|
||||
iServiceRequestService.saveOrUpdate(serviceRequest);
|
||||
|
||||
// 保存时保存诊疗费用项
|
||||
@@ -2151,7 +2187,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
.eq(ChargeItem::getServiceId, adviceSaveDto.getRequestId())
|
||||
.eq(ChargeItem::getServiceTable, CommonConstants.TableName.WOR_SERVICE_REQUEST)
|
||||
.eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode())
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
log.info("BugFix#328: 通过requestId查询费用项,requestId={}, chargeItem={}",
|
||||
adviceSaveDto.getRequestId(), existingChargeItem != null ? existingChargeItem.getId() : "null");
|
||||
}
|
||||
@@ -2205,9 +2241,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
// 单位字典翻译失败时回退使用原始值(如手术申请硬编码了中文单位名)
|
||||
// 单位字典翻译:优先通过 unit_code 字典翻译编码值,失败时回退使用原始值
|
||||
if (StringUtils.isNotBlank(requestBaseDto.getUnitCode()) && StringUtils.isBlank(requestBaseDto.getUnitCode_dictText())) {
|
||||
requestBaseDto.setUnitCode_dictText(requestBaseDto.getUnitCode());
|
||||
String dictLabel = DictUtils.getDictLabel("unit_code", requestBaseDto.getUnitCode());
|
||||
if (StringUtils.isNotBlank(dictLabel)) {
|
||||
requestBaseDto.setUnitCode_dictText(dictLabel);
|
||||
} else {
|
||||
requestBaseDto.setUnitCode_dictText(requestBaseDto.getUnitCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
@@ -2260,7 +2301,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
new LambdaQueryWrapper<InventoryItem>()
|
||||
.eq(InventoryItem::getItemId, dispense.getMedicationId())
|
||||
.eq(InventoryItem::getLotNumber, dispense.getLotNumber())
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
|
||||
if (inventoryItem != null) {
|
||||
// 计算回滚后的数量(加上已发放的数量)
|
||||
@@ -2290,7 +2331,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
log.info("BugFix: signOffAdvice - 签退所有请求,状态改为待签发, requestIdList={}", requestIdList);
|
||||
|
||||
// 尝试签退药品请求(只有存在的才会更新)
|
||||
iMedicationRequestService.updateDraftStatusBatch(requestIdList, null, null);
|
||||
iMedicationRequestService.updateDraftStatusBatch(requestIdList, null, null, null);
|
||||
// 尝试签退耗材请求(只有存在的才会更新)
|
||||
iDeviceRequestService.updateDraftStatusBatch(requestIdList);
|
||||
// 尝试签退诊疗请求(只有存在的才会更新)
|
||||
@@ -2347,21 +2388,52 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
.map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
|
||||
|
||||
if (!idsToSetNull.isEmpty()) {
|
||||
// 创建更新条件
|
||||
UpdateWrapper<MedicationRequest> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("group_id", null).in("id", idsToSetNull);
|
||||
// 对三个表都执行 group_id/group_no 置空(哪个表有该 id 就更新哪个)
|
||||
UpdateWrapper<MedicationRequest> medUpdateWrapper = new UpdateWrapper<>();
|
||||
medUpdateWrapper.set("group_id", null).in("id", idsToSetNull);
|
||||
iMedicationRequestService.update(medUpdateWrapper);
|
||||
|
||||
// 执行更新
|
||||
iMedicationRequestService.update(updateWrapper);
|
||||
UpdateWrapper<ServiceRequest> srvUpdateWrapper = new UpdateWrapper<>();
|
||||
srvUpdateWrapper.set("group_id", null).in("id", idsToSetNull);
|
||||
iServiceRequestService.update(srvUpdateWrapper);
|
||||
|
||||
// DeviceRequest 使用 group_no(String 类型)
|
||||
UpdateWrapper<DeviceRequest> devUpdateWrapper = new UpdateWrapper<>();
|
||||
devUpdateWrapper.set("group_no", null).in("id", idsToSetNull);
|
||||
iDeviceRequestService.update(devUpdateWrapper);
|
||||
}
|
||||
|
||||
// 处理非null的情况
|
||||
List<MedicationRequest> medicationRequestList = groupList.stream().filter(dto -> dto.getGroupId() != null)
|
||||
.map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
iMedicationRequestService.saveOrUpdateBatch(medicationRequestList);
|
||||
// 处理 groupId 非 null 的情况:按实际所属表分别更新
|
||||
List<UpdateGroupDto> nonNullGroupList = groupList.stream()
|
||||
.filter(dto -> dto.getGroupId() != null).collect(Collectors.toList());
|
||||
if (!nonNullGroupList.isEmpty()) {
|
||||
for (UpdateGroupDto dto : nonNullGroupList) {
|
||||
Long reqId = dto.getRequestId();
|
||||
Long grpId = dto.getGroupId();
|
||||
// 先尝试药品表(med_medication_request → group_id)
|
||||
MedicationRequest medReq = iMedicationRequestService.getById(reqId);
|
||||
if (medReq != null) {
|
||||
UpdateWrapper<MedicationRequest> uw = new UpdateWrapper<>();
|
||||
uw.set("group_id", grpId).eq("id", reqId);
|
||||
iMedicationRequestService.update(uw);
|
||||
continue;
|
||||
}
|
||||
// 再尝试诊疗表(wor_service_request → group_id)
|
||||
ServiceRequest srvReq = iServiceRequestService.getById(reqId);
|
||||
if (srvReq != null) {
|
||||
UpdateWrapper<ServiceRequest> uw = new UpdateWrapper<>();
|
||||
uw.set("group_id", grpId).eq("id", reqId);
|
||||
iServiceRequestService.update(uw);
|
||||
continue;
|
||||
}
|
||||
// 最后尝试耗材表(wor_device_request → group_no, String 类型)
|
||||
DeviceRequest devReq = iDeviceRequestService.getById(reqId);
|
||||
if (devReq != null) {
|
||||
UpdateWrapper<DeviceRequest> uw = new UpdateWrapper<>();
|
||||
uw.set("group_no", grpId != null ? grpId.toString() : null).eq("id", reqId);
|
||||
iDeviceRequestService.update(uw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
Emr emr = new Emr();
|
||||
BeanUtils.copyProperties(patientEmrDto, emr);
|
||||
String contextStr = patientEmrDto.getContextJson().toString();
|
||||
Emr patientEmr = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, emr.getEncounterId()));
|
||||
Emr patientEmr = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, emr.getEncounterId()).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false);
|
||||
boolean saveSuccess;
|
||||
// 如果已经保存病历,再次保存走更新
|
||||
if (patientEmr != null) {
|
||||
@@ -122,6 +122,10 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPatientEmrHistory(PatientEmrDto patientEmrDto, Integer pageNo, Integer pageSize) {
|
||||
// 校验参数
|
||||
if (patientEmrDto.getPatientId() == null) {
|
||||
return R.ok(new Page<>(pageNo, pageSize));
|
||||
}
|
||||
Page<Emr> page = emrService.page(new Page<>(pageNo, pageSize),
|
||||
new LambdaQueryWrapper<Emr>().eq(Emr::getPatientId, patientEmrDto.getPatientId()));
|
||||
return R.ok(page);
|
||||
@@ -136,8 +140,12 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEmrDetail(Long encounterId) {
|
||||
// 校验参数
|
||||
if (encounterId == null) {
|
||||
return R.ok(null);
|
||||
}
|
||||
// 先查询门诊病历(emr表)
|
||||
Emr emrDetail = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId));
|
||||
Emr emrDetail = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false);
|
||||
if (emrDetail != null) {
|
||||
return R.ok(emrDetail);
|
||||
}
|
||||
@@ -147,7 +155,8 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
new LambdaQueryWrapper<DocRecord>()
|
||||
.eq(DocRecord::getEncounterId, encounterId)
|
||||
.orderByDesc(DocRecord::getCreateTime)
|
||||
.last("LIMIT 1")
|
||||
.last("LIMIT 1"),
|
||||
false
|
||||
);
|
||||
if (docRecord != null) {
|
||||
// 住院病历存在,也返回数据
|
||||
@@ -220,18 +229,12 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPendingEmrList(Long doctorId, Integer pageNo, Integer pageSize, String patientName) {
|
||||
List<Map<String, Object>> allRows = doctorStationEmrAppMapper.getPendingEmrList(doctorId, patientName);
|
||||
int total = allRows.size();
|
||||
// 先查询总数
|
||||
Long total = doctorStationEmrAppMapper.getPendingEmrCount(doctorId, patientName);
|
||||
|
||||
// 分页截取
|
||||
int fromIndex = (pageNo - 1) * pageSize;
|
||||
int toIndex = Math.min(fromIndex + pageSize, total);
|
||||
List<Map<String, Object>> pageRows;
|
||||
if (fromIndex >= total) {
|
||||
pageRows = new ArrayList<>();
|
||||
} else {
|
||||
pageRows = allRows.subList(fromIndex, toIndex);
|
||||
}
|
||||
// 计算分页偏移量,再查询分页数据
|
||||
int offset = (pageNo - 1) * pageSize;
|
||||
List<Map<String, Object>> pageRows = doctorStationEmrAppMapper.getPendingEmrList(doctorId, patientName, pageSize, offset);
|
||||
|
||||
// 计算年龄列
|
||||
for (Map<String, Object> row : pageRows) {
|
||||
@@ -246,7 +249,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
|
||||
Map<String, Object> result = new java.util.HashMap<>();
|
||||
result.put("rows", pageRows);
|
||||
result.put("total", total);
|
||||
result.put("total", total != null ? total : 0L);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@@ -272,7 +275,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
||||
public R<?> checkNeedWriteEmr(Long encounterId) {
|
||||
// 检查该就诊记录是否已经有病历
|
||||
Emr existingEmr = emrService.getOne(
|
||||
new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId)
|
||||
new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false
|
||||
);
|
||||
|
||||
// 如果没有病历,则需要写病历
|
||||
|
||||
@@ -274,7 +274,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
|
||||
new QueryWrapper<Organization>()
|
||||
.eq("bus_no", performDeptCode)
|
||||
.eq("delete_flag", "0")
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
if (organization != null) {
|
||||
positionId = organization.getId();
|
||||
} else {
|
||||
@@ -410,7 +410,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
|
||||
new QueryWrapper<InspectionLabApply>()
|
||||
.eq("apply_no", applyNo)
|
||||
.eq("delete_flag", DelFlag.NO.getCode())
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
|
||||
if (mainEntity == null) {
|
||||
return null;
|
||||
@@ -532,7 +532,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
|
||||
// 1. 根据申请单号查询检验申请单信息
|
||||
InspectionLabApply inspectionLabApply = inspectionLabApplyService.getOne(
|
||||
new QueryWrapper<InspectionLabApply>().eq("apply_no", applyNo)
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
|
||||
if (inspectionLabApply == null) {
|
||||
log.warn("未找到申请单号为 [{}] 的检验申请单", applyNo);
|
||||
|
||||
@@ -215,7 +215,7 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
// 限定当天日期,避免复诊患者匹配到历史队列记录
|
||||
.eq(TriageQueueItem::getQueueDate, LocalDate.now())
|
||||
.eq(TriageQueueItem::getDeleteFlag, "0")
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
if (queueItem != null) {
|
||||
// 使用 TriageQueueStatus 枚举替代原有硬编码数字 20,保证状态值一致性
|
||||
queueItem.setStatus(TriageQueueStatus.IN_CLINIC.getValue());
|
||||
@@ -282,7 +282,7 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
.eq(TriageQueueItem::getEncounterId, encounterId)
|
||||
.eq(TriageQueueItem::getQueueDate, LocalDate.now())
|
||||
.eq(TriageQueueItem::getDeleteFlag, "0")
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
|
||||
// 当天未找到时回退:不限日期查最近一条(防止跨日就诊队列项遗漏更新)
|
||||
if (queueItem == null) {
|
||||
@@ -292,8 +292,8 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
.eq(TriageQueueItem::getEncounterId, encounterId)
|
||||
.eq(TriageQueueItem::getDeleteFlag, "0")
|
||||
.orderByDesc(TriageQueueItem::getQueueDate)
|
||||
.last("LIMIT 1")
|
||||
);
|
||||
.last("LIMIT 1"));
|
||||
|
||||
if (queueItem != null) {
|
||||
log.warn("完诊:当天队列项未找到,回退使用最近队列记录 queueDate={}, id={}",
|
||||
queueItem.getQueueDate(), queueItem.getId());
|
||||
|
||||
@@ -250,4 +250,9 @@ public class AdviceBaseDto {
|
||||
* 是否缺少取药科室配置(仅药品类型使用)
|
||||
*/
|
||||
private Boolean pharmacyConfigMissing;
|
||||
|
||||
/**
|
||||
* 备注(最长50字)
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.fasterxml.jackson.annotation.Nulls;
|
||||
|
||||
@@ -26,6 +30,14 @@ public class AdviceSaveDto {
|
||||
/** 医嘱类型 */
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱开始时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求id
|
||||
*/
|
||||
@@ -270,6 +282,11 @@ public class AdviceSaveDto {
|
||||
*/
|
||||
private String sourceBillNo;
|
||||
|
||||
/**
|
||||
* 备注(最长50字)
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 设置默认值
|
||||
*/
|
||||
|
||||
@@ -63,6 +63,18 @@ public class PatientDetailsDto {
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/** 地址省 */
|
||||
private String addressProvince;
|
||||
|
||||
/** 地址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 地址区 */
|
||||
private String addressDistrict;
|
||||
|
||||
/** 地址街道 */
|
||||
private String addressStreet;
|
||||
|
||||
/**
|
||||
* 工作单位
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,12 @@ public class RequestBaseDto {
|
||||
*/
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱开始时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
@@ -121,6 +127,11 @@ public class RequestBaseDto {
|
||||
* 请求状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String reasonText;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
@@ -238,4 +249,15 @@ public class RequestBaseDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 停嘱医生
|
||||
*/
|
||||
private String stopUserName;
|
||||
|
||||
/**
|
||||
* 停嘱时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date stopTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -40,6 +41,10 @@ public class SurgeryItemDto {
|
||||
/** 单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 单位编码字典文本(前端用于显示单位) */
|
||||
/** 单位编码字典文本(前端用于显示单位,输出为 unitCode_dictText 以下划线格式匹配前端) */
|
||||
@JsonProperty("unitCode_dictText")
|
||||
private String unitCodeDictText;
|
||||
|
||||
/** 所需标本编码(来自诊疗目录配置,对应字典 specimen_code 的 dictValue) */
|
||||
private String specimenCode;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ import java.util.Map;
|
||||
public interface DoctorStationEmrAppMapper {
|
||||
|
||||
List<Map<String, Object>> getPendingEmrList(@Param("doctorId") Long doctorId,
|
||||
@Param("patientName") String patientName);
|
||||
@Param("patientName") String patientName,
|
||||
@Param("pageSize") Integer pageSize,
|
||||
@Param("offset") Integer offset);
|
||||
|
||||
Long getPendingEmrCount(@Param("doctorId") Long doctorId,
|
||||
@Param("patientName") String patientName);
|
||||
|
||||
@@ -239,8 +239,8 @@ public class AdviceUtils {
|
||||
BigDecimal totalQuantity = matchedInventories.stream()
|
||||
.map(dto -> dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal requestQuantity = medicationRequestUseExe.getExecuteTimesNum()
|
||||
.multiply(medicationRequestUseExe.getMinUnitQuantity());
|
||||
// 只校验单次执行所需数量,不按全部执行次数校验(长期医嘱多次执行由发药流程逐次管控库存)
|
||||
BigDecimal requestQuantity = medicationRequestUseExe.getMinUnitQuantity();
|
||||
if (requestQuantity.compareTo(totalQuantity) > 0) {
|
||||
tipsList
|
||||
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + matchedInventories.get(0).getLocationName() + "库存不足");
|
||||
|
||||
@@ -39,6 +39,16 @@ public class HomeStatisticsDto {
|
||||
* 相对前日变化百分比
|
||||
*/
|
||||
private Double revenueTrend;
|
||||
|
||||
/**
|
||||
* 今日收入金额(数值,单位:元)
|
||||
*/
|
||||
private java.math.BigDecimal todayRevenueAmount;
|
||||
|
||||
/**
|
||||
* 昨日收入金额(数值,单位:元)
|
||||
*/
|
||||
private java.math.BigDecimal yesterdayRevenueAmount;
|
||||
|
||||
/**
|
||||
* 今日预约数量
|
||||
@@ -69,4 +79,19 @@ public class HomeStatisticsDto {
|
||||
* 待写病历数量
|
||||
*/
|
||||
private Integer pendingEmr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日处方数量
|
||||
*/
|
||||
private Integer todayPrescriptions;
|
||||
|
||||
/**
|
||||
* 昨日处方数量
|
||||
*/
|
||||
private Integer yesterdayPrescriptions;
|
||||
|
||||
/**
|
||||
* 处方相对前日变化百分比
|
||||
*/
|
||||
private Double prescriptionTrend;
|
||||
}
|
||||
@@ -628,8 +628,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 查询患者待取的药品
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUBMITTED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationDispenseList.isEmpty()) {
|
||||
return R.fail("患者有待取的药品,请先取药");
|
||||
@@ -696,8 +696,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
// 查询患者待取的药品
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
|
||||
.in(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue(),
|
||||
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUBMITTED.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
if (!medicationDispenseList.isEmpty()) {
|
||||
return R.fail("患者有待取的药品,请先取药");
|
||||
@@ -762,8 +762,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
|
||||
@Override
|
||||
public R<?> getPendingMedication(Long encounterId) {
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
|
||||
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.EXECUTED.getValue(),
|
||||
DispenseStatus.SUBMITTED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,6 +58,7 @@ import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.*;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -185,12 +186,13 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
QueryWrapper<InpatientAdviceParam> queryWrapper
|
||||
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||
|
||||
// 手动拼接requestStatus条件:COMPLETED(3)时同时包含CHECK_VERIFIED(10)
|
||||
// 手动拼接requestStatus条件:COMPLETED(3)时同时包含CHECK_VERIFIED(10)和PENDING_RECEIVE(11)
|
||||
// UNION查询外层列名为request_status(T1.status_enum AS request_status),不是status_enum
|
||||
if (requestStatus != null) {
|
||||
if (RequestStatus.COMPLETED.getValue().equals(requestStatus)) {
|
||||
queryWrapper.in("request_status",
|
||||
RequestStatus.COMPLETED.getValue(), RequestStatus.CHECK_VERIFIED.getValue());
|
||||
RequestStatus.COMPLETED.getValue(), RequestStatus.CHECK_VERIFIED.getValue(),
|
||||
RequestStatus.PENDING_RECEIVE.getValue());
|
||||
} else {
|
||||
queryWrapper.eq("request_status", requestStatus);
|
||||
}
|
||||
@@ -413,15 +415,21 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
}
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
Date checkDate = new Date();
|
||||
// 从请求中提取退回原因(所有项目共享同一原因)
|
||||
String backReason = performInfoList.stream()
|
||||
.map(PerformInfoDto::getBackReason)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
// 更新服务请求状态待发送
|
||||
serviceRequestService.updateDraftStatus(
|
||||
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason);
|
||||
}
|
||||
if (!medRequestList.isEmpty()) {
|
||||
// 更新药品请求状态待发送
|
||||
medicationRequestService.updateDraftStatusBatch(
|
||||
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason);
|
||||
}
|
||||
return R.ok(null, "退回成功");
|
||||
}
|
||||
@@ -474,6 +482,13 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
if (!checkReqIds.isEmpty()) {
|
||||
serviceRequestService.updatePendingReceiveStatus(checkReqIds);
|
||||
}
|
||||
// 手术类医嘱执行后,状态改为"已执行"(SurgeryAppStatusEnum.EXECUTED=4)
|
||||
List<Long> surgeryReqIds = executedReqs.stream()
|
||||
.filter(sr -> ActivityDefCategory.PROCEDURE.getValue().equals(sr.getCategoryEnum()))
|
||||
.map(ServiceRequest::getId).toList();
|
||||
if (!surgeryReqIds.isEmpty()) {
|
||||
serviceRequestService.updateSurgeryAppStatus(surgeryReqIds, SurgeryAppStatusEnum.EXECUTED.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱执行"}));
|
||||
@@ -530,8 +545,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
for (MedicationDispense medicationDispense : longMedDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
longMedDispensedList.add(medicationDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getStatusEnum())
|
||||
|| DispenseStatus.SUMMARIZED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
} else if (DispenseStatus.EXECUTED.getValue().equals(medicationDispense.getStatusEnum())
|
||||
|| DispenseStatus.SUBMITTED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
longMedUndispenseList.add(medicationDispense);
|
||||
}
|
||||
}
|
||||
@@ -558,8 +573,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
for (MedicationDispense medicationDispense : tempMedDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
tempMedDispensedList.add(medicationDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getStatusEnum())
|
||||
|| DispenseStatus.SUMMARIZED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
} else if (DispenseStatus.EXECUTED.getValue().equals(medicationDispense.getStatusEnum())
|
||||
|| DispenseStatus.SUBMITTED.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||
tempMedUndispenseList.add(medicationDispense);
|
||||
}
|
||||
}
|
||||
@@ -574,7 +589,10 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
// 处理长期已发放的药品
|
||||
if (!longMedDispensedList.isEmpty()) {
|
||||
// 生成退药单
|
||||
this.creatRefundMedicationList(tempMedDispensedList, procedureIdMap);
|
||||
this.creatRefundMedicationList(longMedDispensedList, procedureIdMap);
|
||||
// 药品退药请求状态变更(待退药)
|
||||
medicationRequestService.updateCancelledStatusBatch(
|
||||
longMedDispensedList.stream().map(MedicationDispense::getMedReqId).toList(), null, null);
|
||||
}
|
||||
// 处理临时已发放药品
|
||||
if (!tempMedDispensedList.isEmpty()) {
|
||||
@@ -715,6 +733,24 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
deviceDispenseService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getId).toList());
|
||||
deviceRequestService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getDeviceReqId).toList());
|
||||
}
|
||||
// 手术类医嘱取消执行后,状态回退为"已校对"(SurgeryAppStatusEnum.VERIFIED=3)
|
||||
List<Long> surgeryCancelReqIds = adviceExecuteParam.getAdviceExecuteDetailList().stream()
|
||||
.filter(e -> CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(e.getAdviceTable()))
|
||||
.map(AdviceExecuteDetailParam::getRequestId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.toList();
|
||||
if (!surgeryCancelReqIds.isEmpty()) {
|
||||
List<ServiceRequest> surgeryRequests = serviceRequestService.list(
|
||||
new LambdaQueryWrapper<ServiceRequest>()
|
||||
.in(ServiceRequest::getId, surgeryCancelReqIds)
|
||||
.eq(ServiceRequest::getCategoryEnum, ActivityDefCategory.PROCEDURE.getValue()));
|
||||
if (!surgeryRequests.isEmpty()) {
|
||||
serviceRequestService.updateSurgeryAppStatus(
|
||||
surgeryRequests.stream().map(ServiceRequest::getId).toList(),
|
||||
SurgeryAppStatusEnum.VERIFIED.getCode());
|
||||
}
|
||||
}
|
||||
return R.ok("取消执行成功,相关汇总领药单已重新生成");
|
||||
}
|
||||
|
||||
@@ -1027,7 +1063,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
.eq(MedicationDispense::getMedReqId, tempMedicationRequest.getId())
|
||||
.set(MedicationDispense::getProcedureId, procedureId)
|
||||
.set(MedicationDispense::getPlannedDispenseTime, expectedDate)
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue()));
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue()));
|
||||
|
||||
// 更新账单状态
|
||||
chargeItemService.update(
|
||||
|
||||
@@ -119,7 +119,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(),
|
||||
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue());
|
||||
DispenseStatus.SUBMITTED.getValue());
|
||||
medicineDispenseFormPage.getRecords().forEach(e -> {
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
@@ -156,8 +156,8 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
|
||||
// 汇总单分页列表
|
||||
Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(),
|
||||
SupplyType.SUMMARY_DISPENSE.getValue());
|
||||
medicineSummaryFormPage.getRecords().forEach(e -> {
|
||||
// 发药状态(汇总单展示文案)
|
||||
e.setStatusEnum_enumText(getSummaryFormStatusText(e.getStatusEnum()));
|
||||
@@ -203,7 +203,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
throw new ServiceException("未找到药品发放信息");
|
||||
}
|
||||
if (medicationDispenseList.stream().map(MedicationDispense::getStatusEnum)
|
||||
.anyMatch(x -> x.equals(DispenseStatus.SUMMARIZED.getValue()))) {
|
||||
.anyMatch(x -> x.equals(DispenseStatus.SUBMITTED.getValue()))) {
|
||||
throw new ServiceException("药品已汇总,请勿重复汇总");
|
||||
}
|
||||
// 查询药品信息
|
||||
@@ -295,7 +295,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
* 汇总发药单状态展示文案(药品医嘱状态映射表:汇总申请→已提交,发药→已发药)
|
||||
*/
|
||||
private String getSummaryFormStatusText(Integer statusEnum) {
|
||||
if (DispenseStatus.PREPARATION.getValue().equals(statusEnum)) {
|
||||
if (DispenseStatus.EXECUTED.getValue().equals(statusEnum)) {
|
||||
return "已提交";
|
||||
}
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(statusEnum)) {
|
||||
|
||||
@@ -46,14 +46,13 @@ public interface MedicineSummaryAppMapper {
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param completed 发药状态:已完成
|
||||
* @param preparation 发药状态:待配药
|
||||
* @param summaryDispense 单据类型:汇总发药
|
||||
* @return 汇总单列表
|
||||
*/
|
||||
Page<MedicineSummaryFormDto> selectMedicineSummaryFormPage(@Param("page") Page<MedicineSummaryFormDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
|
||||
@Param("preparation") Integer preparation,
|
||||
@Param("summaryDispense") Integer summaryDispense);
|
||||
|
||||
/**
|
||||
|
||||
@@ -256,7 +256,7 @@ public class OutpatientInfusionAppServiceImpl implements IOutpatientInfusionAppS
|
||||
}
|
||||
boolean result = serviceRequestService.updateCancelledStatus(serviceReqId, now, practitionerId, orgId);
|
||||
// 更新主服务请求状态为待执行
|
||||
serviceRequestService.updateDraftStatus(List.of(serviceRequest.getBasedOnId()), null, null);
|
||||
serviceRequestService.updateDraftStatus(List.of(serviceRequest.getBasedOnId()), null, null, null);
|
||||
if (result) {
|
||||
// 判断是否全部取消执行
|
||||
boolean exists = serviceRequestMapper.exists(new LambdaQueryWrapper<ServiceRequest>()
|
||||
|
||||
@@ -86,7 +86,12 @@ public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
|
||||
|
||||
// 处理就诊对象状态筛选
|
||||
if (outpatientRecordSearchParam.getSubjectStatusEnum() != null) {
|
||||
queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum());
|
||||
if (outpatientRecordSearchParam.getSubjectStatusEnum() == 0) {
|
||||
// 前端选择"无状态"(0)时,过滤 status_enum IS NULL 的记录
|
||||
queryWrapper.isNull("enc.status_enum");
|
||||
} else {
|
||||
queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum());
|
||||
}
|
||||
}
|
||||
|
||||
// 处理医生姓名查询(支持模糊查询)
|
||||
|
||||
@@ -52,7 +52,8 @@ public class PendingMedicationDetailsAppServiceImpl implements IPendingMedicatio
|
||||
Page<PendingMedicationPageDto> pendingMedicationPage = pendingMedicationDetailsMapper
|
||||
.selectPendingMedicationDetailsPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.PREPARATION.getValue(),
|
||||
DispenseStatus.PREPARED.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue());
|
||||
DispenseStatus.PREPARED.getValue(), DispenseStatus.SUMMARIZED.getValue(),
|
||||
EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue());
|
||||
|
||||
pendingMedicationPage.getRecords().forEach(e -> {
|
||||
// 发药类型
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.openhis.web.pharmacymanage.appservice.impl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
@@ -191,7 +192,8 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
Page<EncounterInfoDto> encounterInfoPage
|
||||
= westernMedicineDispenseMapper.selectEncounterInfoListPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
statusEnum, DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue());
|
||||
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getValue(), DispenseStatus.SUBMITTED.getValue());
|
||||
encounterInfoPage.getRecords().forEach(encounterInfo -> {
|
||||
// 性别
|
||||
encounterInfo.setGenderEnum_enumText(
|
||||
@@ -229,7 +231,8 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
= westernMedicineDispenseMapper.selectMedicineDispenseOrderPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue(), dispenseStatus,
|
||||
PublicationStatus.ACTIVE.getValue());
|
||||
PublicationStatus.ACTIVE.getValue(), DispenseStatus.SUMMARIZED.getValue(),
|
||||
DispenseStatus.SUBMITTED.getValue());
|
||||
medicineDispenseOrderPage.getRecords().forEach(medicineDispenseOrder -> {
|
||||
// 发药状态
|
||||
medicineDispenseOrder.setStatusEnum_enumText(
|
||||
@@ -253,6 +256,9 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicinePrepare(List<DispenseItemDto> dispenseMedicineList) {
|
||||
if (dispenseMedicineList == null || dispenseMedicineList.isEmpty()) {
|
||||
throw new ServiceException("配药信息不能为空");
|
||||
}
|
||||
// 追溯码集合
|
||||
List<String> traceNoList
|
||||
= dispenseMedicineList.stream().map(DispenseItemDto::getTraceNo).collect(Collectors.toList());
|
||||
@@ -354,7 +360,7 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
}
|
||||
// 发药单状态校验
|
||||
if (unDispenseInventoryList.stream().map(UnDispenseInventoryDto::getDispenseStatus)
|
||||
.anyMatch(x -> !x.equals(DispenseStatus.PREPARED.getValue()))) {
|
||||
.anyMatch(x -> !x.equals(DispenseStatus.SUBMITTED.getValue()))) {
|
||||
throw new ServiceException("发药失败,请检查发药单状态");
|
||||
}
|
||||
|
||||
@@ -470,6 +476,11 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
}
|
||||
// 药品发放更新
|
||||
medicationDispenseService.updateBatchById(dispenseUpdateList);
|
||||
// 更新医嘱状态为已完成
|
||||
List<Long> medReqIdList = unDispenseInventoryList.stream()
|
||||
.map(UnDispenseInventoryDto::getRequestId).distinct().collect(Collectors.toList());
|
||||
medicationRequestService.update(new MedicationRequest().setStatusEnum(RequestStatus.DISPENSE_COMPLETED.getValue()),
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, medReqIdList));
|
||||
// 库存更新
|
||||
inventoryItemService.updateBatchById(inventoryItemList);
|
||||
// 追溯码管理表数据追加
|
||||
|
||||
@@ -22,6 +22,7 @@ public interface PendingMedicationDetailsMapper {
|
||||
* @param inProgress 发药类型:待发药
|
||||
* @param preparation 发药类型:待配药
|
||||
* @param prepared 发药类型:已配药
|
||||
* @param summarized 发药类型:已汇总
|
||||
* @param amb 门诊类型
|
||||
* @param imp 住院类型
|
||||
* @return 待发药明细
|
||||
@@ -32,6 +33,7 @@ public interface PendingMedicationDetailsMapper {
|
||||
@Param("inProgress") Integer inProgress,
|
||||
@Param("preparation") Integer preparation,
|
||||
@Param("prepared") Integer prepared,
|
||||
@Param("summarized") Integer summarized,
|
||||
@Param("amb") Integer amb,
|
||||
@Param("imp") Integer imp);
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ public interface WesternMedicineDispenseMapper {
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterInfoSearchParam> queryWrapper,
|
||||
@Param("statusEnum") Integer statusEnum, @Param("inProgress") Integer inProgress,
|
||||
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
|
||||
@Param("prepared") Integer prepared);
|
||||
@Param("prepared") Integer prepared, @Param("summarized") Integer summarized,
|
||||
@Param("submitted") Integer submitted);
|
||||
|
||||
/**
|
||||
* 发药单查询
|
||||
@@ -54,7 +55,8 @@ public interface WesternMedicineDispenseMapper {
|
||||
@Param(Constants.WRAPPER) QueryWrapper<ItemDispenseOrderDto> queryWrapper,
|
||||
@Param("inProgress") Integer inProgress, @Param("completed") Integer completed,
|
||||
@Param("preparation") Integer preparation, @Param("prepared") Integer prepared,
|
||||
@Param("dispenseStatus") Integer dispenseStatus, @Param("active") Integer active);
|
||||
@Param("dispenseStatus") Integer dispenseStatus, @Param("active") Integer active,
|
||||
@Param("summarized") Integer summarized, @Param("submitted") Integer submitted);
|
||||
|
||||
/**
|
||||
* 获取配药人下拉选列表
|
||||
|
||||
@@ -69,4 +69,12 @@ public interface IAdviceManageAppService {
|
||||
*/
|
||||
R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList);
|
||||
|
||||
/**
|
||||
* 住院医嘱取消停嘱(恢复)
|
||||
*
|
||||
* @param paramList 恢复参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> cancelStopRegAdvice(List<AdviceBatchOpParam> paramList);
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
@@ -30,6 +31,9 @@ import com.openhis.web.regdoctorstation.dto.*;
|
||||
import com.openhis.web.regdoctorstation.mapper.AdviceManageAppMapper;
|
||||
import com.openhis.web.regdoctorstation.utils.RegPrescriptionUtils;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
@@ -188,9 +192,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 药品
|
||||
List<RegAdviceSaveDto> medicineList = regAdviceSaveList.stream()
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 诊疗活动(包含护理adviceType=26)
|
||||
// 诊疗活动(包含护理adviceType=26、手术adviceType=6)
|
||||
List<RegAdviceSaveDto> activityList = regAdviceSaveList.stream()
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|
||||
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|
||||
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
|
||||
.collect(Collectors.toList());
|
||||
// 耗材 🔧 Bug #147 修复
|
||||
@@ -351,6 +356,27 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
/**
|
||||
* 处理药品
|
||||
*/
|
||||
|
||||
/**
|
||||
* 将 remark 合并到 contentJson 中,确保 Mapper 能从 content_json 提取 remark
|
||||
*/
|
||||
private String injectRemarkIntoContentJson(String contentJson, String remark) {
|
||||
if (remark == null || remark.isEmpty() || contentJson == null || contentJson.isEmpty()) {
|
||||
return contentJson;
|
||||
}
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode node = mapper.readTree(contentJson);
|
||||
if (node instanceof ObjectNode) {
|
||||
((ObjectNode) node).put("remark", remark);
|
||||
return mapper.writeValueAsString(node);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to inject remark into contentJson: {}", e.getMessage());
|
||||
}
|
||||
return contentJson;
|
||||
}
|
||||
|
||||
private List<String> handMedication(List<RegAdviceSaveDto> medicineList, Date startTime, Date authoredTime,
|
||||
Date curDate, String adviceOpType, Long organizationId, String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
@@ -415,7 +441,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
longMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||
longMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
longMedicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
longMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
@@ -449,6 +475,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
if (longMedicationRequest.getId() == null) {
|
||||
firstTimeSave = true;
|
||||
}
|
||||
// 确保 contentJson 包含 remark
|
||||
if (regAdviceSaveDto.getRemark() != null && !regAdviceSaveDto.getRemark().isEmpty()) {
|
||||
longMedicationRequest.setContentJson(injectRemarkIntoContentJson(longMedicationRequest.getContentJson(), regAdviceSaveDto.getRemark()));
|
||||
}
|
||||
iMedicationRequestService.saveOrUpdate(longMedicationRequest);
|
||||
if (firstTimeSave) {
|
||||
medRequestIdList.add(longMedicationRequest.getId().toString());
|
||||
@@ -503,7 +533,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
tempMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||
tempMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
tempMedicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
tempMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
@@ -536,6 +566,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
if (tempMedicationRequest.getId() == null) {
|
||||
firstTimeSave = true;
|
||||
}
|
||||
// 确保 contentJson 包含 remark
|
||||
if (regAdviceSaveDto.getRemark() != null && !regAdviceSaveDto.getRemark().isEmpty()) {
|
||||
tempMedicationRequest.setContentJson(injectRemarkIntoContentJson(tempMedicationRequest.getContentJson(), regAdviceSaveDto.getRemark()));
|
||||
}
|
||||
iMedicationRequestService.saveOrUpdate(tempMedicationRequest);
|
||||
if (firstTimeSave) {
|
||||
medRequestIdList.add(tempMedicationRequest.getId().toString());
|
||||
@@ -615,7 +649,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||
longServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
longServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||
longServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
longServiceRequest.setQuantity(new BigDecimal("1")); // 请求数量 | 诊疗的长期医嘱数量都是1
|
||||
@@ -627,7 +661,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
longServiceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||
longServiceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
longServiceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
longServiceRequest.setOrgId(regAdviceSaveDto.getPositionId()); // 执行科室
|
||||
longServiceRequest.setOrgId(regAdviceSaveDto.getEffectiveOrgId()); // 执行科室
|
||||
longServiceRequest.setContentJson(regAdviceSaveDto.getContentJson()); // 请求内容json
|
||||
longServiceRequest.setYbClassEnum(regAdviceSaveDto.getYbClassEnum());// 类别医保编码
|
||||
longServiceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id
|
||||
@@ -639,6 +673,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
longServiceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
||||
}
|
||||
}
|
||||
longServiceRequest.setRemark(regAdviceSaveDto.getRemark());
|
||||
iServiceRequestService.saveOrUpdate(longServiceRequest);
|
||||
if (longServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(longServiceRequest.getId());
|
||||
@@ -666,7 +701,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
tempServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||
tempServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
tempServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||
tempServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
tempServiceRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量
|
||||
@@ -678,7 +713,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
tempServiceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
tempServiceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
tempServiceRequest.setAuthoredTime(curDate); // 请求签发时间
|
||||
tempServiceRequest.setOrgId(regAdviceSaveDto.getPositionId()); // 执行科室
|
||||
tempServiceRequest.setOrgId(regAdviceSaveDto.getEffectiveOrgId()); // 执行科室
|
||||
tempServiceRequest.setContentJson(regAdviceSaveDto.getContentJson()); // 请求内容json
|
||||
tempServiceRequest.setYbClassEnum(regAdviceSaveDto.getYbClassEnum());// 类别医保编码
|
||||
tempServiceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id
|
||||
@@ -690,6 +725,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
tempServiceRequest.setBasedOnTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);
|
||||
}
|
||||
}
|
||||
tempServiceRequest.setRemark(regAdviceSaveDto.getRemark());
|
||||
iServiceRequestService.saveOrUpdate(tempServiceRequest);
|
||||
if (tempServiceRequest.getId() != null) {
|
||||
processedRequestIds.add(tempServiceRequest.getId());
|
||||
@@ -812,7 +848,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||
@@ -821,6 +857,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id
|
||||
deviceRequest.setEncounterDiagnosisId(regAdviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
}
|
||||
// 确保 contentJson 包含 remark
|
||||
if (regAdviceSaveDto.getRemark() != null && !regAdviceSaveDto.getRemark().isEmpty()) {
|
||||
deviceRequest.setContentJson(injectRemarkIntoContentJson(deviceRequest.getContentJson(), regAdviceSaveDto.getRemark()));
|
||||
}
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
}
|
||||
|
||||
@@ -851,7 +891,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||
@@ -860,6 +900,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id
|
||||
deviceRequest.setEncounterDiagnosisId(regAdviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
}
|
||||
// 确保 contentJson 包含 remark
|
||||
if (regAdviceSaveDto.getRemark() != null && !regAdviceSaveDto.getRemark().isEmpty()) {
|
||||
deviceRequest.setContentJson(injectRemarkIntoContentJson(deviceRequest.getContentJson(), regAdviceSaveDto.getRemark()));
|
||||
}
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
|
||||
// 保存时,保存耗材费用项
|
||||
@@ -1016,7 +1060,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
if (!medicineRequestIds.isEmpty()) {
|
||||
// 根据请求id更新请求状态
|
||||
iMedicationRequestService.updateDraftStatusBatch(medicineRequestIds, null, null);
|
||||
iMedicationRequestService.updateDraftStatusBatch(medicineRequestIds, null, null, null);
|
||||
}
|
||||
if (!activityRequestIds.isEmpty()) {
|
||||
// 根据请求id更新请求状态
|
||||
@@ -1043,8 +1087,14 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList) {
|
||||
// 当前时间
|
||||
Date date = new Date();
|
||||
// 获取停嘱时间:优先从前端传入的 stopTime,否则用当前时间
|
||||
Date stopTime = paramList.stream()
|
||||
.map(AdviceBatchOpParam::getStopTime)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst()
|
||||
.orElse(new Date());
|
||||
// 获取当前操作用户昵称作为停嘱医生
|
||||
String stopUserName = SecurityUtils.getNickName();
|
||||
// 药品
|
||||
List<AdviceBatchOpParam> medicineList = paramList.stream()
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
@@ -1059,15 +1109,112 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
= activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
if (!medicineRequestIds.isEmpty()) {
|
||||
iMedicationRequestService.update(new LambdaUpdateWrapper<MedicationRequest>()
|
||||
.in(MedicationRequest::getId, medicineRequestIds).set(MedicationRequest::getEffectiveDoseEnd, date)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue()));
|
||||
.in(MedicationRequest::getId, medicineRequestIds)
|
||||
.set(MedicationRequest::getEffectiveDoseEnd, stopTime)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.set(MedicationRequest::getUpdateBy, stopUserName));
|
||||
}
|
||||
if (!activityRequestIds.isEmpty()) {
|
||||
iServiceRequestService.update(new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.in(ServiceRequest::getId, activityRequestIds).set(ServiceRequest::getOccurrenceEndTime, date)
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()));
|
||||
.in(ServiceRequest::getId, activityRequestIds)
|
||||
.set(ServiceRequest::getOccurrenceEndTime, stopTime)
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
||||
.set(ServiceRequest::getUpdateBy, stopUserName));
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱停止"}));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院医嘱取消停嘱(恢复)
|
||||
*
|
||||
* 核心业务逻辑:
|
||||
* 1. 护士站校验:护士站尚未对该医嘱的停止进行"停止核对/确认"(即 dispense 状态未进入已发药/完成状态)
|
||||
* 2. 药房端校验:药房尚未对该停嘱单进行退药接收/退费入库确认
|
||||
* 3. 若校验通过,将医嘱状态复原为"已签发";清空停嘱时间与停嘱医生字段;
|
||||
* 同时自动作废已生成的待发药退回/退药申请
|
||||
*
|
||||
* @param paramList 恢复参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> cancelStopRegAdvice(List<AdviceBatchOpParam> paramList) {
|
||||
// 药品
|
||||
List<AdviceBatchOpParam> medicineList = paramList.stream()
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
List<Long> medicineRequestIds
|
||||
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
// 诊疗(包含护理adviceType=26)
|
||||
List<AdviceBatchOpParam> activityList = paramList.stream()
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|
||||
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
|
||||
.collect(Collectors.toList());
|
||||
List<Long> activityRequestIds
|
||||
= activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
|
||||
// ============ 前置校验 ============
|
||||
// 1. 护士站校验:查询药品发放记录,确认护士站是否已执行停止核对(发药)
|
||||
if (!medicineRequestIds.isEmpty()) {
|
||||
List<MedicationDispense> dispenseList = iMedicationDispenseService.selectByRequestIdList(medicineRequestIds);
|
||||
for (MedicationDispense dispense : dispenseList) {
|
||||
// 如果发放状态 >= COMPLETED(4),说明护士站已发药/已确认停止
|
||||
if (dispense.getStatusEnum() != null && dispense.getStatusEnum() >= DispenseStatus.COMPLETED.getValue()
|
||||
&& !DispenseStatus.ON_HOLD.getValue().equals(dispense.getStatusEnum())
|
||||
&& !DispenseStatus.STOPPED.getValue().equals(dispense.getStatusEnum())
|
||||
&& !DispenseStatus.CANCELLED.getValue().equals(dispense.getStatusEnum())) {
|
||||
throw new ServiceException("护士站已确认停止该医嘱,无法取消停嘱!");
|
||||
}
|
||||
// 2. 药房端校验:如果已有退药/退费记录,说明药房已处理
|
||||
if (DispenseStatus.RETURNED.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.REFUNDED.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.PART_REFUND.getValue().equals(dispense.getStatusEnum())) {
|
||||
throw new ServiceException("药房已完成退药处理,无法取消停嘱!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============ 执行恢复 ============
|
||||
if (!medicineRequestIds.isEmpty()) {
|
||||
// 恢复药品请求状态为"已发送"(ACTIVE=2),清空停嘱时间和更新人
|
||||
iMedicationRequestService.update(new LambdaUpdateWrapper<MedicationRequest>()
|
||||
.in(MedicationRequest::getId, medicineRequestIds)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(MedicationRequest::getEffectiveDoseEnd, null)
|
||||
.set(MedicationRequest::getUpdateBy, null));
|
||||
|
||||
// 作废/删除与这些药品请求相关的待退药发放记录
|
||||
List<MedicationDispense> relatedDispenseList = iMedicationDispenseService.selectByRequestIdList(medicineRequestIds);
|
||||
for (MedicationDispense dispense : relatedDispenseList) {
|
||||
if (DispenseStatus.PENDING_REFUND.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.CANCELLED.getValue().equals(dispense.getStatusEnum())
|
||||
|| DispenseStatus.ON_HOLD.getValue().equals(dispense.getStatusEnum())) {
|
||||
// 将待退药/暂停/撤回的记录标记为草稿,或删除
|
||||
iMedicationDispenseService.update(new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getId, dispense.getId())
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.DRAFT.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, new Date()));
|
||||
}
|
||||
// 如果 dispense 已处于 STOPPED(6) 状态,也恢复为草稿以重新触发配药流程
|
||||
if (DispenseStatus.STOPPED.getValue().equals(dispense.getStatusEnum())) {
|
||||
iMedicationDispenseService.update(new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getId, dispense.getId())
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, new Date()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!activityRequestIds.isEmpty()) {
|
||||
// 恢复诊疗请求状态为"已发送"(ACTIVE=2),清空停嘱时间和更新人
|
||||
iServiceRequestService.update(new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.in(ServiceRequest::getId, activityRequestIds)
|
||||
.set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||
.set(ServiceRequest::getOccurrenceEndTime, null)
|
||||
.set(ServiceRequest::getUpdateBy, null));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱恢复"}));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -155,10 +155,18 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
||||
}
|
||||
} else {
|
||||
// 检查申请单号:JC(检查)+ Z(住院标识)+ yyMMdd(日期)+ 5位顺序号
|
||||
// 根据申请单类型生成不同前缀的单号
|
||||
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
|
||||
int seq = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.CHECK_APPLY_NO.getPrefix());
|
||||
prescriptionNo = "JCZ" + dateStr + String.format("%05d", seq);
|
||||
AssignSeqEnum seqEnum;
|
||||
if (ActivityDefCategory.PROCEDURE.getCode().equals(typeCode)) {
|
||||
seqEnum = AssignSeqEnum.SURGERY_APPLY_NO;
|
||||
} else if (ActivityDefCategory.PROOF.getCode().equals(typeCode)) {
|
||||
seqEnum = AssignSeqEnum.LAB_APPLY_NO;
|
||||
} else {
|
||||
seqEnum = AssignSeqEnum.CHECK_APPLY_NO;
|
||||
}
|
||||
int seq = assignSeqUtil.getSeqNoByDay(seqEnum.getPrefix());
|
||||
prescriptionNo = seqEnum.getPrefix() + dateStr + String.format("%05d", seq);
|
||||
}
|
||||
|
||||
// 当前时间
|
||||
@@ -334,7 +342,25 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
surgeryServiceRequest.setPrescriptionNo(prescriptionNo);
|
||||
surgeryServiceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());
|
||||
surgeryServiceRequest.setQuantity(BigDecimal.valueOf(1));
|
||||
surgeryServiceRequest.setUnitCode("次");
|
||||
// 从诊疗目录获取使用单位,避免硬编码
|
||||
String unitCode = "次"; // 默认值
|
||||
if (activityList != null && !activityList.isEmpty()) {
|
||||
String dtoUnitCode = activityList.get(0).getUnitCode();
|
||||
if (dtoUnitCode != null && !dtoUnitCode.isEmpty()) {
|
||||
unitCode = dtoUnitCode;
|
||||
} else {
|
||||
// 从 ActivityDefinition 查询使用单位
|
||||
Long activityId = activityList.get(0).getAdviceDefinitionId();
|
||||
if (activityId != null) {
|
||||
ActivityDefinition activityDef = iActivityDefinitionService.getById(activityId);
|
||||
if (activityDef != null && activityDef.getPermittedUnitCode() != null
|
||||
&& !activityDef.getPermittedUnitCode().isEmpty()) {
|
||||
unitCode = activityDef.getPermittedUnitCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
surgeryServiceRequest.setUnitCode(unitCode);
|
||||
surgeryServiceRequest.setCategoryEnum(24); // 24-手术(新值域,避开 adviceType 碰撞)
|
||||
// 优先从 activityList 获取手术 ID
|
||||
if (activityList != null && !activityList.isEmpty()) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -161,7 +162,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
||||
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
||||
// 对应的诊疗医嘱信息
|
||||
activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, null,
|
||||
null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null).getRecords().get(0);
|
||||
null, null, 1, 1, null, List.of(3), null, null).getRecords().get(0);
|
||||
// 逻辑1---------------------直接新增
|
||||
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||
@@ -208,7 +209,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
||||
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
||||
// 对应的诊疗医嘱信息
|
||||
activityAdviceBaseDto = iDoctorStationAdviceAppService
|
||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null)
|
||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null)
|
||||
.getRecords().get(0);
|
||||
|
||||
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||
@@ -348,7 +349,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
||||
adviceBaseDto.setAdviceDefinitionId(transferOrganizationDefinitionId); // 医嘱定义id
|
||||
// 转科的医嘱信息
|
||||
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService
|
||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null)
|
||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null)
|
||||
.getRecords().get(0);
|
||||
// 保存转科医嘱请求
|
||||
ServiceRequest serviceRequest = new ServiceRequest();
|
||||
@@ -400,7 +401,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
||||
// 计划出院时间
|
||||
Date endTime = leaveHospitalParam.getEndTime();
|
||||
if (endTime == null) {
|
||||
endTime = endTime;
|
||||
endTime = new Date();
|
||||
}
|
||||
// 就诊id
|
||||
Long encounterId = leaveHospitalParam.getEncounterId();
|
||||
@@ -429,9 +430,12 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
||||
}
|
||||
|
||||
// 出院的医嘱信息
|
||||
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
||||
List.of(transferOrganizationDefinitionId), null, 1, 1, Whether.NO.getValue(), List.of(3), null, null).getRecords()
|
||||
.get(0);
|
||||
List<AdviceBaseDto> adviceList = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
||||
List.of(transferOrganizationDefinitionId), null, 1, 1, null, List.of(3), null, null).getRecords();
|
||||
if (CollectionUtils.isEmpty(adviceList)) {
|
||||
return R.fail("未找到出院医嘱定义数据,请确认诊疗目录中已配置出院医嘱");
|
||||
}
|
||||
AdviceBaseDto activityAdviceBaseDto = adviceList.get(0);
|
||||
// 保存出院医嘱请求
|
||||
ServiceRequest serviceRequest = new ServiceRequest();
|
||||
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||
|
||||
@@ -143,4 +143,15 @@ public class AdviceManageController {
|
||||
return iAdviceManageAppService.stopRegAdvice(paramList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院医嘱取消停嘱(恢复)
|
||||
*
|
||||
* @param paramList 恢复参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/cancel-stop-reg-advice")
|
||||
public R<?> cancelStopRegAdvice(@RequestBody List<AdviceBatchOpParam> paramList) {
|
||||
return iAdviceManageAppService.cancelStopRegAdvice(paramList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,14 +143,23 @@ public class RequestFormManageController {
|
||||
* 查询手术申请单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/手术项目名称模糊匹配)
|
||||
* @return 手术申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-surgery")
|
||||
public R<?> getSurgeryRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
public R<?> getSurgeryRequestForm(
|
||||
@RequestParam(required = false) Long encounterId,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode(), startDate, endDate, status, keyword));
|
||||
}
|
||||
/**
|
||||
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.openhis.web.regdoctorstation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 医嘱批量操作参数类
|
||||
*/
|
||||
@@ -21,4 +24,10 @@ public class AdviceBatchOpParam {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/**
|
||||
* 停嘱时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date stopTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,8 +10,4 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RegAdviceSaveDto extends AdviceSaveDto {
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
}
|
||||
|
||||
@@ -50,4 +50,9 @@ public class RegRequestBaseDto extends RequestBaseDto {
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
|
||||
/**
|
||||
* 备注(最长50字)
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,16 @@ import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.enums.ParticipantType;
|
||||
import com.openhis.web.dto.HomeStatisticsDto;
|
||||
import com.openhis.financial.domain.PaymentReconciliation;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.web.service.IHomeStatisticsService;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,6 +55,12 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
|
||||
@Autowired
|
||||
private IPatientService patientService;
|
||||
|
||||
@Autowired
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
|
||||
@Autowired
|
||||
private IMedicationRequestService medicationRequestService;
|
||||
|
||||
/**
|
||||
* 获取首页统计数据
|
||||
*
|
||||
@@ -105,18 +120,108 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
|
||||
double patientTrend = calculateTrend(totalPatients, yesterdayPatients);
|
||||
statistics.setPatientTrend(patientTrend);
|
||||
|
||||
// 今日收入和预约等其他统计(暂时设为0,后续从相应表查询)
|
||||
statistics.setTodayRevenue("¥ 0");
|
||||
statistics.setYesterdayRevenue("¥ 0");
|
||||
statistics.setRevenueTrend(0.0);
|
||||
// 查询今日收入
|
||||
BigDecimal todayRevenue = queryRevenueByDate(new Date());
|
||||
BigDecimal yesterdayRevenue = queryRevenueByDate(getYesterday());
|
||||
java.text.DecimalFormat df = new java.text.DecimalFormat("#,##0.00");
|
||||
statistics.setTodayRevenue("¥ " + df.format(todayRevenue));
|
||||
statistics.setYesterdayRevenue("¥ " + df.format(yesterdayRevenue));
|
||||
statistics.setTodayRevenueAmount(todayRevenue);
|
||||
statistics.setYesterdayRevenueAmount(yesterdayRevenue);
|
||||
statistics.setRevenueTrend(calculateTrend(todayRevenue.doubleValue(), yesterdayRevenue.doubleValue()));
|
||||
|
||||
// 今日预约和待审核(暂时设为0,后续实现)
|
||||
statistics.setTodayAppointments(0);
|
||||
statistics.setYesterdayAppointments(0);
|
||||
statistics.setAppointmentTrend(0.0);
|
||||
statistics.setPendingApprovals(0);
|
||||
|
||||
|
||||
// 查询今日处方数量
|
||||
int todayPrescriptions = queryPrescriptionCountByDate(new Date(), practitioner);
|
||||
int yesterdayPrescriptions = queryPrescriptionCountByDate(getYesterday(), practitioner);
|
||||
statistics.setTodayPrescriptions(todayPrescriptions);
|
||||
statistics.setYesterdayPrescriptions(yesterdayPrescriptions);
|
||||
statistics.setPrescriptionTrend(calculateTrend(todayPrescriptions, yesterdayPrescriptions));
|
||||
|
||||
return statistics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定日期的处方数量
|
||||
*
|
||||
* @param date 日期
|
||||
* @param practitioner 当前医生(null 则查全部)
|
||||
* @return 处方数量
|
||||
*/
|
||||
private int queryPrescriptionCountByDate(Date date, Practitioner practitioner) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cal.set(Calendar.MINUTE, 0);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
Date dayStart = cal.getTime();
|
||||
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
Date dayEnd = cal.getTime();
|
||||
|
||||
LambdaQueryWrapper<MedicationRequest> query = new LambdaQueryWrapper<>();
|
||||
query.ge(MedicationRequest::getCreateTime, dayStart)
|
||||
.lt(MedicationRequest::getCreateTime, dayEnd)
|
||||
.eq(MedicationRequest::getDeleteFlag, "0");
|
||||
|
||||
// 如果是医生角色,只统计自己开的处方
|
||||
if (practitioner != null) {
|
||||
query.eq(MedicationRequest::getPractitionerId, practitioner.getId());
|
||||
}
|
||||
|
||||
return (int) medicationRequestService.count(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定日期的收款总额(状态为支付成功且未全部退款)
|
||||
*
|
||||
* @param date 日期
|
||||
* @return 收款总额
|
||||
*/
|
||||
private BigDecimal queryRevenueByDate(Date date) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cal.set(Calendar.MINUTE, 0);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
Date dayStart = cal.getTime();
|
||||
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
Date dayEnd = cal.getTime();
|
||||
|
||||
LambdaQueryWrapper<PaymentReconciliation> query = new LambdaQueryWrapper<>();
|
||||
query.ge(PaymentReconciliation::getBillDate, dayStart)
|
||||
.lt(PaymentReconciliation::getBillDate, dayEnd)
|
||||
.eq(PaymentReconciliation::getStatusEnum, PaymentStatus.SUCCESS.getValue())
|
||||
.eq(PaymentReconciliation::getDeleteFlag, "0")
|
||||
.select(PaymentReconciliation::getDisplayAmount);
|
||||
|
||||
java.util.List<PaymentReconciliation> list = paymentReconciliationService.list(query);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return list.stream()
|
||||
.map(p -> p.getDisplayAmount() != null ? p.getDisplayAmount() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取昨天的日期
|
||||
*/
|
||||
private Date getYesterday() {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DAY_OF_MONTH, -1);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算相对前日的百分比变化
|
||||
*
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: org.postgresql.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=hisdev&characterEncoding=UTF-8&client_encoding=UTF-8
|
||||
username: postgresql
|
||||
password: Jchl1528 # 请替换为实际的数据库密码
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: true # 改为true以确保连接有效
|
||||
testOnReturn: false
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat,wall,slf4j
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: openhis
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.110.252
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 1
|
||||
# 密码
|
||||
password: Jchl1528
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
# 服务器配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为18080
|
||||
port: 18080
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /openhis
|
||||
@@ -31,6 +31,34 @@
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 查询全院医生(不限科室),用于手术申请等需跨科室选择医生的场景 -->
|
||||
<select id="getAllDoctorPage" resultType="com.openhis.web.chargemanage.dto.PractitionerMetadata">
|
||||
SELECT T3.tenant_id,
|
||||
T3.ID,
|
||||
T3.NAME,
|
||||
T3.gender_enum,
|
||||
T3.py_str,
|
||||
T3.wb_str,
|
||||
T3.dr_profttl_code
|
||||
FROM (
|
||||
SELECT T1.tenant_id,
|
||||
T1.ID,
|
||||
T1.NAME,
|
||||
T1.gender_enum,
|
||||
T1.py_str,
|
||||
T1.wb_str,
|
||||
T1.dr_profttl_code
|
||||
FROM adm_practitioner AS T1
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND EXISTS(SELECT 1
|
||||
FROM adm_practitioner_role AS T2
|
||||
WHERE T2.practitioner_id = T1.ID
|
||||
AND T2.delete_flag = '0'
|
||||
AND T2.ROLE_code = #{RoleCode})
|
||||
) AS T3
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getNumByPatientIdAndOrganizationId" resultType="Integer">
|
||||
SELECT COUNT
|
||||
(1)
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
AND T1.inventory_status_enum != 3
|
||||
AND T1.delete_flag = '0'
|
||||
<choose>
|
||||
<when test="lotNumber != null">
|
||||
<when test="lotNumber != null and lotNumber != ''">
|
||||
AND T1.lot_number = #{lotNumber}
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
@@ -516,6 +516,8 @@
|
||||
T1.patient_id AS patient_id,
|
||||
'med_medication_definition' AS advice_table_name,
|
||||
T1.medication_id AS advice_definition_id
|
||||
, T1.content_json::jsonb ->> 'remark' AS remark
|
||||
, T1.back_reason AS reason_text
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -577,6 +579,8 @@
|
||||
T1.patient_id AS patient_id,
|
||||
'med_medication_definition' AS advice_table_name,
|
||||
T3.ID AS advice_definition_id
|
||||
, T2.content_json::jsonb ->> 'remark' AS remark
|
||||
, T2.back_reason AS reason_text
|
||||
FROM adm_charge_item AS T1
|
||||
INNER JOIN med_medication_request AS T2 ON T2.ID = T1.service_id AND T2.delete_flag = '0'
|
||||
LEFT JOIN med_medication_definition AS T3 ON T3.ID = T2.medication_id AND T3.delete_flag = '0'
|
||||
@@ -584,6 +588,9 @@
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.service_table = #{MED_MEDICATION_REQUEST}
|
||||
<if test="historyFlag == '0'.toString()">
|
||||
<if test="generateSourceEnum != null">
|
||||
AND (T2.generate_source_enum IS NULL OR T2.generate_source_enum = #{generateSourceEnum})
|
||||
</if>
|
||||
AND T1.encounter_id = #{encounterId}
|
||||
</if>
|
||||
<if test="historyFlag == '1'.toString()">
|
||||
@@ -637,6 +644,8 @@
|
||||
CI.patient_id AS patient_id,
|
||||
'adm_device_definition' AS advice_table_name,
|
||||
CI.product_id AS advice_definition_id
|
||||
, NULL AS remark
|
||||
, NULL AS reason_text
|
||||
FROM adm_charge_item AS CI
|
||||
LEFT JOIN adm_charge_item_definition CID ON CID.id = CI.definition_id AND CID.delete_flag = '0'
|
||||
LEFT JOIN wor_device_request DR ON DR.id = CI.service_id AND DR.delete_flag = '0'
|
||||
@@ -691,6 +700,8 @@
|
||||
T1.patient_id AS patient_id,
|
||||
'adm_device_definition' AS advice_table_name,
|
||||
T1.device_def_id AS advice_definition_id
|
||||
, T1.content_json::jsonb ->> 'remark' AS remark
|
||||
, NULL AS reason_text
|
||||
FROM wor_device_request AS T1
|
||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -746,7 +757,9 @@
|
||||
T1.encounter_id AS encounter_id,
|
||||
T1.patient_id AS patient_id,
|
||||
'wor_activity_definition' AS advice_table_name,
|
||||
T1.activity_id AS advice_definition_id
|
||||
T1.activity_id AS advice_definition_id,
|
||||
T1.remark AS remark
|
||||
, T1.reason_text AS reason_text
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.ID = T1.activity_id
|
||||
@@ -881,13 +894,17 @@
|
||||
t2.ID AS charge_item_definition_id,
|
||||
t2.price AS price,
|
||||
t1.permitted_unit_code AS unit_code,
|
||||
t1.permitted_unit_code AS unit_code_dict_text
|
||||
COALESCE(sdd.dict_label, t1.permitted_unit_code) AS unit_code_dict_text
|
||||
FROM wor_activity_definition t1
|
||||
LEFT JOIN adm_charge_item_definition t2
|
||||
ON t2.instance_id = t1.ID
|
||||
AND t2.delete_flag = '0'
|
||||
AND t2.status_enum = #{statusEnum}
|
||||
AND t2.instance_table = 'wor_activity_definition'
|
||||
LEFT JOIN sys_dict_data sdd
|
||||
ON sdd.dict_value = t1.permitted_unit_code
|
||||
AND sdd.dict_type = 'unit_code'
|
||||
AND sdd.status = '0'
|
||||
WHERE t1.delete_flag = '0'
|
||||
AND (t1.category_code = '手术' OR t1.category_code = '24')
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
@@ -907,7 +924,8 @@
|
||||
t2.ID AS charge_item_definition_id,
|
||||
t2.price AS price,
|
||||
t1.permitted_unit_code AS unit_code,
|
||||
t1.permitted_unit_code AS unit_code_dict_text
|
||||
COALESCE(sdd.dict_label, t1.permitted_unit_code) AS unit_code_dict_text,
|
||||
t1.specimen_code AS specimen_code
|
||||
FROM wor_activity_definition t1
|
||||
LEFT JOIN adm_charge_item_definition t2
|
||||
ON t2.instance_id = t1.ID
|
||||
@@ -917,6 +935,10 @@
|
||||
LEFT JOIN adm_organization t3
|
||||
ON t3.id = t1.org_id
|
||||
AND t3.delete_flag = '0'
|
||||
LEFT JOIN sys_dict_data sdd
|
||||
ON sdd.dict_value = t1.permitted_unit_code
|
||||
AND sdd.dict_type = 'unit_code'
|
||||
AND sdd.status = '0'
|
||||
WHERE t1.delete_flag = '0'
|
||||
AND t1.category_code = #{categoryCode}
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
@@ -925,4 +947,4 @@
|
||||
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -22,19 +22,19 @@
|
||||
AND p.name LIKE CONCAT('%', #{patientName}, '%')
|
||||
</if>
|
||||
ORDER BY e.create_time DESC
|
||||
LIMIT #{pageSize} OFFSET #{offset}
|
||||
</select>
|
||||
|
||||
<select id="getPendingEmrCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(*)
|
||||
FROM adm_encounter e
|
||||
INNER JOIN adm_encounter_participant ep ON e.id = ep.encounter_id AND ep.practitioner_id = #{doctorId}
|
||||
LEFT JOIN adm_patient p ON e.patient_id = p.id
|
||||
LEFT JOIN doc_emr emr ON e.id = emr.encounter_id
|
||||
WHERE e.status_enum = 2
|
||||
AND emr.id IS NULL
|
||||
<if test="patientName != null and patientName != ''">
|
||||
AND e.patient_id IN (
|
||||
SELECT id FROM adm_patient WHERE name LIKE CONCAT('%', #{patientName}, '%')
|
||||
)
|
||||
AND p.name LIKE CONCAT('%', #{patientName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
p.birth_date,
|
||||
p.phone,
|
||||
p.address,
|
||||
p.address_province,
|
||||
p.address_city,
|
||||
p.address_district,
|
||||
p.address_street,
|
||||
p.work_company,
|
||||
p.nationality_code,
|
||||
p.marital_status_enum,
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
ON wsr.source_location_id = al.id
|
||||
AND al.delete_flag = '0'
|
||||
WHERE wsr.delete_flag = '0'
|
||||
AND wsd.status_enum IN (#{preparation}, #{completed})
|
||||
AND wsd.status_enum = #{preparation}
|
||||
AND wsr.type_enum = #{summaryDispense}
|
||||
GROUP BY wsr.tenant_id,
|
||||
wsr.bus_no ,
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
ON T5.medication_def_id = T6.id
|
||||
AND T5.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.status_enum IN (#{inProgress}, #{preparation}, #{prepared})
|
||||
AND T1.status_enum IN (#{inProgress}, #{preparation}, #{prepared}, #{summarized})
|
||||
ORDER BY T1.create_time DESC
|
||||
) AS T7
|
||||
${ew.customSqlSegment}
|
||||
|
||||
@@ -97,14 +97,17 @@
|
||||
ON T4.med_req_id = T5.id
|
||||
AND T5.delete_flag = '0'
|
||||
WHERE <if test="statusEnum == null">
|
||||
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
|
||||
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared},#{summarized})
|
||||
</if>
|
||||
<if test="statusEnum == 3">
|
||||
T4.status_enum IN (#{inProgress},#{preparation},#{prepared})
|
||||
T4.status_enum IN (#{inProgress},#{preparation},#{prepared},#{summarized})
|
||||
</if>
|
||||
<if test="statusEnum == 4">
|
||||
T4.status_enum = #{completed}
|
||||
</if>
|
||||
<if test="statusEnum == 18">
|
||||
T4.status_enum = #{submitted}
|
||||
</if>
|
||||
AND T4.summary_no IS NOT NULL
|
||||
AND T4.summary_no != ''
|
||||
) AS ii
|
||||
@@ -269,14 +272,17 @@
|
||||
AND T1.summary_no != ''
|
||||
AND
|
||||
<if test="dispenseStatus == null">
|
||||
T1.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
|
||||
T1.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared},#{summarized})
|
||||
</if>
|
||||
<if test="dispenseStatus == 3">
|
||||
T1.status_enum IN (#{inProgress},#{preparation},#{prepared})
|
||||
T1.status_enum IN (#{inProgress},#{preparation},#{prepared},#{summarized})
|
||||
</if>
|
||||
<if test="dispenseStatus == 4">
|
||||
T1.status_enum = #{completed}
|
||||
</if>
|
||||
<if test="dispenseStatus == 18">
|
||||
T1.status_enum = #{submitted}
|
||||
</if>
|
||||
AND T14.inventory_status_enum = #{active}
|
||||
ORDER BY prescription_no DESC
|
||||
) AS ii
|
||||
|
||||
@@ -216,8 +216,12 @@
|
||||
ccd.name AS condition_definition_name,
|
||||
T1.therapy_enum AS therapyEnum,
|
||||
T1.sort_number AS sort_number,
|
||||
T1.effective_dose_start AS start_time,
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.medication_id AS advice_definition_id
|
||||
T1.medication_id AS advice_definition_id,
|
||||
T1.content_json::jsonb ->> 'remark' AS remark,
|
||||
T1.effective_dose_end AS stop_time,
|
||||
T1.update_by AS stop_user_name
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -269,8 +273,12 @@
|
||||
'' AS condition_definition_name,
|
||||
2 AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.req_authored_time AS start_time,
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.device_def_id AS advice_definition_id
|
||||
T1.device_def_id AS advice_definition_id,
|
||||
T1.content_json::jsonb ->> 'remark' AS remark,
|
||||
NULL::timestamp AS stop_time,
|
||||
'' AS stop_user_name
|
||||
FROM wor_device_request AS T1
|
||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||
AND T2.delete_flag = '0'
|
||||
@@ -319,8 +327,12 @@
|
||||
'' AS condition_definition_name,
|
||||
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.occurrence_start_time AS start_time,
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.activity_id AS advice_definition_id
|
||||
T1.activity_id AS advice_definition_id,
|
||||
T1.remark AS remark,
|
||||
T1.occurrence_end_time AS stop_time,
|
||||
T1.update_by AS stop_user_name
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.ID = T1.activity_id
|
||||
|
||||
@@ -30,6 +30,44 @@
|
||||
drf.create_time,
|
||||
ap.NAME AS patient_name,
|
||||
CASE
|
||||
-- ========== 手术专用映射 (categoryEnum=24) ==========
|
||||
-- 手术申请单状态枚举: 1=待签发 2=已签发 3=已校对 4=已执行 5=已安排 6=已完成 10=已作废
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 10
|
||||
) THEN 10
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 6
|
||||
) THEN 6
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 5
|
||||
) THEN 5
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 4
|
||||
) THEN 4
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 3
|
||||
) THEN 3
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 2
|
||||
) THEN 2
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
AND ws.category_enum = 24 AND ws.status_enum = 1
|
||||
) THEN 1
|
||||
-- ========== 通用映射 (非手术类型: 检查/检验/药品/输血) ==========
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM wor_service_request ws
|
||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||
|
||||
@@ -274,6 +274,14 @@ public enum AssignSeqEnum {
|
||||
* 检查申请单号(住院)
|
||||
*/
|
||||
CHECK_APPLY_NO("72", "检查申请单号", "JCZ"),
|
||||
/**
|
||||
* 手术申请单号(住院)
|
||||
*/
|
||||
SURGERY_APPLY_NO("73", "手术申请单号", "SSZ"),
|
||||
/**
|
||||
* 检验申请单号(住院)
|
||||
*/
|
||||
LAB_APPLY_NO("74", "检验申请单号", "JYZ"),
|
||||
/**
|
||||
* b 病历文书
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,9 @@ public enum DispenseStatus implements HisEnumInterface {
|
||||
IN_PROGRESS(3, "IN", "待发药"),
|
||||
|
||||
/**
|
||||
* 已发药
|
||||
* 已发药/已完成
|
||||
*/
|
||||
COMPLETED(4, "CO", "已发放"),
|
||||
COMPLETED(4, "CO", "已发药/已完成"),
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
@@ -91,7 +91,17 @@ public enum DispenseStatus implements HisEnumInterface {
|
||||
/**
|
||||
* 已退药
|
||||
*/
|
||||
RETURNED(17, "RT", "已退药");
|
||||
RETURNED(17, "RT", "已退药"),
|
||||
|
||||
/**
|
||||
* 已执行
|
||||
*/
|
||||
EXECUTED(11, "EX", "已执行"),
|
||||
|
||||
/**
|
||||
* 已提交
|
||||
*/
|
||||
SUBMITTED(18, "SB", "已提交");
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
|
||||
@@ -25,9 +25,9 @@ public enum RequestStatus implements HisEnumInterface {
|
||||
ACTIVE(2, "active", "已发送"),
|
||||
|
||||
/**
|
||||
* 已完成
|
||||
* 已校对
|
||||
*/
|
||||
COMPLETED(3, "completed", "已完成"),
|
||||
COMPLETED(3, "completed", "已校对"),
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
@@ -72,7 +72,12 @@ public enum RequestStatus implements HisEnumInterface {
|
||||
/**
|
||||
* 已接收(检查申请:医技科室已接单)
|
||||
*/
|
||||
CHECK_RECEIVED(12, "check_received", "已接收");
|
||||
CHECK_RECEIVED(12, "check_received", "已接收"),
|
||||
|
||||
/**
|
||||
* 已完成(药品发药完成)
|
||||
*/
|
||||
DISPENSE_COMPLETED(20, "dispense_completed", "已完成");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
@@ -8,10 +8,10 @@ import lombok.Getter;
|
||||
*
|
||||
* <pre>
|
||||
* 状态流转:
|
||||
* 预约 → 0→2 (锁定), locked_num+1
|
||||
* 取消预约 → 2→0 (释放), locked_num-1
|
||||
* 签到 → 2→1 (已约), locked_num-1, booked_num+1
|
||||
* 退号 → 1→0 (释放), booked_num-1
|
||||
* 预约 → 0→2 (锁定), locked_num+1, booked_num+1
|
||||
* 取消预约 → 2→0 (释放), refreshPoolStats 重算
|
||||
* 签到 → 2→3 (已签到), locked_num-1
|
||||
* 退号 → →0 (释放), refreshPoolStats 重算
|
||||
* 停诊 → 任意→4 (已取消)
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 手术申请单状态枚举
|
||||
* <p>
|
||||
* 区别于 {@link SurgeryStatusEnum}(手术管理状态:待排期/已排期/手术中/已完成/已取消/暂停),
|
||||
* 本枚举用于手术申请单的业务流转状态,覆盖从医生开立到手术完成的完整生命周期。
|
||||
*
|
||||
* <pre>
|
||||
* 正向流转:
|
||||
* 待签发(1) → 已签发(2) → 已校对(3) → 已执行(4) → 已安排(5) → 已完成(6)
|
||||
*
|
||||
* 逆向流转:
|
||||
* 已签发(2) → 待签发(1) (医生撤回 / 护士退回)
|
||||
* 已执行(4) → 已校对(3) (护士取消执行)
|
||||
* 任意状态 → 已作废(10) (医生撤销)
|
||||
* </pre>
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-06-02
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SurgeryAppStatusEnum {
|
||||
|
||||
/** 待签发 — 医生已保存但尚未提交,仅在医生站可见 */
|
||||
PENDING_SIGN(1, "待签发"),
|
||||
|
||||
/** 已签发 — 医生已提交,自动流转至护士工作站待校对 */
|
||||
SIGNED(2, "已签发"),
|
||||
|
||||
/** 已校对 — 病区护士已校对手术医嘱 */
|
||||
VERIFIED(3, "已校对"),
|
||||
|
||||
/** 已执行 — 病区护士已执行手术医嘱,已向手麻科提交申请 */
|
||||
EXECUTED(4, "已执行"),
|
||||
|
||||
/** 已安排 — 手麻科已排好手术间及时间,待手术 */
|
||||
SCHEDULED(5, "已安排"),
|
||||
|
||||
/** 已完成 — 手术已结束并录入完毕(终态只读) */
|
||||
COMPLETED(6, "已完成"),
|
||||
|
||||
/** 已作废 — 医生中途撤销了手术申请(终态) */
|
||||
CANCELLED(10, "已作废");
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
/**
|
||||
* 根据状态码获取枚举
|
||||
*
|
||||
* @param code 状态码
|
||||
* @return 对应的枚举,未匹配返回 null
|
||||
*/
|
||||
public static SurgeryAppStatusEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (SurgeryAppStatusEnum val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为终态(不可再变更)
|
||||
*/
|
||||
public boolean isFinal() {
|
||||
return this == COMPLETED || this == CANCELLED;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否允许医生编辑
|
||||
*/
|
||||
public boolean isEditable() {
|
||||
return this == PENDING_SIGN;
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
||||
FROM adm_schedule_slot s
|
||||
WHERE s.pool_id = p.id
|
||||
AND s.delete_flag = '0'
|
||||
AND s.status = #{bookedStatus}
|
||||
AND s.status IN (#{bookedStatus}, #{lockedStatus}, 3)
|
||||
), 0),
|
||||
locked_num = COALESCE((
|
||||
SELECT COUNT(1)
|
||||
@@ -42,7 +42,7 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
||||
@Param("lockedStatus") Integer lockedStatus);
|
||||
|
||||
/**
|
||||
* 签到时更新号源池统计:锁定数-1,已预约数+1
|
||||
* 签到时更新号源池统计:锁定数-1(booked_num 在预约时已累加)
|
||||
*
|
||||
* @param poolId 号源池ID
|
||||
* @return 结果
|
||||
@@ -50,7 +50,6 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
||||
@Update("""
|
||||
UPDATE adm_schedule_pool
|
||||
SET locked_num = locked_num - 1,
|
||||
booked_num = booked_num + 1,
|
||||
update_time = NOW()
|
||||
WHERE id = #{poolId}
|
||||
AND locked_num > 0
|
||||
|
||||
@@ -267,7 +267,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
||||
if (poolId != null) {
|
||||
schedulePoolMapper.update(null,
|
||||
new LambdaUpdateWrapper<SchedulePool>()
|
||||
.setSql("locked_num = locked_num + 1, version = version + 1")
|
||||
.setSql("locked_num = locked_num + 1, booked_num = booked_num + 1, version = version + 1")
|
||||
.set(SchedulePool::getUpdateTime, new Date())
|
||||
.eq(SchedulePool::getId, poolId));
|
||||
}
|
||||
@@ -329,16 +329,16 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
||||
orderService.updateOrderStatusById(latestOrder.getId(), OrderStatus.ACTIVE.getValue());
|
||||
orderMapper.updatePayStatus(latestOrder.getId(), 1, new Date());
|
||||
|
||||
// 2. 只有锁定态(2)的号源才能签到,签到时 2→1(LOCKED→BOOKED)
|
||||
// 2. 只有锁定态(2)的号源才能签到,签到时 2→3(LOCKED→CHECKED_IN)
|
||||
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
|
||||
if (slot == null || !SlotStatus.LOCKED.getValue().equals(slot.getStatus())) {
|
||||
throw new RuntimeException("号源状态异常,无法签到");
|
||||
}
|
||||
|
||||
// 3. 更新号源槽位状态 2→1(LOCKED→BOOKED,已预约=已签到)
|
||||
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.BOOKED.getValue(), new Date(), SlotStatus.LOCKED.getValue());
|
||||
// 3. 更新号源槽位状态 2→3(LOCKED→CHECKED_IN,已签到)
|
||||
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.CHECKED_IN.getValue(), new Date(), SlotStatus.LOCKED.getValue());
|
||||
|
||||
// 4. 更新号源池统计:锁定数-1,已预约数+1
|
||||
// 4. 更新号源池统计:锁定数-1,已签到数+1
|
||||
if (slot != null && slot.getPoolId() != null) {
|
||||
schedulePoolMapper.updatePoolStatsOnCheckIn(slot.getPoolId());
|
||||
}
|
||||
|
||||
@@ -111,6 +111,9 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
|
||||
/** 退回原因 */
|
||||
private String backReason = "";
|
||||
|
||||
/** 请求开始时间 */
|
||||
private Date reqAuthoredTime;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface IMedicationRequestService extends IService<MedicationRequest> {
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate, String backReason);
|
||||
|
||||
/**
|
||||
* 更新请求状态:取消
|
||||
|
||||
@@ -141,7 +141,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
// 药品发放id
|
||||
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 药品发放状态
|
||||
medicationDispense.setStatusEnum(DispenseStatus.PREPARATION.getValue());
|
||||
medicationDispense.setStatusEnum(DispenseStatus.EXECUTED.getValue());
|
||||
// 状态变更时间
|
||||
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
|
||||
// 发药类型
|
||||
@@ -300,7 +300,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum,
|
||||
DispenseStatus.SUMMARIZED.getValue())
|
||||
DispenseStatus.SUBMITTED.getValue())
|
||||
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
|
||||
.set(MedicationDispense::getSummaryNo, busNo)
|
||||
.in(MedicationDispense::getId, medDispenseId)
|
||||
@@ -332,7 +332,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
int result = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.set(MedicationDispense::getStatusEnum,
|
||||
DispenseStatus.PREPARATION.getValue())
|
||||
DispenseStatus.EXECUTED.getValue())
|
||||
.set(MedicationDispense::getSummaryNo, null)
|
||||
.in(MedicationDispense::getSummaryNo, summaryNoList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
@@ -368,6 +368,6 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
.in(MedicationDispense::getSummaryNo, summaryNoList)
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(MedicationDispense::getStatusEnum,
|
||||
DispenseStatus.SUMMARIZED.getValue()));
|
||||
DispenseStatus.SUBMITTED.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate) {
|
||||
public void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate, String backReason) {
|
||||
LambdaUpdateWrapper<MedicationRequest> updateWrapper =
|
||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
||||
.set(MedicationRequest::getStatusEnum, RequestStatus.DRAFT.getValue());
|
||||
@@ -54,6 +54,9 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
||||
if (checkDate != null) {
|
||||
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
||||
}
|
||||
if (backReason != null) {
|
||||
updateWrapper.set(MedicationRequest::getBackReason, backReason);
|
||||
}
|
||||
baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,4 +173,9 @@ public class ServiceRequest extends HisBaseEntity {
|
||||
*/
|
||||
private Integer generateSourceEnum;
|
||||
|
||||
/**
|
||||
* 备注(最长50字)
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
* @param practitionerId 校对人
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate);
|
||||
void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate, String backReason);
|
||||
|
||||
/**
|
||||
* 更新服务状态:待发送
|
||||
@@ -149,4 +149,12 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
* @return 请求信息列表
|
||||
*/
|
||||
List<ServiceRequest> getServiceRequestListByEncounterId(Long encounterId);
|
||||
|
||||
/**
|
||||
* 更新手术申请单状态(批量)
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum)
|
||||
*/
|
||||
void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode);
|
||||
}
|
||||
|
||||
@@ -197,9 +197,15 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
* @param checkDate 校对时间
|
||||
*/
|
||||
@Override
|
||||
public void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate) {
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId()).setCheckTime(DateUtils.getNowDate()),
|
||||
public void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate, String backReason) {
|
||||
ServiceRequest updateEntity = new ServiceRequest()
|
||||
.setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||
.setCheckTime(DateUtils.getNowDate());
|
||||
if (backReason != null && !backReason.isEmpty()) {
|
||||
updateEntity.setReasonText(backReason);
|
||||
}
|
||||
baseMapper.update(updateEntity,
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serviceRequestIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
@@ -272,4 +278,19 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<ServiceRequest>()
|
||||
.eq(ServiceRequest::getEncounterId, encounterId).eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新手术申请单状态(批量)
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum: 1=待签发,2=已签发,3=已校对,4=已执行,5=已安排,6=已完成,10=已作废)
|
||||
*/
|
||||
@Override
|
||||
public void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode) {
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<ServiceRequest>()
|
||||
.set(ServiceRequest::getStatusEnum, statusCode)
|
||||
.in(ServiceRequest::getId, serReqIdList)
|
||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
AND T1.delete_flag = '0'
|
||||
AND T2.delete_flag = '0'
|
||||
AND T1.tenant_id = #{tenantId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -340,8 +340,8 @@
|
||||
OR d.is_stopped = FALSE
|
||||
)
|
||||
</when>
|
||||
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status)">
|
||||
AND <include refid="slotStatusNormExpr" /> = 1
|
||||
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status) or '已签到'.equals(query.status)">
|
||||
AND (<include refid="slotStatusNormExpr" /> = 1 OR <include refid="slotStatusNormExpr" /> = 3)
|
||||
AND (
|
||||
d.is_stopped IS NULL
|
||||
OR d.is_stopped = FALSE
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<java.version>17</java.version> <!-- 将21改为17 -->
|
||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<druid.version>1.2.27</druid.version>
|
||||
<druid.version>1.2.28</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
<oshi.version>6.6.5</oshi.version>
|
||||
<commons.io.version>2.13.0</commons.io.version>
|
||||
<oshi.version>6.10.0</oshi.version>
|
||||
<commons.io.version>2.21.0</commons.io.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
@@ -42,17 +42,17 @@
|
||||
<lombok.version>1.18.34</lombok.version> <!-- 替换为 -->
|
||||
<mybatis-plus.version>3.5.5</mybatis-plus.version>
|
||||
<flowable.version>6.8.0</flowable.version>
|
||||
<postgresql.version>42.2.27</postgresql.version>
|
||||
<postgresql.version>42.7.4</postgresql.version>
|
||||
<aviator.version>5.3.3</aviator.version>
|
||||
<swagger-annotations.version>1.5.21</swagger-annotations.version>
|
||||
<fastjson2.version>2.0.58</fastjson2.version>
|
||||
<fastjson2.version>2.0.61</fastjson2.version>
|
||||
<swagger-models.version>1.6.2</swagger-models.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<liteflow-spring-boot-starter.version>2.12.4.1</liteflow-spring-boot-starter.version>
|
||||
<hutool-all.version>5.3.8</hutool-all.version>
|
||||
<bcprov-jdk15on.version>1.69</bcprov-jdk15on.version>
|
||||
<hutool-all.version>5.8.35</hutool-all.version>
|
||||
<bcprov-jdk18on.version>1.80</bcprov-jdk18on.version>
|
||||
<kernel.version>7.1.2</kernel.version>
|
||||
<itextpdf.version>5.5.12</itextpdf.version>
|
||||
<itextpdf.version>5.5.13.4</itextpdf.version>
|
||||
<itext-asian.version>5.2.0</itext-asian.version>
|
||||
<mysql-connector-j.version>9.4.0</mysql-connector-j.version>
|
||||
<jsr250.version>1.3.2</jsr250.version>
|
||||
@@ -93,8 +93,8 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
<version>${bcprov-jdk15on.version}</version>
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
<version>${bcprov-jdk18on.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
1
openhis-ui-vue3/.gitignore
vendored
1
openhis-ui-vue3/.gitignore
vendored
@@ -26,3 +26,4 @@ yarn.lock
|
||||
test-results/
|
||||
tests/e2e/report/
|
||||
tests/tests/
|
||||
vite.config.js.timestamp*
|
||||
|
||||
8352
openhis-ui-vue3/package-lock.json
generated
Executable file → Normal file
8352
openhis-ui-vue3/package-lock.json
generated
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,93 +1,88 @@
|
||||
{
|
||||
"name": "openhis",
|
||||
"version": "3.8.10",
|
||||
"description": "OpenHIS管理系统",
|
||||
"author": "OpenHIS",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --mode dev",
|
||||
"build:prod": "vite build --mode prod",
|
||||
"build:stage": "vite build --mode staging",
|
||||
"build:test": "vite build --mode test",
|
||||
"build:dev": "vite build --mode dev",
|
||||
"preview": "vite preview",
|
||||
"build:spug": "vite build --mode spug",
|
||||
"test": "vitest",
|
||||
"test:run": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:ui": "vitest --ui",
|
||||
"lint": "eslint . --ext .js,.vue src/",
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui",
|
||||
"test:e2e:report": "playwright show-report"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "giturl"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"@vueup/vue-quill": "1.2.0",
|
||||
"@vueuse/core": "10.6.1",
|
||||
"axios": "0.27.2",
|
||||
"china-division": "^2.7.0",
|
||||
"d3": "^7.9.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"decimal.js": "^10.5.0",
|
||||
"echarts": "^5.4.3",
|
||||
"element-china-area-data": "^6.1.0",
|
||||
"element-plus": "^2.12.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"fuse.js": "^7.0.0",
|
||||
"html2pdf.js": "^0.10.3",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsencrypt": "^3.3.2",
|
||||
"json-bigint": "^1.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash-es": "^4.17.21",
|
||||
"moment": "^2.30.1",
|
||||
"next": "^16.1.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.2.0",
|
||||
"pinyin": "^4.0.0-alpha.2",
|
||||
"province-city-china": "^8.5.8",
|
||||
"qrcode": "^1.5.4",
|
||||
"qrcodejs2": "^0.0.2",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"segmentit": "^2.0.3",
|
||||
"sortablejs": "^1.15.6",
|
||||
"v-region": "^3.3.0",
|
||||
"vue": "^3.5.13",
|
||||
"vue-area-linkage": "^5.1.0",
|
||||
"vue-cropper": "^1.1.1",
|
||||
"vue-plugin-hiprint": "^0.0.19",
|
||||
"vue-router": "^4.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.58.2",
|
||||
"@types/node": "^25.0.1",
|
||||
"@vitejs/plugin-vue": "4.5.0",
|
||||
"@vue/compiler-sfc": "3.3.9",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-vue": "^10.9.0",
|
||||
"globals": "^17.5.0",
|
||||
"happy-dom": "^20.8.3",
|
||||
"jsdom": "^28.1.0",
|
||||
"pg": "^8.18.0",
|
||||
"sass": "1.69.5",
|
||||
"typescript": "^5.9.3",
|
||||
"unplugin-auto-import": "0.17.1",
|
||||
"unplugin-vue-setup-extend-plus": "1.0.0",
|
||||
"vite": "5.0.4",
|
||||
"vite-plugin-compression": "0.5.1",
|
||||
"vite-plugin-svg-icons": "2.0.1",
|
||||
"vite-plugin-vue-mcp": "^0.3.2",
|
||||
"vitest": "^4.0.18",
|
||||
"vue-tsc": "^3.1.8"
|
||||
}
|
||||
}
|
||||
"name": "openhis",
|
||||
"version": "3.8.10",
|
||||
"description": "OpenHIS管理系统",
|
||||
"author": "OpenHIS",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --mode dev",
|
||||
"build:prod": "vite build --mode prod",
|
||||
"build:stage": "vite build --mode staging",
|
||||
"build:test": "vite build --mode test",
|
||||
"build:dev": "vite build --mode dev",
|
||||
"preview": "vite preview",
|
||||
"build:spug": "vite build --mode spug",
|
||||
"test": "vitest",
|
||||
"test:run": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:ui": "vitest --ui",
|
||||
"lint": "eslint . --ext .js,.vue src/",
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui",
|
||||
"test:e2e:report": "playwright show-report"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "giturl"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"@vue/shared": "^3.5.25",
|
||||
"@vueup/vue-quill": "^1.5.1",
|
||||
"@vueuse/core": "^14.3.0",
|
||||
"axios": "^1.16.1",
|
||||
"china-division": "^2.7.0",
|
||||
"d3": "^7.9.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"decimal.js": "^10.5.0",
|
||||
"echarts": "^5.6.0",
|
||||
"element-china-area-data": "^6.1.0",
|
||||
"element-plus": "^2.14.1",
|
||||
"file-saver": "^2.0.5",
|
||||
"fuse.js": "^7.0.0",
|
||||
"html2pdf.js": "^0.10.3",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsencrypt": "^3.3.2",
|
||||
"json-bigint": "^1.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.2.0",
|
||||
"pinyin": "^4.0.0-alpha.2",
|
||||
"province-city-china": "^8.5.8",
|
||||
"qrcodejs2": "^0.0.2",
|
||||
"segmentit": "^2.0.3",
|
||||
"sortablejs": "^1.15.7",
|
||||
"v-region": "^3.3.0",
|
||||
"vue": "^3.5.25",
|
||||
"vue-area-linkage": "^5.1.0",
|
||||
"vue-cropper": "^1.1.1",
|
||||
"vue-plugin-hiprint": "^0.0.60",
|
||||
"vue-router": "^4.6.4",
|
||||
"vxe-table": "^4.19.6",
|
||||
"xe-utils": "^4.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.60.0",
|
||||
"@types/node": "^25.0.1",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"eslint": "^10.4.1",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-vue": "^10.9.1",
|
||||
"globals": "^17.5.0",
|
||||
"happy-dom": "^20.8.3",
|
||||
"jsdom": "^28.1.0",
|
||||
"pg": "^8.18.0",
|
||||
"sass": "^1.100.0",
|
||||
"typescript": "^5.9.3",
|
||||
"unplugin-auto-import": "^0.18.6",
|
||||
"vite": "^6.4.3",
|
||||
"vite-plugin-compression": "0.5.1",
|
||||
"vite-plugin-svg-icons": "2.0.1",
|
||||
"vite-plugin-vue-mcp": "^0.3.2",
|
||||
"vitest": "^4.0.18",
|
||||
"vue-tsc": "^3.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// 数据处理
|
||||
// 数据处理
|
||||
import * as d3 from 'd3';
|
||||
import {symbol} from 'd3-shape';
|
||||
import {
|
||||
degreesOnline,
|
||||
disconnectEvents,
|
||||
@@ -142,7 +141,7 @@ export const iconDrawObj = {
|
||||
})
|
||||
.append('path')
|
||||
.call((path) => {
|
||||
const symbolThree = symbol();
|
||||
const symbolThree = d3.symbol();
|
||||
const symbolIndex = 5;
|
||||
symbolThree.type(d3.symbols[symbolIndex]);
|
||||
path.attr('d', symbolThree.size(riangle)).attr('fill', fill).attr('stroke', stroke);
|
||||
@@ -162,6 +161,24 @@ export function getG(svg, viewConfig) {
|
||||
// 设置数据
|
||||
export function getData(allData) {
|
||||
const rowsData = allData.rows; // allData, '【全部数据】'
|
||||
// 兼容旧数据:将旧 typeCode 映射到新 typeCode(心率 004→014,脉搏 005→002,呼吸 006→001)
|
||||
const OLD_CODE_MAP = { '004': '014', '005': '002', '006': '001' };
|
||||
rowsData.forEach(row => {
|
||||
if (row.rowBOS) {
|
||||
const prependItems = [];
|
||||
row.rowBOS.forEach(item => {
|
||||
const newCode = OLD_CODE_MAP[item.typeCode];
|
||||
// 始终添加映射条目,用 unshift 插入数组头部
|
||||
// 这样 getType 的 find() 优先匹配映射后的编码(如脉冲、呼吸)
|
||||
// 即使存在同编码的旧条目(如血压舒张压用 002、收缩压用 001),
|
||||
// 映射后的脉搏(002)和呼吸(001)条目排在前面,确保图表正确渲染
|
||||
if (newCode) {
|
||||
prependItems.push({ ...item, typeCode: newCode });
|
||||
}
|
||||
});
|
||||
row.rowBOS.unshift(...prependItems);
|
||||
}
|
||||
});
|
||||
const infoData = allData.grParamBOS;
|
||||
const typesData = getTypeDatas(allData.types, allData.grParamBOS.beginDate);
|
||||
const selectOp = allData.selectOp;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export function getG(svg, translateX, translateY) {
|
||||
return svg.append('g').attr('transform', `translate(${translateX},${translateY})`);
|
||||
@@ -228,7 +228,7 @@ export function getHeartRate(
|
||||
function getIndex(beginDate, date, time) {
|
||||
if (beginDate === undefined || date === undefined) return;
|
||||
const diffTime =
|
||||
moment(date.substring(0, 10)).diff(moment(beginDate.substring(0, 10))) / 1000 / 3600 / 24;
|
||||
dayjs(date.substring(0, 10)).diff(dayjs(beginDate.substring(0, 10))) / 1000 / 3600 / 24;
|
||||
const diffIndex = parseInt(time.substring(0, 2));
|
||||
return diffTime * 6 + Math.floor(diffIndex / 4);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 登录方法
|
||||
// 登录方法
|
||||
export function login(username, password, code, uuid, tenantId) {
|
||||
const data = {
|
||||
username,
|
||||
@@ -20,7 +20,7 @@ export function login(username, password, code, uuid, tenantId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 注册方法
|
||||
// 注册方法
|
||||
export function register(data) {
|
||||
return request({
|
||||
url: '/register',
|
||||
@@ -32,7 +32,7 @@ export function register(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
// 获å–çâ€Â¨Ã¦Ë†Â·Ã¨Â¯Â¦Ã§Â»â€ ä¿¡æÂ¯
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: '/getInfo',
|
||||
@@ -40,7 +40,7 @@ export function getInfo() {
|
||||
})
|
||||
}
|
||||
|
||||
// 退出方法
|
||||
// 退出方法
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/logout',
|
||||
@@ -48,9 +48,9 @@ export function logout() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
// 获å–验è¯Âç Â
|
||||
export function getUserBindTenantList(username) {
|
||||
// 确保username存在,避免构建出错误的URL
|
||||
// ç¡®ä¿Âusernameå˜在,é¿å…Â构建出éâ€â„¢Ã¨Â¯Â¯Ã§Å¡â€žURL
|
||||
const safeUsername = username || '';
|
||||
return request({
|
||||
url: '/system/tenant/user-bind/' + safeUsername,
|
||||
@@ -62,7 +62,7 @@ export function getUserBindTenantList(username) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
// 获å–验è¯Âç Â
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
url: '/captchaImage',
|
||||
@@ -74,7 +74,7 @@ export function getCodeImg() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前登录用户所属科室
|
||||
// 获å–当å‰Â登录çâ€Â¨Ã¦Ë†Â·Ã¦â€°â‚¬Ã¥Â±Å¾Ã§Â§â€˜Ã¥Â®Â¤
|
||||
export function getOrg() {
|
||||
return request({
|
||||
url: '/base-data-manage/practitioner/get-selectable-org-list',
|
||||
@@ -82,7 +82,7 @@ export function getOrg() {
|
||||
})
|
||||
}
|
||||
|
||||
// 切换科室
|
||||
// 切æÂ¢ç§‘室
|
||||
export function switchOrg(orgId) {
|
||||
return request({
|
||||
url: '/base-data-manage/practitioner/switch-org?orgId=' + orgId,
|
||||
@@ -90,10 +90,18 @@ export function switchOrg(orgId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 医保签到
|
||||
// 医ä¿Âç¾到
|
||||
export function sign(practitionerId, mac, ip) {
|
||||
return request({
|
||||
url: `/yb-request/sign?practitionerId=${practitionerId}&mac=${mac}&ip=${ip}`,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 锁屏解锁(验证登录状态)
|
||||
export function unlockScreen(password) {
|
||||
return request({
|
||||
url: '/getInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,3 +108,29 @@ export function getReadNoticeIds() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取顶部公告/通知列表(最新N条)
|
||||
export function listNoticeTop(query) {
|
||||
return request({
|
||||
url: '/system/notice/public/top',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 标记单条公告/通知为已读
|
||||
export function markNoticeRead(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/public/read/' + noticeId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量标记公告/通知为已读(逗号分隔的ID字符串)
|
||||
export function markNoticeReadAll(noticeIds) {
|
||||
return request({
|
||||
url: '/system/notice/public/read/all',
|
||||
method: 'post',
|
||||
data: noticeIds
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@use 'sass:color';
|
||||
@import './variables.module.scss';
|
||||
|
||||
// Element Plus风格的颜色按钮样式
|
||||
@@ -22,14 +23,14 @@
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: lighten($color, 10%);
|
||||
border-color: lighten($color, 10%);
|
||||
background-color: color.adjust($color, $lightness: 10%);
|
||||
border-color: color.adjust($color, $lightness: 10%);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: darken($color, 5%);
|
||||
border-color: darken($color, 5%);
|
||||
background-color: color.adjust($color, $lightness: -5%);
|
||||
border-color: color.adjust($color, $lightness: -5%);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: #409eff;
|
||||
color: #3B82F6;
|
||||
border-color: #c6e2ff;
|
||||
background-color: #ecf5ff;
|
||||
}
|
||||
@@ -149,7 +150,7 @@
|
||||
// 不同颜色的链接按钮
|
||||
.blue-btn-link {
|
||||
@extend .pan-btn-link;
|
||||
color: #409eff;
|
||||
color: #3B82F6;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
@@ -159,7 +160,7 @@
|
||||
|
||||
.red-btn-link {
|
||||
@extend .pan-btn-link;
|
||||
color: #f56c6c;
|
||||
color: #EF4444;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
@@ -169,7 +170,7 @@
|
||||
|
||||
.info-btn-link {
|
||||
@extend .pan-btn-link;
|
||||
color: #909399;
|
||||
color: #64748B;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import './variables.module.scss';
|
||||
@import './variables.module.scss';
|
||||
@import './mixin.scss';
|
||||
@import './transition.scss';
|
||||
@import './element-ui.scss';
|
||||
@@ -7,6 +7,8 @@
|
||||
@import './openhis.scss';
|
||||
@import './font.scss';
|
||||
@import './ui-standard.scss';
|
||||
@import './vxe-table.scss';
|
||||
@import './screen-1080p.scss';
|
||||
|
||||
/* 强制使用鸿蒙字体 */
|
||||
* {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user