Merge remote-tracking branch 'origin/master'
# Conflicts:
# zhitan-admin/src/main/java/com/zhitan/web/controller/model/EnergyIndexController.java
# zhitan-admin/src/main/resources/application-dev.yml
# zhitan-system/src/main/java/com/zhitan/model/mapper/EnergyIndexMapper.java
# zhitan-system/src/main/java/com/zhitan/model/service/IEnergyIndexService.java
# zhitan-system/src/main/java/com/zhitan/model/service/impl/EnergyIndexServiceImpl.java
# zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml
# zhitan-vue/.env.development
已添加71个文件
已重命名4个文件
已删除1个文件
已修改139个文件
| | |
| | | Apache License |
| | | Version 2.0, January 2004 |
| | | http://www.apache.org/licenses/ |
| | | |
| | | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
| | | ZT PUBLIC LICENSEææåè®®1.0 |
| | | ZT PUBLIC LICENSE 1.0 |
| | | |
| | | 1. Definitions. |
| | | è®¸å¯ |
| | | |
| | | "License" shall mean the terms and conditions for use, reproduction, |
| | | and distribution as defined by Sections 1 through 9 of this document. |
| | | ZT PUBLIC LICENSE ç±é岿ºç¢³æªæ¥ç§ææéå
¬å¸ï¼www.zhitancloud.comï¼èµ·èï¼ç®ç§°ZTPLåè®®ã |
| | | ä»»ä½äººåå¯ä½¿ç¨è¯¥åè®®æ¥åå¸å¼æºè½¯ä»¶ï¼å¹¶å¯å¯¹ä¸é¢åè®®æ£æä¸ä»¥ä¸åçº¿æ æ³¨ç空ç½é¨ååç¸åºä¿®æ¹ï¼ |
| | | 餿¤ä¹å¤çä»»ä½å
容ä¸å¾åä»»ä½ä¿®æ¹ãé岿ºç¢³æªæ¥ç§ææéå
¬å¸æ¥æå¯¹è¯¥åè®®æ¡æ¬¾çæç»è§£éæã |
| | | |
| | | "Licensor" shall mean the copyright owner or entity authorized by |
| | | the copyright owner that is granting the License. |
| | | åè¨ï¼ |
| | | |
| | | "Legal Entity" shall mean the union of the acting entity and all |
| | | other entities that control, are controlled by, or are under common |
| | | control with that entity. For the purposes of this definition, |
| | | "control" means (i) the power, direct or indirect, to cause the |
| | | direction or management of such entity, whether by contract or |
| | | otherwise, or (ii) ownership of fifty percent (50%) or more of the |
| | | outstanding shares, or (iii) beneficial ownership of such entity. |
| | | ___________ï¼ä»¥ä¸ç®ç§°è¯¥è½¯ä»¶ï¼ç±_____________å¼åï¼ä»¥ä¸ç®ç§°æï¼ãæä¾æ³æ¥æè¯¥è½¯ä»¶çææçæã |
| | | æ¬çå
±äº«å¼æ¾çè§åº¦ï¼æä»¥å¼æ¾æºä»£ç çå½¢å¼åå¸è¯¥è½¯ä»¶ãæ¨å¯ä»¥å¨éµå®è¯¥åè®®çåæä¸ä½¿ç¨è¯¥è½¯ä»¶ã |
| | | èªæ¨å®è£
该软件å¼å§ï¼æ¨åæä¹é´çååå
³ç³»èªå¨æç«ãé¤éæ¨åæ¢ä½¿ç¨è¯¥è½¯ä»¶æä¸ææç¾ç½²é¢å¤ååï¼ |
| | | æ¨é¡»è®¤çéµå¾ªè¯¥ææå议约å®çæ¯ä¸æ¡æ¬¾ã |
| | | |
| | | "You" (or "Your") shall mean an individual or Legal Entity |
| | | exercising permissions granted by this License. |
| | | æçèç³»æ¹å¼ï¼___________________________________________________________________ã |
| | | |
| | | "Source" form shall mean the preferred form for making modifications, |
| | | including but not limited to software source code, documentation |
| | | source, and configuration files. |
| | | 约å®: |
| | | |
| | | "Object" form shall mean any form resulting from mechanical |
| | | transformation or translation of a Source form, including but |
| | | not limited to compiled object code, generated documentation, |
| | | and conversions to other media types. |
| | | ä¸è¿°æ¡æ¬¾ä¸ææè¯¥è½¯ä»¶çæ å¿å
æ¬å¦ä¸æ¹é¢ï¼ |
| | | |
| | | "Work" shall mean the work of authorship, whether in Source or |
| | | Object form, made available under the License, as indicated by a |
| | | copyright notice that is included in or attached to the work |
| | | (an example is provided in the Appendix below). |
| | | 该软件æºä»£ç åææ¡£ä¸å
³äºè¯¥è½¯ä»¶ççææç¤ºãæåãå¾çå龿¥ã |
| | | 该软件è¿è¡æ¶çé¢ä¸åç°åºæ¥çæå
³è¯¥è½¯ä»¶çæåãå¾çå龿¥ã |
| | | _________________________________________________ã |
| | | |
| | | "Derivative Works" shall mean any work, whether in Source or Object |
| | | form, that is based on (or derived from) the Work and for which the |
| | | editorial revisions, annotations, elaborations, or other modifications |
| | | represent, as a whole, an original work of authorship. For the purposes |
| | | of this License, Derivative Works shall not include works that remain |
| | | separable from, or merely link (or bind by name) to the interfaces of, |
| | | the Work and Derivative Works thereof. |
| | | ä¸å
æ¬å¦ä¸æ¹é¢ï¼ |
| | | |
| | | "Contribution" shall mean any work of authorship, including |
| | | the original version of the Work and any modifications or additions |
| | | to that Work or Derivative Works thereof, that is intentionally |
| | | submitted to Licensor for inclusion in the Work by the copyright owner |
| | | or by an individual or Legal Entity authorized to submit on behalf of |
| | | the copyright owner. For the purposes of this definition, "submitted" |
| | | means any form of electronic, verbal, or written communication sent |
| | | to the Licensor or its representatives, including but not limited to |
| | | communication on electronic mailing lists, source code control systems, |
| | | and issue tracking systems that are managed by, or on behalf of, the |
| | | Licensor for the purpose of discussing and improving the Work, but |
| | | excluding communication that is conspicuously marked or otherwise |
| | | designated in writing by the copyright owner as "Not a Contribution." |
| | | 该软件æä¾çæ¼ç¤ºæ°æ®ä¸å
³äºè¯¥è½¯ä»¶çæåãå¾çå龿¥ã |
| | | _________________________________________________ã |
| | | |
| | | "Contributor" shall mean Licensor and any individual or Legal Entity |
| | | on behalf of whom a Contribution has been received by Licensor and |
| | | subsequently incorporated within the Work. |
| | | ä¸ãå
è´£ |
| | | |
| | | 2. Grant of Copyright License. Subject to the terms and conditions of |
| | | this License, each Contributor hereby grants to You a perpetual, |
| | | worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
| | | copyright license to reproduce, prepare Derivative Works of, |
| | | publicly display, publicly perform, sublicense, and distribute the |
| | | Work and such Derivative Works in Source or Object form. |
| | | 该软件æ¯ä»¥å¼æ¾æºä»£ç çæ¹å¼åè¡ï¼æ¨ä½¿ç¨è¯¥è½¯ä»¶æ éä»»ä½è´¹ç¨ï¼å æ¤å¨ä½¿ç¨è¯¥è½¯ä»¶åï¼æ¨é¡»ç¥æï¼ |
| | | |
| | | 3. Grant of Patent License. Subject to the terms and conditions of |
| | | this License, each Contributor hereby grants to You a perpetual, |
| | | worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
| | | (except as stated in this section) patent license to make, have made, |
| | | use, offer to sell, sell, import, and otherwise transfer the Work, |
| | | where such license applies only to those patent claims licensable |
| | | by such Contributor that are necessarily infringed by their |
| | | Contribution(s) alone or by combination of their Contribution(s) |
| | | with the Work to which such Contribution(s) was submitted. If You |
| | | institute patent litigation against any entity (including a |
| | | cross-claim or counterclaim in a lawsuit) alleging that the Work |
| | | or a Contribution incorporated within the Work constitutes direct |
| | | or contributory patent infringement, then any patent licenses |
| | | granted to You under this License for that Work shall terminate |
| | | as of the date such litigation is filed. |
| | | 1.1 ææ²¡æå¯¹è¯¥è½¯ä»¶æä¾ä»»ä½ææ¯æ¯æçä¹å¡ï¼æ¨å¯èç³»æè´ä¹°åä¸çææ¯æ¯æã |
| | | 1.2 æå¯¹å 使ç¨è¯¥è½¯ä»¶è产çç´æ¥æé´æ¥çä»»ä½é®é¢ä¸è´ä»»ä½è´£ä»»ã |
| | | 1.3 弿ºä¸çäºå
è´¹ï¼å¼æºä¸çäºæ çæï¼å¼æºè½¯ä»¶çåå±éè¦æ¨æå
±åçåªåã |
| | | |
| | | 4. Redistribution. You may reproduce and distribute copies of the |
| | | Work or Derivative Works thereof in any medium, with or without |
| | | modifications, and in Source or Object form, provided that You |
| | | meet the following conditions: |
| | | äºãèªç¨è¯¥è½¯ä»¶ |
| | | |
| | | (a) You must give any other recipients of the Work or |
| | | Derivative Works a copy of this License; and |
| | | 2.1 æ¨ä¸ªäººææ¨å°±èçå
¬å¸ï¼ç»ç»ï¼å¯èªç±ä½¿ç¨è¯¥è½¯ä»¶ï¼æä¸å¯¹æ¨ææ¨å°±èå
¬å¸ï¼ç»ç»ï¼çæ§è´¨åä»»ä½éå¶ã |
| | | 2.2 æ¨å¯ä»¥å¨æ¨ä¸ªäººææ¨å°±èå
¬å¸ï¼ç»ç»ï¼ä»»ææ°éççµèä¸è¿è¡è¯¥è½¯ä»¶ï¼æä¸å¯¹çµèçæ°éåä»»ä½éå¶ã |
| | | 2.3 æ¨å¯ä»¥å¯¹è¯¥è½¯ä»¶æºä»£ç è¿è¡ä¿®æ¹ä»¥éåºæ¨ä¸ªäººææ¨æå¨å
¬å¸ï¼ç»ç»ï¼ä½¿ç¨çè¦æ±ï¼æ¨åçæ¹å¨æ é对å¤åå¸ã |
| | | 2.4 æ¨ä¸ªäººææ¨å°±èå
¬å¸ï¼ç»ç»ï¼ä½¿ç¨è¯¥è½¯ä»¶æ¶ï¼å¿
é¡»ä¿çè¯¥è½¯ä»¶çæææ å¿ï¼ä¸å¾ä»¥ä»»ä½æ¹å¼éèæé®æ©ä»»ä¸æ å¿ã |
| | | |
| | | (b) You must cause any modified files to carry prominent notices |
| | | stating that You changed the files; and |
| | | ä¸ãä¸ºç¨æ·å®å¶ |
| | | |
| | | (c) You must retain, in the Source form of any Derivative Works |
| | | that You distribute, all copyright, patent, trademark, and |
| | | attribution notices from the Source form of the Work, |
| | | excluding those notices that do not pertain to any part of |
| | | the Derivative Works; and |
| | | 3.1 æ¨å¯ä»¥ä½¿ç¨è¯¥è½¯ä»¶ä¸ºæ¨çç¨æ·é¨ç½²åç§å½¢å¼çåºç¨ï¼æä¸å¯¹åºç¨çæ§è´¨åä»»ä½éå¶ã |
| | | 3.2 æ¨å¯ä»¥ä½¿ç¨è¯¥è½¯ä»¶ä¸ºæ¨çç¨æ·é¨ç½²ä»»ææ°éçåºç¨ï¼æä¸å¯¹åºç¨çæ°éåä»»ä½éå¶ã |
| | | 3.3 æ¨å¯ä»¥å¯¹è¯¥è½¯ä»¶æºä»£ç è¿è¡ä¿®æ¹ä»¥éåºæ¨çç¨æ·çè¦æ±ï¼æ¨åçæ¹å¨æ é对å¤åå¸ã |
| | | 3.4 æ¨å¯¹è¯¥è½¯ä»¶æºä»£ç æåçä¿®æ¹å¯ä»¥æºä»£ç æäºè¿å¶çæ¹å¼æä¾ç»æ¨çç¨æ·ã |
| | | 3.5 æ¨ä½¿ç¨è¯¥è½¯ä»¶ä¸ºæ¨çä»»ä¸ç¨æ·é¨ç½²çä»»ä¸åºç¨é½å¿
é¡»ä¿ç该软件ææçæ å¿ã |
| | | 3.6 æ¨ä½¿ç¨è¯¥è½¯ä»¶ä¸ºæ¨çä»»ä¸ç¨æ·é¨ç½²çä»»ä¸åºç¨é½ä¸å¾ä»¥ä»»ä½æ¹å¼éèæé®æ©è¯¥è½¯ä»¶ä»»ä¸æ å¿ã |
| | | |
| | | (d) If the Work includes a "NOTICE" text file as part of its |
| | | distribution, then any Derivative Works that You distribute must |
| | | include a readable copy of the attribution notices contained |
| | | within such NOTICE file, excluding those notices that do not |
| | | pertain to any part of the Derivative Works, in at least one |
| | | of the following places: within a NOTICE text file distributed |
| | | as part of the Derivative Works; within the Source form or |
| | | documentation, if provided along with the Derivative Works; or, |
| | | within a display generated by the Derivative Works, if and |
| | | wherever such third-party notices normally appear. The contents |
| | | of the NOTICE file are for informational purposes only and |
| | | do not modify the License. You may add Your own attribution |
| | | notices within Derivative Works that You distribute, alongside |
| | | or as an addendum to the NOTICE text from the Work, provided |
| | | that such additional attribution notices cannot be construed |
| | | as modifying the License. |
| | | åãæä¾å¨çº¿æå¡ |
| | | |
| | | You may add Your own copyright statement to Your modifications and |
| | | may provide additional or different license terms and conditions |
| | | for use, reproduction, or distribution of Your modifications, or |
| | | for any such Derivative Works as a whole, provided Your use, |
| | | reproduction, and distribution of the Work otherwise complies with |
| | | the conditions stated in this License. |
| | | 4.1 æ¨å¯ä»¥ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡ï¼ä¸ºæ¨çç¨æ·æä¾æå¡ï¼æä¸å¯¹è¯¥æå¡å该æå¡ç¨æ·çæ§è´¨åä»»ä½éå¶ã |
| | | 4.2 æ¨å¯ä»¥ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡ï¼ä¸ºæ¨çç¨æ·æä¾æå¡ï¼æä¸å¯¹è¯¥æå¡çç¨æ·æ°éåä»»ä½éå¶ã |
| | | 4.3 æ¨å¯ä»¥å¯¹è¯¥è½¯ä»¶æºä»£ç è¿è¡ä¿®æ¹ä»¥éåºå¨çº¿æå¡çè¦æ±ï¼æ¨åçæ¹å¨æ é对å¤åå¸ã |
| | | 4.4 æ¨ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡æ¶ï¼å¿
须以æç¡®çæ¹å¼åç¥æ¨çç¨æ·è¯¥æå¡æ¯åºäºè¯¥è½¯ä»¶æå»ºçã |
| | | 4.5 æ¨ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡ä¸ºæ¨çä»»ä¸ç¨æ·é¨ç½²çä»»ä¸åºç¨å¿
é¡»ä¿ç该软件ææçæ å¿ã |
| | | 4.6 æ¨ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡ä¸ºæ¨çä»»ä¸ç¨æ·é¨ç½²çä»»ä¸åºç¨ä¸å¾ä»¥ä»»ä½æ¹å¼éèæé®æ©è¯¥è½¯ä»¶ä»»ä¸æ å¿ã |
| | | 4.7 æ¨ä½¿ç¨è¯¥è½¯ä»¶æå»ºå¨çº¿æå¡æ¶ï¼ä¸å¾ä¸ºæ¨çç¨æ·æä¾å»é¤ãéèæé®æ©è¯¥è½¯ä»¶ä»»ä¸æ å¿çåè½ã |
| | | |
| | | 5. Submission of Contributions. Unless You explicitly state otherwise, |
| | | any Contribution intentionally submitted for inclusion in the Work |
| | | by You to the Licensor shall be under the terms and conditions of |
| | | this License, without any additional terms or conditions. |
| | | Notwithstanding the above, nothing herein shall supersede or modify |
| | | the terms of any separate license agreement you may have executed |
| | | with Licensor regarding such Contributions. |
| | | äºãæ æ¹å¨å叿éæè¯¥è½¯ä»¶ |
| | | |
| | | 6. Trademarks. This License does not grant permission to use the trade |
| | | names, trademarks, service marks, or product names of the Licensor, |
| | | except as required for reasonable and customary use in describing the |
| | | origin of the Work and reproducing the content of the NOTICE file. |
| | | 5.1 ææ¬¢è¿å¹¶æè°¢æ¨å°è¯¥è½¯ä»¶åå¸å¨æ¨ç个人ç½ç«ãä¼ä¸å®ç½æè
å
¶ä»çç¬¬ä¸æ¹ç½ç«ã |
| | | 5.2 ææ¬¢è¿å¹¶æè°¢æ¨å°è¯¥è½¯ä»¶éæå¨å
¶ä»ç³»ç»ä¸ä¸èµ·åå¸ï¼æ¯å¦äºæå¡éåãæä½ç³»ç»åè¡ççã |
| | | 5.3 æ¨å¨å叿è
éæè¯¥è½¯ä»¶çæ¶åï¼ä¸å¾å¯¹è¯¥è½¯ä»¶æºç å任使¹å¨ã |
| | | 5.4 æ¨å¨å叿è
éæè¯¥è½¯ä»¶çæ¶åï¼é¡»ä¿çè¯¥è½¯ä»¶çæææ å¿ã |
| | | |
| | | 7. Disclaimer of Warranty. Unless required by applicable law or |
| | | agreed to in writing, Licensor provides the Work (and each |
| | | Contributor provides its Contributions) on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| | | implied, including, without limitation, any warranties or conditions |
| | | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A |
| | | PARTICULAR PURPOSE. You are solely responsible for determining the |
| | | appropriateness of using or redistributing the Work and assume any |
| | | risks associated with Your exercise of permissions under this License. |
| | | å
ãåå¸åºäºè¯¥è½¯ä»¶çè¡çä½å |
| | | |
| | | 8. Limitation of Liability. In no event and under no legal theory, |
| | | whether in tort (including negligence), contract, or otherwise, |
| | | unless required by applicable law (such as deliberate and grossly |
| | | negligent acts) or agreed to in writing, shall any Contributor be |
| | | liable to You for damages, including any direct, indirect, special, |
| | | incidental, or consequential damages of any character arising as a |
| | | result of this License or out of the use or inability to use the |
| | | Work (including but not limited to damages for loss of goodwill, |
| | | work stoppage, computer failure or malfunction, or any and all |
| | | other commercial damages or losses), even if such Contributor |
| | | has been advised of the possibility of such damages. |
| | | 6.1 ææ¬¢è¿å¹¶æè°¢æ¨ä¸ºè¯¥è½¯ä»¶å¼åè¡çä½åã |
| | | 6.2 æ¨å¼åçè¡çä½å䏿¶åå°å¯¹è¯¥è½¯ä»¶æºä»£ç æ¹å¨çå°æ¹ï¼é¡»éµå¾ªå¦ä¸æ¡æ¬¾ï¼ |
| | | |
| | | 9. Accepting Warranty or Additional Liability. While redistributing |
| | | the Work or Derivative Works thereof, You may choose to offer, |
| | | and charge a fee for, acceptance of support, warranty, indemnity, |
| | | or other liability obligations and/or rights consistent with this |
| | | License. However, in accepting such obligations, You may act only |
| | | on Your own behalf and on Your sole responsibility, not on behalf |
| | | of any other Contributor, and only if You agree to indemnify, |
| | | defend, and hold each Contributor harmless for any liability |
| | | incurred by, or claims asserted against, such Contributor by reason |
| | | of your accepting any such warranty or additional liability. |
| | | 6.2.1 å¦ä¿®æ¹äºè¯¥è½¯ä»¶çæºä»£ç ï¼é¡»ä¾æ®æ¬åè®®åå¸ä¿®æ¹åçæºä»£ç ã |
| | | 6.2.2 å¦ä¿®æ¹äºè¯¥è½¯ä»¶çæºä»£ç ï¼é¡»ä¿ç代ç éé¢è¯¥è½¯ä»¶åæçæææ å¿ã |
| | | 6.2.3 æ¨å¯ä»¥å¨ä»£ç ä¸è¿½å æ¨èªå·±çæ å¿ã |
| | | 6.2.4 æ¨å¯ä»¥å¯¹æ¨å¼åçè¡çä½åè¿è¡æ¶è´¹ã |
| | | 6.2.5 ç¬¬ä¸æ¹çç¨æ·å¯å¨éµå¾ª6.2æææ¡æ¬¾ä¸å¯ç»§ç»å¨æ¨å¼åçè¡çä½ååºç¡ä¸è¿è¡ä¿®æ¹å¹¶åå¸ã |
| | | |
| | | END OF TERMS AND CONDITIONS |
| | | 6.3 æ¨å¼åçè¡çä½åä¸ç¬ç«äºæ¬è½¯ä»¶å¼åç代ç ï¼å¯ä»¥æºä»£ç æäºè¿å¶çæ¹å¼è¿è¡åå¸ï¼å¯å
è´¹ææ¶è´¹åå¸ã |
| | | 6.4 æ¨å¼åçè¡çä½åä¸å¾ä»¥ä»»ä½æ¹å¼å»é¤ãéèæé®æ©è¯¥è½¯ä»¶ç任䏿 å¿ã |
| | | |
| | | APPENDIX: How to apply the Apache License to your work. |
| | | ä¸ãåå¸åºäºè¯¥è½¯ä»¶APIçåºç¨ |
| | | |
| | | To apply the Apache License to your work, attach the following |
| | | boilerplate notice, with the fields enclosed by brackets "[]" |
| | | replaced with your own identifying information. (Don't include |
| | | the brackets!) The text should be enclosed in the appropriate |
| | | comment syntax for the file format. We also recommend that a |
| | | file or class name and description of purpose be included on the |
| | | same "printed page" as the copyright notice for easier |
| | | identification within third-party archives. |
| | | 7.1 ææ¬¢è¿å¹¶æè°¢æ¨ä¸ºè¯¥è½¯ä»¶å¼ååºäºAPIçåç§åºç¨ï¼æ¯å¦å®¢æ·ç«¯è½¯ä»¶çã |
| | | 7.2 æ¨åºäºè¯¥è½¯ä»¶APIæºå¶å¼åçåºç¨ï¼å¯ä»¥æºä»£ç æè
äºè¿å¶çæ¹å¼è¿è¡åå¸ï¼æå¯¹æ¤æ²¡æä»»ä½éå¶ã |
| | | 7.3 æ¨åºäºè¯¥è½¯ä»¶APIæºå¶å¼åçåºç¨ï¼ææåè®®å¯ä»¥èªè¡çº¦å®ï¼æå¯¹æ¤æ²¡æä»»ä½éå¶ã |
| | | 7.4 æ¨åºäºè¯¥è½¯ä»¶APIæºå¶å¼åçåºç¨ï¼å¯ä»¥å
è´¹æè
æ¶è´¹åå¸ï¼æå¯¹æ¤æ²¡æä»»ä½éå¶ã |
| | | |
| | | Copyright [yyyy] [name of copyright owner] |
| | | å
«ãææä¾å¤ |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | 妿ä¸è¿°æ¡æ¬¾æ æ³æ»¡è¶³æ¨ä½¿ç¨è¯¥è½¯ä»¶çè¦æ±ï¼å¯èç³»æç¾ç½²é¢å¤çåå以è·å¾æ´çµæ´»çææè®¸å¯ã |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | ä¹ãåå约æ |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | | 9.1 妿æ¨è¿åäºè¯¥åè®®ç任䏿¡æ¬¾ï¼è¯¥ææåè®®å°èªå¨ç»æ¢ï¼æä¿çéè¿æ³å¾ææ®µè¿½ç©¶è´£ä»»çæå©ã |
| | |
| | | </div> |
| | | <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">æºç¢³è½æºç®¡çç³»ç»</h1> |
| | | <p align="center">åºäºSpringBootåè¥ä¾æ¡æ¶å¼å</p> |
| | | <p align="center">è½ç¢³å¹³å°åå°å±ç¤º&æ¥å£å·²å®å
¨å¼æºï¼ä»£ç å®å¤ï¼åè½é½å
¨ï¼è¿è¡æ£å¸¸</p> |
| | | <p align="center"><span style="color: red;">éè¿æ¬é¡¹ç®ï¼å¦ä¹ è
å¯ä»¥ææ¡è½æºç®¡çè¡ä¸çåè½åä¸å¡ï¼ä»¥åææ¯æ¶æã</span></p> |
| | | |
| | | <p align="center"> |
| | | <a href='https://gitee.com/ustcyc/zhitan-ems/stargazers'><img src='https://gitee.com/ustcyc/zhitan-ems/badge/star.svg?theme=dark' alt='star'></img></a> |
| | | <a href='https://gitee.com/ustcyc/zhitan-ems/members'><img src='https://gitee.com/ustcyc/zhitan-ems/badge/fork.svg?theme=dark' alt='fork'></img></a> |
| | | <a href='https://gitee.com/liulingling1993/zhitan-ems/stargazers'><img src='https://gitee.com/liulingling1993/zhitan-ems/badge/star.svg?theme=dark' alt='star'></img></a> |
| | | <a href='https://gitee.com/liulingling1993/zhitan-ems/members'><img src='https://gitee.com/liulingling1993/zhitan-ems/badge/fork.svg?theme=dark' alt='fork'></img></a> |
| | | </p> |
| | | |
| | | ## ä»ç» |
| | |
| | | |
| | | é对客æ·åºæ¯ï¼æ¿åºãååºãä¼ä¸ãå·¥ç¿ãå
Œ
±å»ºççã |
| | | |
| | | ## ãæ³¨æã宿´è½ç¢³ç®¡çå¹³å°å
å«ä¸ä¸ªé¨åï¼<span style="color: red;">æ¬ä»åºåªå
å«è½ç¢³å¹³å°åå°ç®¡ç端</span> |
| | | 1. è½ç¢³å¹³å°åå°ç®¡ç端ï¼<span style="color: red;">ä¹å³æ¬é¡¹ç®è½ç¢³å¹³å°åå°å±ç¤ºé¨åï¼ä»£ç å®å¤ï¼è¿è¡æ£å¸¸ãéè¿æ¬é¡¹ç®ï¼å¦ä¹ è
å¯ä»¥ææ¡è½æºç®¡çè¡ä¸çåè½åä¸å¡ï¼ä»¥åææ¯æ¶æã</span> |
| | | 2. æ°æ®ééç¨åºï¼ä¹å³mqttâ¡ï¸æ¶åºåºåè½ï¼è¯·åè[æä»¬å¦ä¸ä¸ªä»åºï¼ç¹å»è¶
龿¥ï¼ï¼MQTTééç½å
³](https://github.com/zhitan-cloud/zhitan-gateway)ï¼æè
å¯åèthingsjsçç¥å项ç®ï¼æè
èªå·±ç¨nettyèªå·±å®ç°ã |
| | | 3. æ°æ®æ¸
æ´æå¡ï¼ä¹å³æ¶åºåºâ¡ï¸å
³ç³»åºï¼å¦ä¹ è
å¯ä»¥ä½¿ç¨javaèªå¸¦çXXL jobç计åä»»å¡å·¥å
·èªå·±æç
§ä¸å¡åè½ï¼æ¥å®ç°æ°æ®æ¸
æ´æå¡ã |
| | | |
| | | å¢å
ä»åºå°åï¼ç äºï¼ï¼https://gitee.com/ustcyc/zhitan-ems |
| | | |
| | | å·²åæ¥æ´æ°å°githubä»åºï¼https://github.com/Andy-Yin/zhitan-ems |
| | | ## ææ¡£--åå¨wikiç®å½ |
| | | ### github wikiå°åï¼https://github.com/zhitan-cloud/zhitan-ems/wiki |
| | | ### gitee wikiå°åï¼https://gitee.com/liulingling1993/zhitan-ems/wikis/ |
| | | |
| | | |
| | | ## å¨çº¿ä½éª |
| | | |
| | | - guestUser/guest@123456 |
| | | #### guestUser/guest@123456 |
| | | #### æ¼ç¤ºå°åï¼https://demo-ems.zhitancloud.com/ |
| | | |
| | | æ¼ç¤ºå°åï¼https://demo-ems.zhitancloud.com/ |
| | | ## 弿ºåè®® |
| | | zhitan-emsæ¯åºäº [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html) å [ZTPL](./LICENSE) ååè®®ç弿ºè½¯ä»¶ã |
| | | |
| | | ## 社åºç-åè½å表 |
| | | 1. é¦é¡µçæ¿ **已宿** |
| | | 2. 宿¶æ°æ®çæµ **已宿** |
| | | 2.1. 宿¶æ°æ®æ¥ç **已宿** |
| | | 2.2. ç»æå¾åæï¼svg å¾ç»å®ï¼**已宿** |
| | | 3. åå²ç¹ä½åæ **已宿** |
| | | 4. ç»¼åææ åæ **已宿** |
| | | 4.1. ç»¼åææ åæï¼æ¥ï¼**已宿** |
| | | 4.2. ç»¼åææ åæï¼æï¼**已宿** |
| | | 4.3. ç»¼åææ åæï¼å¹´ï¼**已宿** |
| | | 5. éç¹è®¾å¤åæ **已宿** |
| | | 5.1. éç¹è®¾å¤åæï¼æ¥ï¼**已宿** |
| | | 5.2. éç¹è®¾å¤åæï¼æï¼**已宿** |
| | | 5.3. éç¹è®¾å¤åæï¼å¹´ï¼**已宿** |
| | | 6. å·¥åºè½èåæ **已宿** |
| | | 6.1. å·¥åºè½èåæï¼æ¥ï¼**已宿** |
| | | 6.2. å·¥åºè½èåæï¼æï¼**已宿** |
| | | 6.3. å·¥åºè½èåæï¼å¹´ï¼**已宿** |
| | | 7. å°å³°å¹³è°·åæ **已宿** |
| | | 7.1. å°å³°å¹³è°·é
ç½® **已宿** |
| | | 7.2. å°å³°å¹³è°·æ°æ® **已宿** |
| | | 8. è½è对æ¯åæï¼åè½æºåç§ï¼**已宿** |
| | | 8.1. çµåç¯æ¯åæ **已宿** |
| | | 8.2. æ°´åç¯æ¯åæ **已宿** |
| | | 8.3. å
¶ä»è½æºåç§åæ **已宿** |
| | | 9. æºè½æ¥è¦ **已宿** |
| | | 9.1. æ¥è¦åæ **已宿** |
| | | 9.2. æ¥è¦é
ç½® **已宿** |
| | | 10. æ°æ®è¡¥å½ **已宿** |
| | | 11. èè½é¡¹ç®ç®¡ç **已宿** |
| | | 12. ç¥è¯åº **已宿** |
| | | 13. è®¾å¤æ¡£æ¡ç®¡ç **已宿** |
| | | 14. 模åé
置管çï¼è®¡ç®æ¨¡åçï¼ **已宿** |
| | | 15. åºç¡æ°æ®ç®¡çï¼åå
¸ãè½æºç±»åçï¼ **已宿** |
| | | 16. ç³»ç»ç®¡çï¼ç¨æ·ãè§è²ãæéçï¼ **已宿** |
| | | 17. 建çè½èåæï¼æ¯è·¯ãåé¡¹ï¼ **已宿** |
| | | |
| | | ## å¢å¼ºç-åè½å表 |
| | | 1. åèåæ |
| | | 2. 计åä¸å®ç»© |
| | | 3. ç¨è½èæ ¸ |
| | | 4. ç¨è½å¯¹æ |
| | | 5. 建çè½è空è°èè½ |
| | | 6. è½æºå¹³è¡¡åæ |
| | | 7. è½æºå¯¹æ åæ |
| | | 8. ç©ºåæºéç¹è®¾å¤èè½å
容 |
| | | 9. ç¢³çæ¥ã碳路å¾ãç¢³ææ¾å åå åç¸å
³å
容 |
| | | 10. æºç½è·å¨ï¼å¾®çµç½ï¼ç¸å
³åè½ |
| | | 11. ä½ç¢³ååºç¸å
³ |
| | | 12. èªå®ä¹æ¥è¡¨ |
| | | 13. è½æºææ¬åæ |
| | | 14. å
ä¼è¿ç»´çæ§ |
| | | 15. å
çµè¿è¥å¹³å° |
| | | |
| | | |
| | | |
| | | ## æ¡æ¶ï¼ |
| | |
| | | VUEçæ¬ï¼VUE 3 |
| | | |
| | | ## ç¹è²ï¼æ°æ®é©±å¨çè®¡ç®æ¨¡ååä¸å¡æ¨¡åé
ç½® |
| | | 1. æ¯æå¨æç¹ä½é
ç½®ã |
| | | 1. ç²¾å¿è®¾è®¡çå±ç¤ºçé¢ã |
| | |  |
| | | 2. æ¯æå¨æç¹ä½é
ç½®ã |
| | |  |
| | | 2. æ¯æè®¡ç®å
¬å¼ã |
| | |  |
| | |
| | | |
| | | ## 亮ç¹åè½ |
| | |  |
| | | |
| | | ## åè½å表 |
| | | 1. é¦é¡µçæ¿ |
| | | 2. 宿¶æ°æ®çæµ |
| | | 2.1. 宿¶æ°æ®æ¥ç |
| | | 2.2. ç»æå¾åæï¼svg å¾ç»å®ï¼ |
| | | 3. åå²ç¹ä½åæ |
| | | 4. ç»¼åææ åæ |
| | | 4.1. ç»¼åææ åæï¼æ¥ï¼ |
| | | 4.2. ç»¼åææ åæï¼æï¼ |
| | | 4.3. ç»¼åææ åæï¼å¹´ï¼ |
| | | 5. éç¹è®¾å¤åæ |
| | | 5.1. éç¹è®¾å¤åæï¼æ¥ï¼ |
| | | 5.2. éç¹è®¾å¤åæï¼æï¼ |
| | | 5.3. éç¹è®¾å¤åæï¼å¹´ï¼ |
| | | 6. å·¥åºè½èåæ |
| | | 6.1. å·¥åºè½èåæï¼æ¥ï¼ |
| | | 6.2. å·¥åºè½èåæï¼æï¼ |
| | | 6.3. å·¥åºè½èåæï¼å¹´ï¼ |
| | | 7. å°å³°å¹³è°·åæ |
| | | 7.1. å°å³°å¹³è°·é
ç½® |
| | | 7.2. å°å³°å¹³è°·æ°æ® |
| | | 8. è½è对æ¯åæï¼åè½æºåç§ï¼ |
| | | 8.1. çµåç¯æ¯åæ |
| | | 8.2. æ°´åç¯æ¯åæ |
| | | 8.3. å
¶ä»è½æºåç§åæ |
| | | 9. æºè½æ¥è¦ |
| | | 9.1. æ¥è¦åæ |
| | | 9.2. æ¥è¦é
ç½® |
| | | 10. åèåæ |
| | | 11. 计åä¸å®ç»© |
| | | 12. ç¨è½èæ ¸ |
| | | 13. ç¨è½å¯¹æ |
| | | 14. æ°æ®è¡¥å½ |
| | | 15. èè½é¡¹ç®ç®¡ç |
| | | 16. è½æºå¹³è¡¡åæ |
| | | 17. è½æºå¯¹æ åæ |
| | | 18. 模åé
置管çï¼è®¡ç®æ¨¡åçï¼ |
| | | 19. åºç¡æ°æ®ç®¡çï¼åå
¸ãè½æºç±»åçï¼ |
| | | 20. ç³»ç»ç®¡çï¼ç¨æ·ãè§è²ãæéçï¼ |
| | | |
| | | ## UIå±ç¤ºï¼å¹³å°åæ·±è²åæµ
è²ä¸¤ç§é£æ ¼åæ¢ï¼ |
| | | |
| | |
| | | |
| | | ## æ²éäº¤æµ |
| | | |
| | | æ«ç æ·»å 微信交æµï¼å å¾®ä¿¡è¯·å¤æ³¨ï¼emsã |
| | | |
| | | åºå¾å¤å¼åè
ç§ä¿¡ï¼æå建äºQQ群交æµï¼ç¾¤å·ï¼ï¼è¯·å¤æ³¨ï¼ems+å§åã |
| | | <p align="center"> |
| | | <img src="readme/img/image.png" width=50% height=50%> |
| | | <img src="readme/img/qq.png" width=50% height=50%> |
| | | </p> |
| | | |
| | | æ«ç æ·»å 微信交æµï¼å å¾®ä¿¡è¯·å¤æ³¨ï¼ems+å§åã |
| | | |
| | | <p align="center"> |
| | | <img src="readme/img/image-yc.png" width=50% height=50%> |
| | | </p> |
| | | |
| | | ## åä¸è´¡ç® |
| | | |
| | | 1. Fork æ¬ä»åº |
| | | 2. æ°å»º Feat_xxx 忝 |
| | | 3. æäº¤ä»£ç |
| | | 4. æ°å»º Pull Request |
| | | 4. æ°å»º Pull Request |
ÎļþÃû´Ó zhitan-admin/src/main/java/com/zhitan/web/controller/alarm/AlarmAnalyisisController.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.zhitan.alarm.domain.dto.AlarmAnalysisDTO; |
| | | import com.zhitan.alarm.domain.vo.AlarmAnalysisVO; |
| | | import com.zhitan.alarm.services.IAlarmAnalyisisService; |
| | | import com.zhitan.alarm.services.IAlarmAnalysisService; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | geng * description æ¥è¦åæç¸å
³åè½ |
| | | * description æ¥è¦åæç¸å
³åè½ |
| | | * |
| | | * @author hmj |
| | | * @date 2024-10-26 17:31 |
| | | * @author zhitan |
| | | * @date |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/alarmAnalysis") |
| | | public class AlarmAnalyisisController extends BaseController { |
| | | public class AlarmAnalysisController extends BaseController { |
| | | @Autowired |
| | | private IAlarmAnalyisisService alarmAnalyisisService; |
| | | private IAlarmAnalysisService alarmAnalysisService; |
| | | |
| | | @GetMapping("/getByNodeId") |
| | | public AjaxResult getByNodeId(@Validated AlarmAnalysisDTO alarmAnalysisDTO){ |
| | | AlarmAnalysisVO alarmAnalysisVO = alarmAnalyisisService.getByNodeId(alarmAnalysisDTO); |
| | | AlarmAnalysisVO alarmAnalysisVO = alarmAnalysisService.getByNodeId(alarmAnalysisDTO); |
| | | return AjaxResult.success(alarmAnalysisVO); |
| | | } |
| | | |
| | | @GetMapping("/getCountInfo") |
| | | public AjaxResult getCountInfo(@Validated AlarmAnalysisDTO alarmAnalysisDTO){ |
| | | AlarmAnalysisVO alarmAnalysisVO = alarmAnalyisisService.getCountInfo(alarmAnalysisDTO); |
| | | |
| | | if(ObjectUtils.isEmpty(alarmAnalysisDTO.getModelCode())){ |
| | | return AjaxResult.error("模åç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | AlarmAnalysisVO alarmAnalysisVO = alarmAnalysisService.getCountInfo(alarmAnalysisDTO); |
| | | return AjaxResult.success(alarmAnalysisVO); |
| | | } |
| | | } |
| | |
| | | import com.zhitan.common.enums.BusinessType; |
| | | import com.zhitan.common.utils.poi.ExcelUtil; |
| | | import com.zhitan.framework.web.service.TokenService; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.realtimedata.domain.TagValue; |
| | | import com.zhitan.realtimedata.service.RealtimeDatabaseService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public class HistoryAlarmController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IHistoryAlarmService iHistoryAlarmService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | private IHistoryAlarmService historyAlarmService; |
| | | |
| | | @Autowired |
| | | private RealtimeDatabaseService realtimeDatabaseService; |
| | |
| | | * å岿¥è¦ é¡µé¢ æ ¹æ® èç¹ç®å½å æ¡ä»¶æ¥è¯¢ |
| | | */ |
| | | @ApiOperation("å岿¥è¦æ¥è¯¢") |
| | | // @PreAuthorize("@ss.hasPermi('energyAlarm:historicalAlarm:list')") |
| | | @PreAuthorize("@ss.hasPermi('energyAlarm:historicalAlarm:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(JkHistoryAlarm jkHistoryAlarm,Long pageNum,Long pageSize) |
| | | public TableDataInfo list(JkHistoryAlarm jkHistoryAlarm) |
| | | { |
| | | Page<JkHistoryAlarm> list = iHistoryAlarmService.selectJkHistoryAlarmPage(jkHistoryAlarm,pageNum,pageSize); |
| | | return getDataTable(list); |
| | | return getDataTable(historyAlarmService.selectHistoryAlarmPageList(jkHistoryAlarm)); |
| | | } |
| | | /** |
| | | * 导åºå岿¥è¦çæ§å表 |
| | |
| | | @GetMapping("/export") |
| | | public AjaxResult export(JkHistoryAlarm jkHistoryAlarm) |
| | | { |
| | | List<JkHistoryAlarm> list = iHistoryAlarmService.selectJkHistoryAlarmListExcel(jkHistoryAlarm); |
| | | List<JkHistoryAlarm> list = historyAlarmService.selectJkHistoryAlarmListExcel(jkHistoryAlarm); |
| | | ExcelUtil<JkHistoryAlarm> util = new ExcelUtil<JkHistoryAlarm>(JkHistoryAlarm.class); |
| | | return util.exportExcel(list, "alarm"); |
| | | } |
| | |
| | | public TableDataInfo listNote(JkHistoryAlarm jkHistoryAlarm) |
| | | { |
| | | startPage(); |
| | | List<JkHistoryAlarm> list = iHistoryAlarmService.selectHistoryAlarmNoteList(jkHistoryAlarm); |
| | | List<JkHistoryAlarm> list = historyAlarmService.selectHistoryAlarmNoteList(jkHistoryAlarm); |
| | | return getDataTable(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.branchanalysis; |
| | | |
| | | import com.zhitan.branchanalysis.domain.BranchAnalysisVO; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.branchanalysis.service.IBranchAnalysisService; |
| | | |
| | | import com.zhitan.realtimedata.domain.dto.BranchAnalysisDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | *æ¯è·¯ç¨è½åæ |
| | | * |
| | | * @author zt |
| | | * @date 2025-03-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/branchanalysis") |
| | | @Api(value = "æ¯è·¯ç¨è½è½èç»è®¡",tags = {"æ¯è·¯ç¨è½åæ"}) |
| | | public class BranchEnergyAnalysisController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IBranchAnalysisService branchAnalysisService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "æ¯è·¯ç¨è½è½èç»è®¡å表") |
| | | public AjaxResult list(BranchAnalysisDTO dataItem) { |
| | | BranchAnalysisVO vo = branchAnalysisService.getBranchAnalysisService(dataItem); |
| | | return success(vo); |
| | | } |
| | | } |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æé¦è½æºæ°æ®ç»¼ååæ |
| | | * è½æºæ°æ®ç»¼ååæ |
| | | * |
| | | * @author ZhiTan |
| | | * @date 2024-10-30 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.itemizedenergyanalysis; |
| | | |
| | | import com.zhitan.Itemizedenergyanalysis.domain.VO.ItemizedEnergyAnalysisVO; |
| | | import com.zhitan.Itemizedenergyanalysis.dto.ItemizedEnergyAnalysisDTO; |
| | | import com.zhitan.Itemizedenergyanalysis.service.IItemizedEnergyAnalysisService; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import static com.zhitan.common.core.domain.AjaxResult.success; |
| | | |
| | | /** |
| | | * å项ç¨è½åæ æ¥å£ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/itemizedEnergyAnalysis") |
| | | @Api(value = "å项ç¨è½åæ", tags = {"å项ç¨è½åæ"}) |
| | | public class ItemizedEnergyAnalysisController { |
| | | |
| | | @Autowired |
| | | private IItemizedEnergyAnalysisService itemizedEnergyAnalysisService; |
| | | |
| | | /** |
| | | * |
| | | * @param dataItem |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | private AjaxResult list(ItemizedEnergyAnalysisDTO dataItem) { |
| | | ItemizedEnergyAnalysisVO list = itemizedEnergyAnalysisService.getItemizedEnergyAnalysisService(dataItem); |
| | | return success(list); |
| | | } |
| | | } |
| | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.common.core.page.TableDataInfo; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import com.zhitan.keyequipment.service.IDailyKeyEquipmentService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èåæï¼æ¥ï¼å表") |
| | | public TableDataInfo list(DataItem dataItem) throws ParseException { |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | List<DailyKeyEquipment> dataList=new ArrayList<>(); |
| | |
| | | dataList.add(report); |
| | | i++; |
| | | }; |
| | | startPage(); |
| | | |
| | | List<DailyKeyEquipment> list = dailykeyEquipment.getdailyKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return getDataTable(list); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | |
| | | } |
| | | /*ææè®¾å¤*/ |
| | | @GetMapping("/getFacilityArchives") |
| | | @ApiOperation(value = "æ¥è¯¢ææè®¾å¤å表") |
| | | @ApiOperation(value = "æ¥è¯¢éç¹è®¾å¤å表") |
| | | public AjaxResult getFacilityArchives() { |
| | | try { |
| | | List<FacilityArchives> list=dailykeyEquipment.getFacilityArchives(); |
| | |
| | | package com.zhitan.web.controller.keyequipment; |
| | | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ |
| | | * éç¹è®¾å¤è½èç»è®¡ æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/keyEquipment/MonthlyKeyEquipment") |
| | | @Api(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼",tags = {"设å¤åèåæ"}) |
| | | @Api(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼", tags = {"设å¤åèåæ"}) |
| | | public class MonthlyKeyEquipmentController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼å表") |
| | | public AjaxResult list(DataItem dataItem) { |
| | | try { |
| | | List<MonthlyKeyEquipment> dataList=new ArrayList<>(); |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<MonthlyKeyEquipment> dataList = new ArrayList<>(); |
| | | |
| | | Map tableColumn =new HashMap<>();//è¡¨æ°æ® |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 1; |
| | | String beginTime=aa+"-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime=aa+"-"+Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))+" 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i <= Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))) { |
| | | if(i>9){ |
| | | bb=aa+"-"+i+" 00:00:00"; |
| | | }else{ |
| | | bb=aa+"-0"+i+" 00:00:00"; |
| | | } |
| | | MonthlyKeyEquipment report=new MonthlyKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | tableColumn.put("value"+i,String.valueOf(i)+"æ¥"); |
| | | i++; |
| | | Map tableColumn = new HashMap<>();//è¡¨æ°æ® |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String bb = ""; |
| | | int i = 1; |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i <= Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2))) { |
| | | if (i > 9) { |
| | | bb = aa + "-" + i + " 00:00:00"; |
| | | } else { |
| | | bb = aa + "-0" + i + " 00:00:00"; |
| | | } |
| | | List<Map> table=new ArrayList<>(); |
| | | MonthlyKeyEquipment reportList =new MonthlyKeyEquipment(); |
| | | table.add(tableColumn); |
| | | reportList.setTablehead(table); |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return AjaxResult.success(reportList); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return AjaxResult.success(reportList); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | startPage(); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getMonthlyKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | int count=Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2)); |
| | | list.forEach(monthlyReport -> monthlyReport.setCount(count)); |
| | | reportList.setTabledata(list); |
| | | reportList.setTotal(new PageInfo(list).getTotal()); |
| | | |
| | | return AjaxResult.success(reportList); |
| | | } catch (Exception ex) { |
| | | logger.error("è·ååºéï¼", ex); |
| | | return AjaxResult.error("è·ååºé!"); |
| | | MonthlyKeyEquipment report = new MonthlyKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value" + i); |
| | | dataList.add(report); |
| | | tableColumn.put("value" + i, String.valueOf(i) + "æ¥"); |
| | | i++; |
| | | } |
| | | List<Map> table = new ArrayList<>(); |
| | | MonthlyKeyEquipment reportList = new MonthlyKeyEquipment(); |
| | | table.add(tableColumn); |
| | | reportList.setTablehead(table); |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if (CollectionUtils.isEmpty(nodeId)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if (CollectionUtils.isEmpty(energyList)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getMonthlyKeyEquipmentList(indexIds, dataList, dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | |
| | | public AjaxResult listChart(DataItem dataItem) throws ParseException { |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String beginTime=aa+"-01 00:00:00"; |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime=aa+"-"+Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))+" 00:00:00"; |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getListChart(dataItem.getIndexId(), dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | public static String getLastDayOfMonth(String yearMonth) { |
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); //å¹´ |
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); //æ |
| | |
| | | package com.zhitan.web.controller.keyequipment; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.common.core.page.TableDataInfo; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.keyequipment.service.IYearKeyEquipmentService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å表") |
| | | public TableDataInfo list(DataItem dataItem) throws ParseException { |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | List<YearKeyEquipment> dataList=new ArrayList<>(); |
| | | |
| | | dataItem.setBeginTime(DateUtil.beginOfYear(dataItem.getDataTime())); |
| | | dataItem.setEndTime(DateUtil.endOfYear(dataItem.getDataTime())); |
| | | |
| | | DateFormat df = new SimpleDateFormat("yyyy"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 1; |
| | | while (i <= 12) { |
| | | if(i>9){ |
| | | bb=aa+"-"+i+"-01 00:00:00"; |
| | | }else{ |
| | | bb=aa+"-0"+i+"-01 00:00:00"; |
| | | } |
| | | YearKeyEquipment report=new YearKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | i++; |
| | | } |
| | | startPage(); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getYearKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return getDataTable(list); |
| | | Date convertTime = DateTimeUtil.getEndTimeByType(dataItem.getTimeType(),dataItem.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | List<TypeTime> typeTimeList = DateTimeUtil.getDateTimeList(dataItem.getTimeType(),convertTime); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getYearKeyEquipmentList(indexIds, typeTimeList,beginTime,endTime, dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItem dataItem){ |
| | | public AjaxResult listChart(DataItemQueryDTO queryDto){ |
| | | |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getListChart(queryDto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | import com.zhitan.common.utils.poi.ExcelUtil; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.EnergyIndexQuery; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.service.IEnergyIndexService; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * ææ ä¿¡æ¯Controller |
| | |
| | | @RequestMapping("/basicsetting/energyindex") |
| | | public class EnergyIndexController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IEnergyIndexService energyIndexService; |
| | | @Autowired |
| | | private IEnergyIndexService energyIndexService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EnergyIndex energyIndex, @RequestParam Long pageNum, @RequestParam Long pageSize) { |
| | | EnergyIndexQuery query = new EnergyIndexQuery(energyIndex.getNodeId(), energyIndex.getName(), |
| | | energyIndex.getIndexCategory(), energyIndex.getIndexType()); |
| | | Page<EnergyIndex> list = energyIndexService.selectEnergyIndexPage(query,pageNum,pageSize); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/filter") |
| | | public AjaxResult filter(EnergyIndexQuery query) { |
| | | List<EnergyIndex> list = energyIndexService.selectEnergyIndexList(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping("/collectIndex") |
| | | public TableDataInfo listCollectIndex(String deviceId) { |
| | | startPage(); |
| | | List<EnergyIndex> list = energyIndexService.selectCollectIndex(deviceId); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºææ ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:export')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(EnergyIndex energyIndex) { |
| | | List<EnergyIndex> list = energyIndexService.selectEnergyIndexList(energyIndex); |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | return util.exportExcel(list, "energyindex"); |
| | | } |
| | | |
| | | /** |
| | | * è·åææ ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping(value = "/{indexId}") |
| | | public AjaxResult getInfo(@PathVariable("indexId") String indexId) { |
| | | return AjaxResult.success(energyIndexService.selectEnergyIndexById(indexId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:add')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping(value = "/{nodeId}") |
| | | public AjaxResult add(@PathVariable("nodeId") String nodeId, |
| | | @RequestBody EnergyIndex energyIndex) { |
| | | boolean isExist = energyIndexService.energyIndexHasExist(energyIndex.getCode()); |
| | | if (isExist) { |
| | | return AjaxResult.error("ææ ç¼ç ä¸è½éå¤ï¼"); |
| | | } else { |
| | | energyIndex.setIndexId(UUID.randomUUID().toString()); |
| | | energyIndexService.insertEnergyIndex(nodeId, energyIndex); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:edit')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody EnergyIndex energyIndex) { |
| | | boolean isExist = energyIndexService |
| | | .energyIndexHasExist(energyIndex.getIndexId(), energyIndex.getCode()); |
| | | if (isExist) { |
| | | return AjaxResult.error("ææ ç¼ç ä¸è½éå¤ï¼"); |
| | | } else { |
| | | return toAjax(energyIndexService.updateEnergyIndex(energyIndex)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å 餿æ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:remove')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{nodeId}/{indexIds}") |
| | | public AjaxResult remove(@PathVariable String nodeId, @PathVariable String[] indexIds) { |
| | | List<EnergyIndex> energyIndexList = energyIndexService.getEnergyIndexByIds( |
| | | Arrays.asList(indexIds)); |
| | | List<String> deleteIds = energyIndexList.stream() |
| | | .filter(f -> StringUtils.isBlank(f.getMeterId())) |
| | | .map(EnergyIndex::getIndexId) |
| | | .collect(Collectors.toList()); |
| | | /** |
| | | * å¤çè½æºææ å表并çæéè¦ç§»é¤çææ IDéå |
| | | * 1. è¿æ»¤åºmeterIdé空çè½æºææ 对象 |
| | | * 2. æåè¿äºå¯¹è±¡çindexIdåæ®µ |
| | | * 3. å°æåçææ IDæ¶éå°å符串éåä¸ |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | List<String> removeLink = energyIndexList.stream() |
| | | .filter(f -> StringUtils.isNotBlank(f.getMeterId())) |
| | | .map(EnergyIndex::getIndexId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if (!removeLink.isEmpty()) { |
| | | energyIndexService.removeNodeIndex(nodeId, removeLink); |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EnergyIndex energyIndex, @RequestParam Long pageNum, @RequestParam Long pageSize) { |
| | | EnergyIndexQuery query = new EnergyIndexQuery(energyIndex.getNodeId(), energyIndex.getName(), |
| | | energyIndex.getIndexCategory(), energyIndex.getIndexType()); |
| | | Page<EnergyIndex> list = energyIndexService.selectEnergyIndexPage(query, pageNum, pageSize); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | if (!deleteIds.isEmpty()) { |
| | | energyIndexService.deleteEnergyIndexByIds(nodeId, deleteIds.toArray(new String[0])); |
| | | /** |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/filter") |
| | | public AjaxResult filter(EnergyIndexQuery query) { |
| | | List<EnergyIndex> list = energyIndexService.selectEnergyIndexList(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢éè¿idå é¤ééç¹æ¥å£ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:remove')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{indexId}") |
| | | public AjaxResult deleteCollectIndex(@PathVariable String indexId) { |
| | | return toAjax(energyIndexService.deleteByIndexId(indexId)); |
| | | } |
| | | |
| | | @Log(title = "å¢å 计éå¨å
·ééç¹", businessType = BusinessType.INSERT) |
| | | @PostMapping("/meterIndex/{meterId}") |
| | | public AjaxResult addCollectIndex(@PathVariable("meterId") String meterId) { |
| | | try { |
| | | return energyIndexService.addMeterIndex(meterId); |
| | | } catch (Exception ex) { |
| | | logger.error("å建计éå¨å
·ééç¹å¤±è´¥ï¼", ex); |
| | | return AjaxResult.error(); |
| | | /** |
| | | * æ¥è¯¢ææ ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping("/collectIndex") |
| | | public TableDataInfo listCollectIndex(String deviceId) { |
| | | startPage(); |
| | | List<EnergyIndex> list = energyIndexService.selectCollectIndex(deviceId); |
| | | return getDataTable(list); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/meterIndex/{meterId}") |
| | | public AjaxResult getDeviceCollectIndex(@PathVariable("meterId") String meterId) { |
| | | return AjaxResult.success(energyIndexService.getMeterIndex(meterId)); |
| | | } |
| | | |
| | | @GetMapping("/includeChildrenNode/{nodeId}") |
| | | public AjaxResult getIndexByNodeAndChildrenNode(@PathVariable("nodeId") String nodeId) { |
| | | try { |
| | | return AjaxResult.success(energyIndexService.getIndexByNodeAndChildrenNode(nodeId)); |
| | | } catch (Exception ex) { |
| | | logger.error("è·åå
³èééææ åºéï¼", ex); |
| | | return AjaxResult.error("è·åå
³èææ åºé!"); |
| | | /** |
| | | * å¯¼åºææ ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:export')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(EnergyIndex energyIndex) { |
| | | List<EnergyIndex> list = energyIndexService.selectEnergyIndexList(energyIndex); |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | return util.exportExcel(list, "energyindex"); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/includeChildrenNode/search") |
| | | public AjaxResult searchIndexByNodeAndChildrenNode(String nodeId, String filter) { |
| | | try { |
| | | return AjaxResult |
| | | .success(energyIndexService.searchIndexByNodeAndChildrenNode(nodeId, filter)); |
| | | } catch (Exception ex) { |
| | | logger.error("è·åå
³èééææ åºéï¼", ex); |
| | | return AjaxResult.error("è·åå
³èææ åºé!"); |
| | | /** |
| | | * è·åææ ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:query')") |
| | | @GetMapping(value = "/{indexId}") |
| | | public AjaxResult getInfo(@PathVariable("indexId") String indexId) { |
| | | return AjaxResult.success(energyIndexService.selectEnergyIndexById(indexId)); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/importTemplate") |
| | | public AjaxResult importTemplate() { |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | return util.importTemplateExcel("ææ æ°æ®"); |
| | | } |
| | | /** |
| | | * æ°å¢ææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:add')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping(value = "/{nodeId}") |
| | | public AjaxResult add(@PathVariable("nodeId") String nodeId, |
| | | @RequestBody EnergyIndex energyIndex) { |
| | | boolean isExist = energyIndexService.energyIndexHasExist(energyIndex.getCode()); |
| | | if (isExist) { |
| | | return AjaxResult.error("ææ ç¼ç ä¸è½éå¤ï¼"); |
| | | } else { |
| | | energyIndex.setIndexId(UUID.randomUUID().toString()); |
| | | energyIndexService.insertEnergyIndex(nodeId, energyIndex); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | List<EnergyIndex> energyIndexList = util.importExcel(file.getInputStream()); |
| | | return energyIndexService.importEnergyIndex(energyIndexList, updateSupport); |
| | | } |
| | | /** |
| | | * ä¿®æ¹ææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:edit')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody EnergyIndex energyIndex) { |
| | | boolean isExist = energyIndexService |
| | | .energyIndexHasExist(energyIndex.getIndexId(), energyIndex.getCode()); |
| | | if (isExist) { |
| | | return AjaxResult.error("ææ ç¼ç ä¸è½éå¤ï¼"); |
| | | } else { |
| | | return toAjax(energyIndexService.updateEnergyIndex(energyIndex)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤ééææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:remove')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{indexIds}") |
| | | public AjaxResult remove(@PathVariable String[] indexIds) { |
| | | |
| | | List<String> indexIdList = Arrays.asList(indexIds); |
| | | if (ObjectUtils.isEmpty(indexIdList)) { |
| | | return AjaxResult.success(); |
| | | } |
| | | // æ¥è¯¢æ¨¡åèç¹ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfo> modelNodeIndexInfoList = energyIndexService.getModelNodeIndexInfoListByIndexIds(indexIds); |
| | | if (ObjectUtils.isNotEmpty(modelNodeIndexInfoList)) { |
| | | ModelNodeIndexInfo modelNodeIndexInfo = modelNodeIndexInfoList.stream().findFirst().get(); |
| | | return AjaxResult.error("ééææ " + modelNodeIndexInfo.getIndexName() + " 已被模å " + modelNodeIndexInfo.getModelName() + " å
³èï¼ä¸è½å é¤ï¼"); |
| | | } |
| | | |
| | | energyIndexService.removeEnergyIndex(indexIdList); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç»è®¡ææ ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('energyindex:energyindex:remove')") |
| | | @Log(title = "ææ ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("{nodeId}/{indexIds}") |
| | | public AjaxResult remove(@PathVariable String nodeId, @PathVariable String[] indexIds) { |
| | | |
| | | List<String> indexIdList = Arrays.asList(indexIds); |
| | | if (ObjectUtils.isEmpty(indexIdList)) { |
| | | return AjaxResult.success(); |
| | | } |
| | | // æ¥è¯¢æ¨¡åèç¹ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfo> modelNodeIndexInfoList = energyIndexService.getModelNodeIndexInfoListByIndexIds(indexIds); |
| | | if (ObjectUtils.isNotEmpty(modelNodeIndexInfoList)) { |
| | | if(modelNodeIndexInfoList.size() > 1){ |
| | | return AjaxResult.error("该ç»è®¡ææ 已被å
¶ä»æ¨¡åå
³èï¼ä¸è½å é¤ï¼"); |
| | | } |
| | | } |
| | | |
| | | energyIndexService.removeEnergyIndex(indexIdList); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Log(title = "å¢å 计éå¨å
·ééç¹", businessType = BusinessType.INSERT) |
| | | @PostMapping("/meterIndex/{meterId}") |
| | | public AjaxResult addCollectIndex(@PathVariable("meterId") String meterId) { |
| | | try { |
| | | return energyIndexService.addMeterIndex(meterId); |
| | | } catch (Exception ex) { |
| | | logger.error("å建计éå¨å
·ééç¹å¤±è´¥ï¼", ex); |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/meterIndex/{meterId}") |
| | | public AjaxResult getDeviceCollectIndex(@PathVariable("meterId") String meterId) { |
| | | return AjaxResult.success(energyIndexService.getMeterIndex(meterId)); |
| | | } |
| | | |
| | | @GetMapping("/includeChildrenNode/{nodeId}") |
| | | public AjaxResult getIndexByNodeAndChildrenNode(@PathVariable("nodeId") String nodeId) { |
| | | try { |
| | | return AjaxResult.success(energyIndexService.getIndexByNodeAndChildrenNode(nodeId)); |
| | | } catch (Exception ex) { |
| | | logger.error("è·åå
³èééææ åºéï¼", ex); |
| | | return AjaxResult.error("è·åå
³èææ åºé!"); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/includeChildrenNode/search") |
| | | public AjaxResult searchIndexByNodeAndChildrenNode(String nodeId, String filter) { |
| | | try { |
| | | return AjaxResult |
| | | .success(energyIndexService.searchIndexByNodeAndChildrenNode(nodeId, filter)); |
| | | } catch (Exception ex) { |
| | | logger.error("è·åå
³èééææ åºéï¼", ex); |
| | | return AjaxResult.error("è·åå
³èææ åºé!"); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/importTemplate") |
| | | public AjaxResult importTemplate() { |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | return util.importTemplateExcel("ææ æ°æ®"); |
| | | } |
| | | |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { |
| | | ExcelUtil<EnergyIndex> util = new ExcelUtil<>(EnergyIndex.class); |
| | | List<EnergyIndex> energyIndexList = util.importExcel(file.getInputStream()); |
| | | return energyIndexService.importEnergyIndex(energyIndexList, updateSupport); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getIndexByCode") |
| | | public AjaxResult getIndexByCode(String code,String nodeId) { |
| | | List<EnergyIndex> energyIndexList = energyIndexService.getIndexByCode(code,nodeId); |
| | | return AjaxResult.success(energyIndexList); |
| | | } |
| | | @GetMapping("/getIndexByCode") |
| | | public AjaxResult getIndexByCode(String code, String nodeId) { |
| | | List<EnergyIndex> energyIndexList = energyIndexService.getIndexByCode(code, nodeId); |
| | | return AjaxResult.success(energyIndexList); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import com.zhitan.processenergy.service.IDailyProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è æ¥ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/dailyProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼æ¥ï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class DailyProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | |
| | | @Autowired |
| | | private IDailyProcessEnergyService dailyProcessEnergy; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼æ¥ï¼å表") |
| | | public AjaxResult list(DataItem dataItem) throws ParseException{ |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | List<DailyProcessEnergy> dataList = new ArrayList<>(); |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 0; |
| | | dataItem.setBeginTime(dataItem.getDataTime()); |
| | | String endTime=aa+" 24:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i < 24) { |
| | | if(i>9){ |
| | | bb=aa+" "+i+":00:00"; |
| | | }else{ |
| | | bb=aa+" 0"+i+":00:00"; |
| | | } |
| | | DailyProcessEnergy report=new DailyProcessEnergy(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | i++; |
| | | } |
| | | List<DailyProcessEnergy> list = dailyProcessEnergy.getDailyProcessEnergyList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "å·¥åºè½èï¼æ¥ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItem dataItem) throws ParseException { |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | dataItem.setBeginTime(dataItem.getDataTime()); |
| | | String endTime=aa+" 24:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | List<DailyProcessEnergy> list = dailyProcessEnergy.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import com.zhitan.processenergy.service.IMonthlyProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è æ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/monthlyProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼æï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class MonthlyProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | @Autowired |
| | | private IMonthlyProcessEnergyService monthlyProcessEnergyService; |
| | | |
| | | /** |
| | | * |
| | | * @param dataItem |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼æï¼") |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<MonthlyProcessEnergy> dataList = new ArrayList<>(); |
| | | |
| | | Map tableColumn = new HashMap<>();//è¡¨æ°æ® |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String bb = ""; |
| | | int i = 1; |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i <= Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2))) { |
| | | if (i > 9) { |
| | | bb = aa + "-" + i + " 00:00:00"; |
| | | } else { |
| | | bb = aa + "-0" + i + " 00:00:00"; |
| | | } |
| | | MonthlyProcessEnergy report = new MonthlyProcessEnergy(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value" + i); |
| | | dataList.add(report); |
| | | tableColumn.put("value" + i, String.valueOf(i) + "æ¥"); |
| | | i++; |
| | | } |
| | | List<Map> table = new ArrayList<>(); |
| | | MonthlyProcessEnergy reportList = new MonthlyProcessEnergy(); |
| | | table.add(tableColumn); |
| | | reportList.setTablehead(table); |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if (CollectionUtils.isEmpty(nodeId)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if (CollectionUtils.isEmpty(energyList)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | List<MonthlyProcessEnergy> list = monthlyProcessEnergyService.getMonthlyProcessEnergy(indexIds, dataList, dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param dataItem |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItem dataItem) throws ParseException { |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | List<MonthlyProcessEnergy> list = monthlyProcessEnergyService.getListChart(dataItem.getIndexId(), dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param yearMonth |
| | | * @return |
| | | */ |
| | | public static String getLastDayOfMonth(String yearMonth) { |
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); //å¹´ |
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); //æ |
| | | Calendar cal = Calendar.getInstance(); |
| | | // 设置年份 |
| | | cal.set(Calendar.YEAR, year); |
| | | // 设置æä»½ |
| | | // cal.set(Calendar.MONTH, month - 1); |
| | | cal.set(Calendar.MONTH, month); //设置å½åæçä¸ä¸ä¸ªæ |
| | | // è·åæææå¤§å¤©æ° |
| | | //int lastDay = cal.getActualMaximum(Calendar.DATE); |
| | | int lastDay = cal.getMinimum(Calendar.DATE); //è·åæä»½ä¸çæå°å¼ï¼å³ç¬¬ä¸å¤© |
| | | // 设置æ¥å䏿份çæå¤§å¤©æ° |
| | | //cal.set(Calendar.DAY_OF_MONTH, lastDay); |
| | | cal.set(Calendar.DAY_OF_MONTH, lastDay - 1); //䏿ç第ä¸å¤©åå»1å°±æ¯å½æçæåä¸å¤© |
| | | // æ ¼å¼åæ¥æ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | return sdf.format(cal.getTime()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.processenergy.service.IYearProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è å¹´ |
| | | * |
| | | * |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/YearProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼å¹´ï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class YearProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | |
| | | @Autowired |
| | | private IYearProcessEnergyService yearProcessEnergyService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼å¹´ï¼å表") |
| | | private AjaxResult list(DataItemQueryDTO dataItem) throws ParseException{ |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | Date convertTime = DateTimeUtil.getTypeTime(dataItem.getTimeType(), dataItem.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | |
| | | List<TypeTime> typeTimeList = DateTimeUtil.getDateTimeList(dataItem.getTimeType(),convertTime); |
| | | |
| | | List<YearProcessEnergy> list = yearProcessEnergyService.getYearProcessEnergy(indexIds, typeTimeList,beginTime,endTime, dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "å·¥åºè½èï¼å¹´ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItemQueryDTO queryDto) { |
| | | List<YearProcessEnergy> list = yearProcessEnergyService.getListChart(queryDto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨") |
| | | private String status; |
| | | private String remark; |
| | | |
| | | public Long getDictId() |
| | | { |
| | |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | |
| | | @Override |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | @Override |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * ééææ |
| | | */ |
| | | COLLECT, |
| | | COLLECT("COLLECT"), |
| | | /** |
| | | * ç»è®¡ææ |
| | | */ |
| | | STATISTIC |
| | | STATISTIC("STATISTIC"); |
| | | |
| | | private final String description; |
| | | |
| | | IndexType(String description) |
| | | { |
| | | this.description = description; |
| | | } |
| | | |
| | | |
| | | public String getDescription() |
| | | { |
| | | return description; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.GregorianCalendar; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description: æ¶é´å·¥å
·ç±» |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç±»åæå符串转æå¯¹åºçæ¶é´ |
| | | * timeType="HOUR",time="2025-02-01"ï¼è¿å"2025-02-01 01:00:00" |
| | | * timeType="DAY",time="2025-02"ï¼è¿å"2025-02-01 01:00:00" |
| | | * timeType="MONTH",time="2025"ï¼è¿å"2025-02-01 01:00:00" |
| | | * |
| | | * @param timeType æ¶é´ç±»å |
| | | * @param time æ¶é´å符串 |
| | | * @return |
| | | */ |
| | | public static Date getTypeTime(String timeType, String time) { |
| | | Date dt = null; |
| | | timeType = StringUtil.ifEmptyOrNullReturnValue(timeType).toUpperCase(); |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | | dt = toDateTime(time, COMMON_PATTERN_TO_DAY); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | dt = toDateTime(time, COMMON_PATTERN_TO_MONTH); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | dt = toDateTime(time, COMMON_PATTERN_YEAR); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return dt; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç±»åæè¿ç»çæ¥æå符串转æå¯¹åºçæ¶é´ ï¼202303ã20230303ã2023030301ã202303030101ï¼ |
| | | * |
| | | * @param timeType æ¶é´ç±»å |
| | |
| | | * @param val 计ç®å¼ |
| | | * @return |
| | | */ |
| | | public static Date productionCycleCal(Date date, String cycleType,int val) { |
| | | public static Date productionCycleCal(Date date, String cycleType, int val) { |
| | | Date momDate = date; |
| | | switch (cycleType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | |
| | | } |
| | | return momDate; |
| | | } |
| | | |
| | | /** |
| | | * éè¿æ¶é´ç±»åè¿å对åºçæ¶é´list |
| | | * <p> |
| | | * åæ°ï¼ |
| | | * timeType="YEAR",dataTime="2025-01-01 00:00:00" |
| | | * timeType="MONTH",dataTime="2025-01-01 00:00:00" |
| | | * timeType="DAY",dataTime="2025-01-01 00:00:00" |
| | | * è¿åæ ¼å¼ï¼ |
| | | * [ |
| | | * {"datatime":"2025-01-01 00:00:00","value":"value1"}, |
| | | * {"datatime":"2025-02-01 00:00:00","value":"value2"}, |
| | | * {"datatime":"2025-03-01 00:00:00","value":"value3"}, |
| | | * {"datatime":"2025-04-01 00:00:00","value":"value4"}, |
| | | * {"datatime":"2025-05-01 00:00:00","value":"value5"}, |
| | | * {"datatime":"2025-06-01 00:00:00","value":"value6"}, |
| | | * {"datatime":"2025-07-01 00:00:00","value":"value7"}, |
| | | * {"datatime":"2025-08-01 00:00:00","value":"value8"}, |
| | | * {"datatime":"2025-09-01 00:00:00","value":"value9"}, |
| | | * {"datatime":"2025-10-01 00:00:00","value":"value10"}, |
| | | * {"datatime":"2025-11-01 00:00:00","value":"value11"}, |
| | | * {"datatime":"2025-12-01 00:00:00","value":"value12"} |
| | | * ] |
| | | * |
| | | * @param timeType |
| | | * @param dataTime |
| | | * @return |
| | | */ |
| | | public static List<TypeTime> getDateTimeList(String timeType, Date dataTime) { |
| | | |
| | | List<TypeTime> resultList = new ArrayList<>(); |
| | | Date beginTime; |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | | beginTime = DateUtil.beginOfDay(dataTime); |
| | | for (int i = 1; i <= 24; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_H + DateUtil.format(beginTime, COMMON_PATTERN_HOUR)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addHours(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | beginTime = DateUtil.beginOfMonth(dataTime); |
| | | for (int i = 1; i <= 31; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_D + DateUtil.format(beginTime, COMMON_PATTERN_DAY)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addDays(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | beginTime = DateUtil.beginOfYear(dataTime); |
| | | for (int i = 1; i <= 12; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_M + DateUtil.format(beginTime, COMMON_PATTERN_MONTH)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addMonths(beginTime, 1); |
| | | } |
| | | break; |
| | | } |
| | | return resultList; |
| | | } |
| | | |
| | | /** |
| | | * éè¿æ¶é´ç±»åè¿å对åºçæ¶é´list |
| | | * <p> |
| | | * åæ°ï¼ |
| | | * timeType="YEAR",dataTime="2025-01-01 00:00:00" |
| | | * timeType="MONTH",dataTime="2025-01-01 00:00:00" |
| | | * timeType="DAY",dataTime="2025-01-01 00:00:00" |
| | | * è¿åæ ¼å¼ï¼ |
| | | * [ |
| | | * {"datatime":"2025-01-01 00:00:00","value":"value1"}, |
| | | * {"datatime":"2025-02-01 00:00:00","value":"value2"}, |
| | | * {"datatime":"2025-03-01 00:00:00","value":"value3"}, |
| | | * {"datatime":"2025-04-01 00:00:00","value":"value4"}, |
| | | * {"datatime":"2025-05-01 00:00:00","value":"value5"}, |
| | | * {"datatime":"2025-06-01 00:00:00","value":"value6"}, |
| | | * {"datatime":"2025-07-01 00:00:00","value":"value7"}, |
| | | * {"datatime":"2025-08-01 00:00:00","value":"value8"}, |
| | | * {"datatime":"2025-09-01 00:00:00","value":"value9"}, |
| | | * {"datatime":"2025-10-01 00:00:00","value":"value10"}, |
| | | * {"datatime":"2025-11-01 00:00:00","value":"value11"}, |
| | | * {"datatime":"2025-12-01 00:00:00","value":"value12"} |
| | | * ] |
| | | * |
| | | * @param timeType |
| | | * @param dataTime |
| | | * @return |
| | | */ |
| | | public static List<TypeTime> getDateTimeListSame(String timeType, Date dataTime) { |
| | | |
| | | List<TypeTime> resultList = new ArrayList<>(); |
| | | Date beginTime; |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | beginTime = DateUtil.beginOfDay(dataTime); |
| | | for (int i = 1; i <= 24; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_H + DateUtil.format(beginTime, COMMON_PATTERN_HOUR)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addHours(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | beginTime = DateUtil.beginOfMonth(dataTime); |
| | | for (int i = 1; i <= 31; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_D + DateUtil.format(beginTime, COMMON_PATTERN_DAY)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addDays(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | beginTime = DateUtil.beginOfYear(dataTime); |
| | | for (int i = 1; i <= 12; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_M + DateUtil.format(beginTime, COMMON_PATTERN_MONTH)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addMonths(beginTime, 1); |
| | | } |
| | | break; |
| | | } |
| | | return resultList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.common.utils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zhitan.common.constant.CommonConst; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 屿§å¼æä½å·¥å
·ç±» |
| | | * @author: yxw |
| | | * @date: 2022å¹´03æ07æ¥ 9:57 |
| | | */ |
| | | public class PropUtils { |
| | | /** |
| | | * 为å®ä½èµå¼ |
| | | * |
| | | * @param obj |
| | | * @param propName |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static Object setValue(Object obj, String propName, Object value) { |
| | | try { |
| | | Field field = obj.getClass().getDeclaredField(propName); |
| | | field.setAccessible(true); |
| | | String nameTypeName = field.getType().getTypeName(); |
| | | nameTypeName = StringUtil.ifEmptyOrNullReturnValue(nameTypeName).toLowerCase(); |
| | | if (nameTypeName.contains("float")) { |
| | | float num = (float) DoubleUtil.toDouble(value); |
| | | field.set(obj, num); |
| | | } else if (nameTypeName.contains("double")) { |
| | | field.set(obj, DoubleUtil.toDouble(value)); |
| | | } else if (nameTypeName.contains("bigdecimal")) { |
| | | BigDecimal valueOf = BigDecimal.valueOf(Double.parseDouble(String.valueOf(value))) |
| | | .setScale(CommonConst.DIGIT_2, BigDecimal.ROUND_HALF_UP); |
| | | |
| | | field.set(obj, valueOf); |
| | | } else { |
| | | field.set(obj, value); |
| | | } |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | | * è·å对象çæå®å段çå¼ |
| | | * |
| | | * @param obj |
| | | * @param propName |
| | | * @return |
| | | */ |
| | | public static String getPropValue(Object obj, String propName) { |
| | | String propValue = ""; |
| | | try { |
| | | if (null != obj) { |
| | | JSONObject jsonObject = StringUtil.toJsonObject(obj); |
| | | if (!StringUtil.isEmptyOrNull(propName)) { |
| | | propValue = jsonObject.getString(propName); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | return propValue; |
| | | } |
| | | |
| | | /** |
| | | * è·å对象çæå®å段çç±»å |
| | | * è¿å屿§çç±»åå符串ï¼å°åï¼ä¾å¦:string/integer/double/dateï¼ |
| | | * |
| | | * @param obj å®ä½ |
| | | * @param propName 屿§å |
| | | * @return ï¼å°åï¼ä¾å¦:string/integer/double/dateï¼ |
| | | */ |
| | | public static String getPropType(Object obj, String propName) { |
| | | String propType = ""; |
| | | try { |
| | | if (null != obj && !StringUtil.isEmptyOrNull(propName)) { |
| | | Field[] fields = obj.getClass().getDeclaredFields(); |
| | | for (Field field : fields) { |
| | | String name = field.getName().toLowerCase(); |
| | | if (name.equals(propName.toLowerCase())) { |
| | | propType = field.getType().getSimpleName().toLowerCase(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | return propType; |
| | | } |
| | | |
| | | /** |
| | | * è¡è½¬å |
| | | * @param clazz ç»æç±»ï¼å¦ UserInfo.class |
| | | * @param list æ°æ®é |
| | | * @return |
| | | * @param <T> |
| | | */ |
| | | public static <T> List rowToColumn(Class<T> clazz, List<T> list){ |
| | | List<List> result; |
| | | Field[] fields = clazz.getDeclaredFields(); |
| | | result = new ArrayList<>(fields.length); |
| | | for (int i = 0; i < fields.length; i++) { |
| | | result.add(new ArrayList()); |
| | | } |
| | | for (T t : list) { |
| | | for (int i = 0; i < fields.length; i++) { |
| | | List l = result.get(i); |
| | | Field field = fields[i]; |
| | | field.setAccessible(true); |
| | | try { |
| | | l.add(field.get(t)); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.common.utils; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * [ |
| | | * {"dataTime":"2025-01-01 00:00:00","value":"value0"} |
| | | * {"dataTime":"2025-02-01 00:00:00","value":"value1"} |
| | | * {"dataTime":"2025-03-01 00:00:00","value":"value2"} |
| | | * {"dataTime":"2025-04-01 00:00:00","value":"value3"} |
| | | * {"dataTime":"2025-05-01 00:00:00","value":"value4"} |
| | | * {"dataTime":"2025-06-01 00:00:00","value":"value5"} |
| | | * {"dataTime":"2025-07-01 00:00:00","value":"value6"} |
| | | * {"dataTime":"2025-08-01 00:00:00","value":"value7"} |
| | | * {"dataTime":"2025-09-01 00:00:00","value":"value8"} |
| | | * {"dataTime":"2025-10-01 00:00:00","value":"value9"} |
| | | * {"dataTime":"2025-11-01 00:00:00","value":"value10"} |
| | | * {"dataTime":"2025-12-01 00:00:00","value":"value11"} |
| | | * } |
| | | */ |
| | | @Data |
| | | public class TypeTime { |
| | | private String dataTime; |
| | | private String value; |
| | | private String timeCode; |
| | | |
| | | private Date dateTime; |
| | | } |
| | |
| | | public String login(String username, String password, String code, String uuid) |
| | | { |
| | | // éªè¯ç æ ¡éª |
| | | validateCaptcha(username, code, uuid); |
| | | // validateCaptcha(username, code, uuid); |
| | | // ç»å½åç½®æ ¡éª |
| | | loginPreCheck(username, password); |
| | | // ç¨æ·éªè¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.Itemizedenergyanalysis.domain.VO; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Data |
| | | public class ItemizedEnergyAnalysisItemVO { |
| | | /** |
| | | * èç¹id |
| | | */ |
| | | private String nodeId; |
| | | /** |
| | | * èç¹åç§° |
| | | */ |
| | | private String nodeName; |
| | | /** |
| | | * å计 |
| | | */ |
| | | private Double total; |
| | | @Excel(name = "1æ¶/1æ¥/1æ") |
| | | private Double value0; |
| | | @Excel(name = "2æ¶/2æ¥/2æ") |
| | | private Double value1; |
| | | @Excel(name = "3æ¶/3æ¥/3æ") |
| | | private Double value2; |
| | | @Excel(name = "4æ¶/4æ¥/4æ") |
| | | private Double value3; |
| | | @Excel(name = "5æ¶/5æ¥/5ææ¥") |
| | | private Double value4; |
| | | @Excel(name = "6æ¶/6æ¥/6ææ¥") |
| | | private Double value5; |
| | | @Excel(name = "7æ¶/7æ¥/7ææ¥") |
| | | private Double value6; |
| | | @Excel(name = "8æ¶/8æ¥/8ææ¥") |
| | | private Double value7; |
| | | @Excel(name = "9æ¶/9æ¥/9ææ¥") |
| | | private Double value8; |
| | | @Excel(name = "10æ¶/10æ¥/10ææ¥") |
| | | private Double value9; |
| | | @Excel(name = "11æ¶/11æ¥/11ææ¥") |
| | | private Double value10; |
| | | @Excel(name = "12æ¶/12æ¥/12æ") |
| | | private Double value11; |
| | | @Excel(name = "13æ¶/13æ¥") |
| | | private Double value12; |
| | | @Excel(name = "14æ¶/14æ¥") |
| | | private Double value13; |
| | | @Excel(name = "15æ¶/15æ¥") |
| | | private Double value14; |
| | | @Excel(name = "16æ¶/16æ¥") |
| | | private Double value15; |
| | | @Excel(name = "17æ¶/17æ¥") |
| | | private Double value16; |
| | | @Excel(name = "18æ¶/18æ¥") |
| | | private Double value17; |
| | | @Excel(name = "19æ¶/19æ¥") |
| | | private Double value18; |
| | | @Excel(name = "20æ¶/20æ¥") |
| | | private Double value19; |
| | | @Excel(name = "21æ¶/21æ¥") |
| | | private Double value20; |
| | | @Excel(name = "22æ¶/22æ¥") |
| | | private Double value21; |
| | | @Excel(name = "23æ¶/23æ¥") |
| | | private Double value22; |
| | | @Excel(name = "24æ¶/24æ¥") |
| | | private Double value23; |
| | | @Excel(name = "25æ¥") |
| | | private Double value24; |
| | | @Excel(name = "26æ¥") |
| | | private Double value25; |
| | | @Excel(name = "27æ¥") |
| | | private Double value26; |
| | | @Excel(name = "28æ¥") |
| | | private Double value27; |
| | | @Excel(name = "29æ¥") |
| | | private Double value28; |
| | | @Excel(name = "30æ¥") |
| | | private Double value29; |
| | | @Excel(name = "31æ¥") |
| | | private Double value30; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.Itemizedenergyanalysis.domain.VO; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å项ç¨è½åæè¿åç±» |
| | | * |
| | | * @author å¼ |
| | | */ |
| | | @Data |
| | | public class ItemizedEnergyAnalysisVO { |
| | | |
| | | /** |
| | | * å计 |
| | | */ |
| | | private String total; |
| | | /** |
| | | * æå¤§å¼ |
| | | */ |
| | | private String max; |
| | | /** |
| | | * æå°å¼ |
| | | */ |
| | | private String min; |
| | | /** |
| | | * å¹³åå¼ |
| | | */ |
| | | private String avg; |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | private List<ItemizedEnergyAnalysisItemVO> dataList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.Itemizedenergyanalysis.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¨ææ°æ®é¡¹. |
| | | */ |
| | | @Data |
| | | public class ItemizedEnergyAnalysisDTO { |
| | | |
| | | @ApiModelProperty(value = "æ¶é´å符串") |
| | | private String dataTime; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´ç±»å") |
| | | private String timeType; |
| | | |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | |
| | | @ApiModelProperty(value = "èç¹Id") |
| | | private String nodeId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.Itemizedenergyanalysis.service; |
| | | |
| | | import com.zhitan.Itemizedenergyanalysis.domain.VO.ItemizedEnergyAnalysisVO; |
| | | import com.zhitan.Itemizedenergyanalysis.dto.ItemizedEnergyAnalysisDTO; |
| | | |
| | | public interface IItemizedEnergyAnalysisService { |
| | | /** |
| | | * å项ç¨è½åæ |
| | | * @param dto 请æ±åæ° |
| | | * @return ç»æ |
| | | */ |
| | | ItemizedEnergyAnalysisVO getItemizedEnergyAnalysisService(ItemizedEnergyAnalysisDTO dto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.Itemizedenergyanalysis.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.zhitan.Itemizedenergyanalysis.domain.VO.ItemizedEnergyAnalysisItemVO; |
| | | import com.zhitan.Itemizedenergyanalysis.domain.VO.ItemizedEnergyAnalysisVO; |
| | | import com.zhitan.Itemizedenergyanalysis.dto.ItemizedEnergyAnalysisDTO; |
| | | import com.zhitan.Itemizedenergyanalysis.service.IItemizedEnergyAnalysisService; |
| | | import com.zhitan.common.constant.TimeTypeConst; |
| | | import com.zhitan.common.exception.ServiceException; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.PropUtils; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.dataitem.service.IDataItemService; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * å项ç¨è½åæ |
| | | * |
| | | * @author sys |
| | | * @date 2025-03-25 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ItemizedEnergyAnalysisServiceImpl implements IItemizedEnergyAnalysisService { |
| | | |
| | | @Resource |
| | | private final ModelNodeMapper modelNodeMapper; |
| | | @Resource |
| | | private final IDataItemService dataItemService; |
| | | |
| | | /** |
| | | * @param dto 请æ±åæ° |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public ItemizedEnergyAnalysisVO getItemizedEnergyAnalysisService(ItemizedEnergyAnalysisDTO dto) { |
| | | |
| | | String timeType = dto.getTimeType(); |
| | | String dataTime = dto.getDataTime(); |
| | | Date beginTime = DateTimeUtil.getTime(timeType, dataTime); |
| | | DateTime endTime = null; |
| | | |
| | | // è·åèç¹ä¿¡æ¯ |
| | | List<ModelNodeIndexInfo> nodeIndexInfo = modelNodeMapper.getModelNodeIndexIdByNodeId(dto.getNodeId(), dto.getEnergyType()); |
| | | List<String> indexList = nodeIndexInfo.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | if(ObjectUtil.isEmpty(indexList)){ |
| | | return new ItemizedEnergyAnalysisVO(); |
| | | } |
| | | |
| | | ModelNodeIndexInfo info = nodeIndexInfo.stream().findFirst().get(); |
| | | |
| | | List<TypeTime> dateTimeList; |
| | | // æ ¹æ®æ¶é´ç±»åè°æ´æ¶é´èå´ |
| | | switch (dto.getTimeType()) { |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | timeType = TimeTypeConst.TIME_TYPE_HOUR; |
| | | endTime = DateUtil.endOfDay(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_DAY, beginTime); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | timeType = TimeTypeConst.TIME_TYPE_DAY; |
| | | endTime = DateUtil.endOfMonth(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_MONTH, beginTime); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | timeType = TimeTypeConst.TIME_TYPE_MONTH; |
| | | endTime = DateUtil.endOfYear(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_YEAR, beginTime); |
| | | break; |
| | | default: |
| | | throw new ServiceException("æ¶é´æ ¼å¼é误"); |
| | | } |
| | | // è·åæ°æ®é¡¹å表 |
| | | List<DataItem> dataItemList = dataItemService.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, timeType, indexList); |
| | | |
| | | // è·åæå¤§å¼ãæå°å¼ãå计ãå¹³åå¼ |
| | | ItemizedEnergyAnalysisVO vo = new ItemizedEnergyAnalysisVO(); |
| | | double sum = dataItemList.stream().mapToDouble(DataItem::getValue).sum(); |
| | | double max = dataItemList.stream().mapToDouble(DataItem::getValue).max().getAsDouble(); |
| | | double min = dataItemList.stream().mapToDouble(DataItem::getValue).min().getAsDouble(); |
| | | double avg = dataItemList.stream().mapToDouble(DataItem::getValue).average().getAsDouble(); |
| | | |
| | | vo.setTotal(BigDecimal.valueOf(sum).setScale(2, RoundingMode.HALF_UP).toString()); |
| | | vo.setMax(BigDecimal.valueOf(max).setScale(2, RoundingMode.HALF_UP).toString()); |
| | | vo.setMin(BigDecimal.valueOf(min).setScale(2, RoundingMode.HALF_UP).toString()); |
| | | vo.setAvg(BigDecimal.valueOf(avg).setScale(2, RoundingMode.HALF_UP).toString()); |
| | | if(ObjectUtil.isNotEmpty(info.getUnitId())){ |
| | | vo.setUnit(info.getUnitId()); |
| | | } |
| | | |
| | | List<ItemizedEnergyAnalysisItemVO> voList = new ArrayList<>(); |
| | | ItemizedEnergyAnalysisItemVO itemVO = new ItemizedEnergyAnalysisItemVO(); |
| | | itemVO.setNodeId(info.getNodeId()); |
| | | itemVO.setNodeName(info.getName()); |
| | | itemVO.setTotal(sum); |
| | | |
| | | Map<Date, List<DataItem>> dateListMap = dataItemList.stream().collect(Collectors.groupingBy(DataItem::getDataTime)); |
| | | List<DataItem> results = new ArrayList<>(); |
| | | dateListMap.forEach((key, value) -> { |
| | | DataItem dataItem = new DataItem(); |
| | | dataItem.setDataTime(key); |
| | | //ä¿çåä½å°æ° |
| | | double totalValue = value.stream().map(data -> BigDecimal.valueOf(data.getValue())) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_UP).doubleValue(); |
| | | dataItem.setValue(totalValue); |
| | | results.add(dataItem); |
| | | }); |
| | | //æ ¹æ®æ¶é´æåº |
| | | results.sort(Comparator.comparing(DataItem::getDataTime)); |
| | | for (int i = 0; i < dateTimeList.size(); i++) { |
| | | TypeTime typeTime = dateTimeList.get(i); |
| | | Optional<DataItem> dataItem = results.stream().filter(result -> result.getDataTime().equals(typeTime.getDateTime())).findFirst(); |
| | | if (dataItem.isPresent()) { |
| | | DataItem item = dataItem.get(); |
| | | PropUtils.setValue(itemVO, "value" + i, item.getValue()); |
| | | } else { |
| | | PropUtils.setValue(itemVO, "value" + i, null); |
| | | } |
| | | } |
| | | |
| | | voList.add(itemVO); |
| | | vo.setDataList(voList); |
| | | |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.zhitan.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | |
| | | * @author hmj |
| | | * @date 2024-10-16 17:55 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @Data |
| | | public class AlarmAnalysisDTO { |
| | | @ApiModelProperty(value = "èç¹id") |
| | | private String nodeId; |
| | |
| | | /** |
| | | * ç»è®¡å¼å§æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "ç»è®¡å¼å§æ¶é´") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ¥è¦å¼å§æ¶é´", dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date beginTime; |
| | | |
| | | /** |
| | | * ç»è®¡å¼å§æ¶é´ |
| | | * ç»è®¡ç»ææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "ç»è®¡ç»ææ¶é´") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ¥è¦å¼å§æ¶é´", dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ¥è¦ç»ææ¶é´", dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | /** 模åç¼ç */ |
| | | /** |
| | | * 模åç¼ç |
| | | */ |
| | | @ApiModelProperty(value = "模åç¼ç ") |
| | | @Excel(name = "模åç¼ç ") |
| | | private String modelCode; |
| | | } |
| | |
| | | import com.zhitan.alarm.domain.JkHistoryAlarm; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface HistoryAlarmMapper { |
| | | |
| | | /** |
| | | * è·åå岿¥è¦éå |
| | | * |
| | | * @param jkHistoryAlarm æ¥è¦åæ° |
| | | * @return 颿¥è¦è®¾ç½®éå |
| | | */ |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm); |
| | | /** |
| | | * è·åå岿¥è¦éå |
| | | * |
| | | * @param jkHistoryAlarm æ¥è¦åæ° |
| | | * @return 颿¥è¦è®¾ç½®éå |
| | | */ |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm); |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | /** |
| | | * 宿¶æ£æµ åè½ çå¤ sheet页 å±ç¤º ç»æå¾ æµç¹ æ¥è¦ä¿¡æ¯ |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm); |
| | | /** |
| | | * 宿¶æ£æµ åè½ çå¤ sheet页 å±ç¤º ç»æå¾ æµç¹ æ¥è¦ä¿¡æ¯ |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | void updateHistoryAlarm(@Param("alarmCode") String alarmCode, |
| | | @Param("historyAlarm") HistoryAlarm historyAlarm); |
| | | void updateHistoryAlarm(@Param("alarmCode") String alarmCode, @Param("historyAlarm") HistoryAlarm historyAlarm); |
| | | |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(@Param("jkHistoryAlarm") JkHistoryAlarm jkHistoryAlarm,@Param("page")Page<?> page); |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(@Param("jkHistoryAlarm") JkHistoryAlarm jkHistoryAlarm, @Param("page") Page<?> page); |
| | | |
| | | Integer selectCountByTime(@Param("beginTime") DateTime beginTime, @Param("endTime") DateTime endTime); |
| | | Integer selectCountByTime(@Param("beginTime") DateTime beginTime, |
| | | @Param("endTime") DateTime endTime, |
| | | @Param("indexIdList") List<String> indexIdList); |
| | | |
| | | Page<JkHistoryAlarm> getHistoryAlarmList(@Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("indexIdList") List<String> indexIdList, |
| | | Page<JkHistoryAlarm> pageInfo); |
| | | } |
ÎļþÃû´Ó zhitan-system/src/main/java/com/zhitan/alarm/services/IAlarmAnalyisisService.java ÐÞ¸Ä |
| | |
| | | import com.zhitan.alarm.domain.vo.AlarmAnalysisVO; |
| | | |
| | | /** |
| | | * description todu |
| | | * æ¥è¦åææ¥å£ |
| | | * |
| | | * @author hmj |
| | | * @date 2024-10-26 17:33 |
| | | * @author zhitan |
| | | * @date |
| | | */ |
| | | public interface IAlarmAnalyisisService { |
| | | public interface IAlarmAnalysisService { |
| | | |
| | | AlarmAnalysisVO getByNodeId(AlarmAnalysisDTO alarmAnalysisDTO); |
| | | |
| | | /** |
| | | * æ¥è¦åæç»è®¡ |
| | | * |
| | | * @param alarmAnalysisDTO |
| | | * @return |
| | | */ |
| | | AlarmAnalysisVO getCountInfo(AlarmAnalysisDTO alarmAnalysisDTO); |
| | | } |
| | |
| | | |
| | | void updateHistoryAlarm(String alarmCode, HistoryAlarm historyAlarm); |
| | | |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(JkHistoryAlarm jkHistoryAlarm, Long pageNum, Long pageSize); |
| | | /** |
| | | * å岿¥è¦å页æ¥è¯¢ |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | Page<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm jkHistoryAlarm); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.zhitan.alarm.domain.JkHistoryAlarm; |
| | | import com.zhitan.alarm.domain.dto.AlarmAnalysisDTO; |
| | | import com.zhitan.alarm.domain.vo.AlarmAnalysisVO; |
| | | import com.zhitan.alarm.mapper.HistoryAlarmMapper; |
| | | import com.zhitan.alarm.services.IAlarmAnalyisisService; |
| | | import com.zhitan.basicdata.domain.MeterImplement; |
| | | import com.zhitan.alarm.services.IAlarmAnalysisService; |
| | | import com.zhitan.basicdata.domain.SysEnergy; |
| | | import com.zhitan.basicdata.domain.vo.MeterImplementModel; |
| | | import com.zhitan.basicdata.mapper.MeterImplementMapper; |
| | | import com.zhitan.basicdata.mapper.SysEnergyMapper; |
| | | import com.zhitan.common.enums.IndexType; |
| | |
| | | import com.zhitan.common.utils.StringUtils; |
| | | import com.zhitan.consumptionanalysis.domain.vo.ChartData; |
| | | import com.zhitan.consumptionanalysis.domain.vo.EnergyProportion; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.EnergyIndexMapper; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * description todu |
| | | * æ¥è¦åæå®ç° |
| | | * |
| | | * @author hmj |
| | | * @date 2024-10-26 17:34 |
| | | * @author |
| | | * @date |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class AlarmAnalyisisServiceImpl implements IAlarmAnalyisisService { |
| | | public class AlarmAnalyisisServiceImpl implements IAlarmAnalysisService { |
| | | |
| | | private final ModelNodeMapper modelNodeMapper; |
| | | |
| | |
| | | private final EnergyIndexMapper energyIndexMapper; |
| | | |
| | | private final SysEnergyMapper sysEnergyMapper; |
| | | |
| | | /** |
| | | * æ ¹æ®èç¹idè·åæ¥è¦åæä¿¡æ¯ |
| | | * |
| | | * @param alarmAnalysisDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmAnalysisVO getByNodeId(AlarmAnalysisDTO alarmAnalysisDTO) { |
| | | AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO(); |
| | | List<EnergyProportion> alarmProportionList = new ArrayList<>(); |
| | | for(IndexType indexType : IndexType.values()){ |
| | | EnergyProportion proportion = new EnergyProportion(); |
| | | proportion.setEnergyName(indexType.name()); |
| | | proportion.setCount(0D); |
| | | proportion.setPercentage(0D); |
| | | alarmProportionList.add(proportion); |
| | | } |
| | | |
| | | |
| | | // åå§åæ¥è¦æ¯ä¾å表 |
| | | List<EnergyProportion> alarmProportionList = initializeProportionList(IndexType.values()); |
| | | // åå§åè½æºæ¯ä¾å表 |
| | | List<EnergyProportion> energyProportionList = new ArrayList<>(); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectSysEnergyList(new SysEnergy()); |
| | | sysEnergies.forEach(sysEnergy -> { |
| | | |
| | | sysEnergyMapper.selectSysEnergyList(new SysEnergy()).forEach(sysEnergy -> { |
| | | EnergyProportion proportion = new EnergyProportion(); |
| | | proportion.setEnergyName(sysEnergy.getEnersno()); |
| | | proportion.setCount(0D); |
| | |
| | | query.setNodeId(nodeId); |
| | | final List<JkHistoryAlarm> jkHistoryAlarms = historyAlarmMapper.selectJkHistoryAlarmList(query); |
| | | if(CollectionUtils.isNotEmpty(jkHistoryAlarms)) { |
| | | jkHistoryAlarms.forEach(alarm -> { |
| | | final String indexType = alarm.getIndexType(); |
| | | final String indexId = alarm.getIndexId(); |
| | | final String alarmNodeId = alarm.getNodeId(); |
| | | if ("COLLECT".equals(indexType) && StringUtils.isEmpty(alarm.getEnergyId())) { |
| | | //æ ¹æ®nodeIdåindexId 廿¥è¯¢è®¡éå¨å
· |
| | | EnergyIndex energyIndex = energyIndexMapper.selectEnergyIndexById(indexId); |
| | | final MeterImplement meterImplement = meterImplementMapper.selectMeterImplementById(energyIndex.getMeterId()); |
| | | alarm.setEnergyId(meterImplement.getEnergyType()); |
| | | } |
| | | }); |
| | | final Map<String, List<JkHistoryAlarm>> alarmTypeMap = jkHistoryAlarms.stream().collect(Collectors.groupingBy(JkHistoryAlarm::getIndexType)); |
| | | alarmTypeMap.forEach((key, value) -> { |
| | | alarmProportionList.forEach(alarm->{ |
| | | if(alarm.getEnergyName().equals(key)){ |
| | | alarm.setEnergyName(key); |
| | | alarm.setCount(format2Double(value.size())); |
| | | double percentage = value.size() / jkHistoryAlarms.size() * 100; |
| | | alarm.setPercentage(format2Double(percentage)); |
| | | } |
| | | }); |
| | | }); |
| | | final Map<String, List<JkHistoryAlarm>> energyTypeMap = jkHistoryAlarms.stream().collect(Collectors.groupingBy(JkHistoryAlarm::getEnergyId)); |
| | | energyTypeMap.forEach((key, value) -> { |
| | | energyProportionList.forEach(en->{ |
| | | if(en.getEnergyName().equals(key)){ |
| | | en.setEnergyName(key); |
| | | en.setCount(format2Double(value.size())); |
| | | double percentage = value.size() / jkHistoryAlarms.size() * 100; |
| | | en.setPercentage(format2Double(percentage)); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // è®¾ç½®è½æºç±»å |
| | | processEnergyType(jkHistoryAlarms); |
| | | |
| | | jkHistoryAlarms.forEach(jkHistoryAlarm -> { |
| | | final String alarmBeginTime = DateUtil.format(jkHistoryAlarm.getAlarmBeginTime(), timeFormat); |
| | | jkHistoryAlarm.setAlarmTime(alarmBeginTime); |
| | | }); |
| | | final Map<String, List<JkHistoryAlarm>> timeMap = jkHistoryAlarms.stream().collect(Collectors.groupingBy(JkHistoryAlarm::getAlarmTime)); |
| | | while (!beginTime.after(endTime)) { |
| | | final String currentTime = DateUtil.format(beginTime, timeFormat); |
| | | final List<JkHistoryAlarm> value = timeMap.get(currentTime); |
| | | ChartData chartData = new ChartData(); |
| | | chartData.setXData(currentTime); |
| | | chartData.setYValue(null == value?0:(double)value.size()); |
| | | chartDataList.add(chartData); |
| | | // è®¡ç®æ¥è¦ç±»åæ¯ä¾ |
| | | calculateProportions(jkHistoryAlarms, alarmProportionList, JkHistoryAlarm::getIndexType); |
| | | // 计ç®è½æºç±»åæ¯ä¾ |
| | | calculateProportions(jkHistoryAlarms, energyProportionList, JkHistoryAlarm::getEnergyId); |
| | | |
| | | switch (TimeType.valueOf(queryTimeType)) { |
| | | case DAY: |
| | | beginTime = DateUtil.offsetHour(beginTime, 1); |
| | | break; |
| | | case MONTH: |
| | | beginTime = DateUtil.offsetDay(beginTime, 1); |
| | | break; |
| | | default: |
| | | beginTime = DateUtil.offsetMonth(beginTime, 1); |
| | | break; |
| | | } |
| | | } |
| | | // å¤çæ¥è¦æ¶é´ |
| | | processAlarmTimes(jkHistoryAlarms, timeFormat); |
| | | |
| | | // çæå¾è¡¨æ°æ® |
| | | generateChartData(chartDataList, jkHistoryAlarms, beginTime, endTime, timeFormat, queryTimeType); |
| | | |
| | | } |
| | | alarmAnalysisVO.setAlarmProportion(alarmProportionList); |
| | | alarmAnalysisVO.setEnergyProportion(energyProportionList); |
| | |
| | | return alarmAnalysisVO; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è½æºç±»å |
| | | */ |
| | | private void processEnergyType(List<JkHistoryAlarm> jkHistoryAlarms) { |
| | | List<String> indexIds = jkHistoryAlarms.stream().map(JkHistoryAlarm::getIndexId).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(indexIds)) { |
| | | List<MeterImplementModel> modelList = energyIndexMapper.selectEnergyTypeByIndex(indexIds); |
| | | if (CollectionUtils.isNotEmpty(modelList)){ |
| | | Map<String, String> energyMap = modelList.stream().collect(Collectors.toMap(MeterImplementModel::getIndexId, MeterImplementModel::getEnergyType)); |
| | | |
| | | @Override |
| | | public AlarmAnalysisVO getCountInfo(AlarmAnalysisDTO alarmAnalysisDTO) { |
| | | AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO(); |
| | | final String nodeId = alarmAnalysisDTO.getNodeId(); |
| | | final DateTime beginOfMonth = DateUtil.beginOfMonth(new Date()); |
| | | final DateTime endOfMonth = DateUtil.endOfMonth(new Date()); |
| | | final DateTime beginOfYear = DateUtil.beginOfYear(new Date()); |
| | | final DateTime endOfYear = DateUtil.endOfYear(new Date()); |
| | | jkHistoryAlarms.forEach(alarm -> { |
| | | if (IndexType.COLLECT.getDescription().equals(alarm.getIndexType()) && StringUtils.isEmpty(alarm.getEnergyId())){ |
| | | alarm.setEnergyId(energyMap.get(alarm.getIndexId())); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId,null); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | /** |
| | | * 计ç®å æ¯ |
| | | */ |
| | | private void calculateProportions(List<JkHistoryAlarm> jkHistoryAlarms, List<EnergyProportion> proportionList, java.util.function.Function<JkHistoryAlarm, String> keyExtractor) { |
| | | Map<String, List<JkHistoryAlarm>> typeMap = jkHistoryAlarms.stream() |
| | | .collect(Collectors.groupingBy(keyExtractor)); |
| | | typeMap.forEach((key, value) -> { |
| | | proportionList.forEach(alarm -> { |
| | | if (alarm.getEnergyName().equals(key)) { |
| | | alarm.setCount(format2Double(value.size())); |
| | | double percentage = (double) value.size() / jkHistoryAlarms.size() * 100; |
| | | alarm.setPercentage(format2Double(percentage)); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | Integer monthCount = historyAlarmMapper.selectCountByTime(beginOfMonth,endOfMonth); |
| | | Integer yearCount = historyAlarmMapper.selectCountByTime(beginOfYear,endOfYear); |
| | | |
| | | alarmAnalysisVO.setIndexCount(indexIds.size()); |
| | | alarmAnalysisVO.setMonthCount(monthCount); |
| | | alarmAnalysisVO.setYearCount(yearCount); |
| | | return alarmAnalysisVO; |
| | | /** |
| | | * å¤çæ¥è¦æ¶é´ |
| | | */ |
| | | private void processAlarmTimes(List<JkHistoryAlarm> jkHistoryAlarms, String timeFormat) { |
| | | jkHistoryAlarms.forEach(jkHistoryAlarm -> { |
| | | String alarmBeginTime = DateUtil.format(jkHistoryAlarm.getAlarmBeginTime(), timeFormat); |
| | | jkHistoryAlarm.setAlarmTime(alarmBeginTime); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * çæå¾è¡¨æ°æ® |
| | | */ |
| | | private void generateChartData(List<ChartData> chartDataList, List<JkHistoryAlarm> jkHistoryAlarms, Date beginTime, Date endTime, String timeFormat, String queryTimeType) { |
| | | Map<String, List<JkHistoryAlarm>> timeMap = jkHistoryAlarms.stream() |
| | | .collect(Collectors.groupingBy(JkHistoryAlarm::getAlarmTime)); |
| | | while (!beginTime.after(endTime)) { |
| | | String currentTime = DateUtil.format(beginTime, timeFormat); |
| | | List<JkHistoryAlarm> value = timeMap.get(currentTime); |
| | | ChartData chartData = new ChartData(); |
| | | chartData.setXData(currentTime); |
| | | chartData.setYValue(value == null ? 0 : (double) value.size()); |
| | | chartDataList.add(chartData); |
| | | |
| | | switch (TimeType.valueOf(queryTimeType)) { |
| | | case DAY: |
| | | beginTime = DateUtil.offsetHour(beginTime, 1); |
| | | break; |
| | | case MONTH: |
| | | beginTime = DateUtil.offsetDay(beginTime, 1); |
| | | break; |
| | | default: |
| | | beginTime = DateUtil.offsetMonth(beginTime, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åå æ¯å表 |
| | | */ |
| | | private List<EnergyProportion> initializeProportionList(Object[] items) { |
| | | List<EnergyProportion> proportionList = new ArrayList<>(); |
| | | for (Object item : items) { |
| | | EnergyProportion proportion = new EnergyProportion(); |
| | | proportion.setEnergyName(item.toString()); |
| | | proportion.setCount(0D); |
| | | proportion.setPercentage(0D); |
| | | proportionList.add(proportion); |
| | | } |
| | | return proportionList; |
| | | } |
| | | |
| | | private double format2Double(double averageEnergy) { |
| | |
| | | String formattedResult = df.format(averageEnergy); |
| | | return Double.valueOf(formattedResult); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¥è¦åæç»è®¡ä¿¡æ¯ |
| | | * @param alarmAnalysisDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmAnalysisVO getCountInfo(AlarmAnalysisDTO alarmAnalysisDTO) { |
| | | |
| | | AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO(); |
| | | |
| | | ModelNode parentNode = modelNodeMapper.selectModelNodeById(alarmAnalysisDTO.getNodeId()); |
| | | if(ObjectUtils.isEmpty(parentNode)){ |
| | | return alarmAnalysisVO; |
| | | } |
| | | |
| | | // æ¥è¯¢æ¨¡åä¸çç¹ä½æ°æ® |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.getAllModelNodeIndexByAddress(parentNode.getModelCode(), parentNode.getAddress()); |
| | | alarmAnalysisVO.setIndexCount(nodeIndexInfoList.size()); |
| | | if (CollectionUtils.isEmpty(nodeIndexInfoList)) { |
| | | return alarmAnalysisVO; |
| | | } |
| | | |
| | | // è·åææ¥è¦æ°ãå¹´æ¥è¦æ° |
| | | List<String> indexIdList = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | DateTime beginOfMonth = DateUtil.beginOfMonth(new Date()); |
| | | DateTime endOfMonth = DateUtil.endOfMonth(new Date()); |
| | | DateTime beginOfYear = DateUtil.beginOfYear(new Date()); |
| | | DateTime endOfYear = DateUtil.endOfYear(new Date()); |
| | | Integer monthCount = historyAlarmMapper.selectCountByTime(beginOfMonth,endOfMonth, indexIdList); |
| | | Integer yearCount = historyAlarmMapper.selectCountByTime(beginOfYear,endOfYear, indexIdList); |
| | | |
| | | alarmAnalysisVO.setMonthCount(monthCount); |
| | | alarmAnalysisVO.setYearCount(yearCount); |
| | | return alarmAnalysisVO; |
| | | } |
| | | } |
| | |
| | | package com.zhitan.alarm.services.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zhitan.alarm.domain.HistoryAlarm; |
| | | import com.zhitan.alarm.domain.JkHistoryAlarm; |
| | |
| | | import com.zhitan.basicdata.domain.MeterImplement; |
| | | import com.zhitan.basicdata.mapper.MeterImplementMapper; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.DateUtils; |
| | | import com.zhitan.common.utils.PageUtils; |
| | | import com.zhitan.common.utils.StringUtils; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.NodeIndex; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.EnergyIndexMapper; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.mapper.NodeIndexMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @AllArgsConstructor |
| | | |
| | | @Service |
| | | public class HistoryAlarmServiceImpl implements IHistoryAlarmService { |
| | | |
| | | @Autowired |
| | | private HistoryAlarmMapper historyAlarmMapper; |
| | | @Resource |
| | | private HistoryAlarmMapper historyAlarmMapper; |
| | | |
| | | @Autowired |
| | | private MeterImplementMapper meterImplementMapper; |
| | | @Resource |
| | | private MeterImplementMapper meterImplementMapper; |
| | | |
| | | @Autowired |
| | | private EnergyIndexMapper energyIndexMapper; |
| | | @Resource |
| | | private ModelNodeMapper modelNodeMapper; |
| | | @Resource |
| | | private NodeIndexMapper nodeIndexMapper; |
| | | @Resource |
| | | private EnergyIndexMapper energyIndexMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime) { |
| | | return null; |
| | | } |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime, TimeType timeType) { |
| | | return null; |
| | | } |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime, TimeType timeType) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime, String alarmType) { |
| | | return null; |
| | | } |
| | | @Override |
| | | public List<HistoryAlarm> getHistoryAlarm(Date beginTime, Date endTime, String alarmType) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectJkHistoryAlarmList(jkHistoryAlarm); |
| | | } |
| | | @Override |
| | | public List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectJkHistoryAlarmList(jkHistoryAlarm); |
| | | } |
| | | |
| | | @Override |
| | | public List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectJkHistoryAlarmListExcel(jkHistoryAlarm); |
| | | } |
| | | @Override |
| | | public List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectJkHistoryAlarmListExcel(jkHistoryAlarm); |
| | | } |
| | | |
| | | /** |
| | | * 宿¶æ£æµ åè½ çå¤ sheet页 å±ç¤º ç»æå¾ æµç¹ æ¥è¦ä¿¡æ¯ |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectHistoryAlarmNoteList(jkHistoryAlarm); |
| | | } |
| | | /** |
| | | * 宿¶æ£æµ åè½ çå¤ sheet页 å±ç¤º ç»æå¾ æµç¹ æ¥è¦ä¿¡æ¯ |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm) { |
| | | return historyAlarmMapper.selectHistoryAlarmNoteList(jkHistoryAlarm); |
| | | } |
| | | |
| | | @Override |
| | | public void updateHistoryAlarm(String alarmCode, HistoryAlarm historyAlarm) { |
| | | historyAlarmMapper.updateHistoryAlarm(alarmCode, historyAlarm); |
| | | } |
| | | @Override |
| | | public void updateHistoryAlarm(String alarmCode, HistoryAlarm historyAlarm) { |
| | | historyAlarmMapper.updateHistoryAlarm(alarmCode, historyAlarm); |
| | | } |
| | | |
| | | @Override |
| | | public Page<JkHistoryAlarm> selectJkHistoryAlarmPage(JkHistoryAlarm jkHistoryAlarm, Long pageNum, Long pageSize) { |
| | | final Page<JkHistoryAlarm> jkHistoryAlarmPage = historyAlarmMapper.selectJkHistoryAlarmPage(jkHistoryAlarm, new Page<>(pageNum, pageSize)); |
| | | jkHistoryAlarmPage.getRecords().forEach(alarm->{ |
| | | final String indexType = alarm.getIndexType(); |
| | | final String indexId = alarm.getIndexId(); |
| | | if("COLLECT".equals(indexType) && StringUtils.isEmpty(alarm.getEnergyId())){ |
| | | //æ ¹æ®nodeIdåindexId 廿¥è¯¢è®¡éå¨å
· |
| | | EnergyIndex energyIndex = energyIndexMapper.selectEnergyIndexById(indexId); |
| | | final MeterImplement meterImplement = meterImplementMapper.selectMeterImplementById(energyIndex.getMeterId()); |
| | | alarm.setEnergyId(meterImplement.getEnergyType()); |
| | | } |
| | | }); |
| | | return jkHistoryAlarmPage; |
| | | } |
| | | |
| | | /** |
| | | * è·åå岿¥è¦åé¡µæ°æ® |
| | | * |
| | | * @param historyAlarm |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm historyAlarm) { |
| | | Page<JkHistoryAlarm> pageInfo = PageUtils.getPageInfo(JkHistoryAlarm.class); |
| | | |
| | | List<String> indexIdList = new ArrayList<>(); |
| | | if ("ALL".equals(historyAlarm.getEierarchyFlag())) { |
| | | |
| | | ModelNode modelNode = modelNodeMapper.selectModelNodeById(historyAlarm.getNodeId()); |
| | | List<ModelNodeIndexInfo> modelNodeIndexInfoList = |
| | | modelNodeMapper.getAllModelNodeIndexByAddress(modelNode.getModelCode(), modelNode.getAddress()); |
| | | if (StringUtils.isNotEmpty(historyAlarm.getIndexName())) { |
| | | modelNodeIndexInfoList = modelNodeIndexInfoList.stream() |
| | | .filter(modelNodeIndexInfo -> modelNodeIndexInfo.getIndexName().contains(historyAlarm.getIndexName())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(historyAlarm.getIndexType())) { |
| | | modelNodeIndexInfoList = modelNodeIndexInfoList.stream() |
| | | .filter(modelNodeIndexInfo -> historyAlarm.getIndexType().equals(modelNodeIndexInfo.getIndexType())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | indexIdList = modelNodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | } else { |
| | | |
| | | LambdaQueryWrapper<NodeIndex> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(NodeIndex::getNodeId, historyAlarm.getNodeId()); |
| | | List<NodeIndex> nodeIndexList = nodeIndexMapper.selectList(queryWrapper); |
| | | List<String> allIndexIdList = nodeIndexList.stream().map(NodeIndex::getIndexId).collect(Collectors.toList()); |
| | | if (ObjectUtils.isNotEmpty(allIndexIdList)) { |
| | | List<EnergyIndex> indexList = energyIndexMapper.selectEnergyIndexByIds(allIndexIdList); |
| | | if (ObjectUtils.isNotEmpty(historyAlarm.getIndexName())) { |
| | | indexList = indexList.stream().filter(energyIndex -> energyIndex.getName().contains(historyAlarm.getIndexName())).collect(Collectors.toList()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(historyAlarm.getIndexType())) { |
| | | indexList = indexList.stream().filter(energyIndex -> historyAlarm.getIndexType().equals(energyIndex.getIndexTypeCode())).collect(Collectors.toList()); |
| | | } |
| | | indexIdList = indexList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | |
| | | if (ObjectUtils.isEmpty(indexIdList)) { |
| | | return pageInfo; |
| | | } |
| | | |
| | | //æ¶é´å¤ç 妿ä¸ä¼ æ¶é´é»è®¤æ¥è¯¢å½å¤©çæ°æ® |
| | | Date endTime = DateUtils.parseDate(historyAlarm.getEndTime()); |
| | | if (ObjectUtils.isEmpty(endTime)) { |
| | | endTime = DateUtil.endOfDay(DateUtils.getNowDate()); |
| | | } |
| | | Date beginTime = DateUtils.parseDate(historyAlarm.getBeginTime()); |
| | | if (ObjectUtils.isEmpty(beginTime)) { |
| | | beginTime = DateUtil.beginOfDay(DateUtils.getNowDate()); |
| | | } |
| | | |
| | | return historyAlarmMapper.getHistoryAlarmList(beginTime, endTime,indexIdList, pageInfo); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.basicdata.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MeterImplementModel { |
| | | |
| | | /** |
| | | * indexId |
| | | */ |
| | | private String indexId; |
| | | |
| | | /** |
| | | * meterId |
| | | */ |
| | | private String meterId; |
| | | |
| | | /** |
| | | * è½æºç±»å |
| | | */ |
| | | private String energyType; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.branchanalysis.domain; |
| | | import com.zhitan.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BranchAnalysisVO { |
| | | private String until; |
| | | private double total; |
| | | @Excel(name = "èç¹id") |
| | | private String nodeId; |
| | | @Excel(name = "åèåç§°") |
| | | private String nodeName; |
| | | @Excel(name = "1æ¶/1æ¥/1æ") |
| | | private Double value0; |
| | | @Excel(name = "2æ¶/2æ¥/2æ") |
| | | private Double value1; |
| | | @Excel(name = "3æ¶/3æ¥/3æ") |
| | | private Double value2; |
| | | @Excel(name = "4æ¶/4æ¥/4æ") |
| | | private Double value3; |
| | | @Excel(name = "5æ¶/5æ¥/5æ") |
| | | private Double value4; |
| | | @Excel(name = "6æ¶/6æ¥/6æ") |
| | | private Double value5; |
| | | @Excel(name = "7æ¶/7æ¥/7æ") |
| | | private Double value6; |
| | | @Excel(name = "8æ¶/8æ¥/8æ") |
| | | private Double value7; |
| | | @Excel(name = "9æ¶/9æ¥/9æ") |
| | | private Double value8; |
| | | @Excel(name = "10æ¶/10æ¥/10æ") |
| | | private Double value9; |
| | | @Excel(name = "11æ¶/11æ¥/11æ") |
| | | private Double value10; |
| | | @Excel(name = "12æ¶/12æ¥/12æ") |
| | | private Double value11; |
| | | @Excel(name = "13æ¶/13æ¥") |
| | | private Double value12; |
| | | @Excel(name = "14æ¶/14æ¥") |
| | | private Double value13; |
| | | @Excel(name = "15æ¶/15æ¥") |
| | | private Double value14; |
| | | @Excel(name = "16æ¶/16æ¥") |
| | | private Double value15; |
| | | @Excel(name = "17æ¶/17æ¥") |
| | | private Double value16; |
| | | @Excel(name = "18æ¶18æ¥") |
| | | private Double value17; |
| | | @Excel(name = "19æ¶/19æ¥") |
| | | private Double value18; |
| | | @Excel(name = "20æ¶/20æ¥") |
| | | private Double value19; |
| | | @Excel(name = "21æ¶/21æ¥") |
| | | private Double value20; |
| | | @Excel(name = "22æ¶/22æ¥") |
| | | private Double value21; |
| | | @Excel(name = "23æ¶/23æ¥") |
| | | private Double value22; |
| | | @Excel(name = "24æ¶/24æ¥") |
| | | private Double value23; |
| | | @Excel(name = "25æ¥") |
| | | private Double value24; |
| | | @Excel(name = "26æ¥") |
| | | private Double value25; |
| | | @Excel(name = "27æ¥") |
| | | private Double value26; |
| | | @Excel(name = "28æ¥") |
| | | private Double value27; |
| | | @Excel(name = "29æ¥") |
| | | private Double value28; |
| | | @Excel(name = "30æ¥") |
| | | private Double value29; |
| | | @Excel(name = "31æ¥") |
| | | private Double value30; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.branchanalysis.mapper; |
| | | |
| | | import com.zhitan.branchanalysis.domain.BranchAnalysisVO; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *æ¯è·¯ç¨è½åæ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface BranchAnalysisMapper { |
| | | public List<BranchAnalysisVO> getBranchAnalysisList(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<TypeTime> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.branchanalysis.service; |
| | | |
| | | |
| | | import com.zhitan.branchanalysis.domain.BranchAnalysisVO; |
| | | import com.zhitan.realtimedata.domain.dto.BranchAnalysisDTO; |
| | | |
| | | |
| | | public interface IBranchAnalysisService { |
| | | /** |
| | | * æ¯è·¯ç¨è½åæ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | BranchAnalysisVO getBranchAnalysisService(BranchAnalysisDTO dataItem); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.branchanalysis.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.zhitan.branchanalysis.domain.BranchAnalysisVO; |
| | | import com.zhitan.branchanalysis.service.IBranchAnalysisService; |
| | | import com.zhitan.common.constant.TimeTypeConst; |
| | | import com.zhitan.common.exception.ServiceException; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.PropUtils; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.dataitem.mapper.DataItemMapper; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import com.zhitan.realtimedata.domain.dto.BranchAnalysisDTO; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ¯è·¯ç¨è½åæ |
| | | * |
| | | * @author zt |
| | | * @date 2025-03-27 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class BranchAnalysisServiceImpl implements IBranchAnalysisService { |
| | | |
| | | private ModelNodeMapper modelNodeMapper; |
| | | private DataItemMapper dataItemMapper; |
| | | |
| | | @Override |
| | | public BranchAnalysisVO getBranchAnalysisService(BranchAnalysisDTO dto) { |
| | | String timeType = dto.getTimeType(); |
| | | String dataTime = dto.getDataTime(); |
| | | Date beginTime = DateTimeUtil.getTime(timeType, dataTime); |
| | | DateTime endTime = null; |
| | | |
| | | List<ModelNodeIndexInfo> nodeIndexInfo = modelNodeMapper.getModelNodeIndexIdByNodeId(dto.getNodeId(), dto.getEnergyType()); |
| | | List<String> indexlist = nodeIndexInfo.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | if (ObjectUtil.isEmpty(indexlist)) { |
| | | return new BranchAnalysisVO(); |
| | | } |
| | | |
| | | List<TypeTime> dateTimeList; |
| | | //æ ¹æ®æ¶é´ç±»åè°æ´æ¶é´èå´ |
| | | switch (dto.getTimeType()) { |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | timeType = TimeTypeConst.TIME_TYPE_HOUR; |
| | | endTime = DateUtil.endOfDay(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_DAY, beginTime); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | timeType = TimeTypeConst.TIME_TYPE_DAY; |
| | | endTime = DateUtil.endOfMonth(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_MONTH, beginTime); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | timeType = TimeTypeConst.TIME_TYPE_MONTH; |
| | | endTime = DateUtil.endOfYear(beginTime); |
| | | dateTimeList = DateTimeUtil.getDateTimeListSame(TimeTypeConst.TIME_TYPE_YEAR, beginTime); |
| | | break; |
| | | default: |
| | | throw new ServiceException("æ¶é´æ ¼å¼é误"); |
| | | } |
| | | BranchAnalysisVO vo = new BranchAnalysisVO(); |
| | | if (ObjectUtil.isEmpty(indexlist)) { |
| | | return vo; |
| | | } |
| | | List<DataItem> dataItemlist = dataItemMapper.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, timeType, indexlist); |
| | | |
| | | double sum = dataItemlist.stream().mapToDouble(DataItem::getValue).sum(); |
| | | vo.setTotal(sum); |
| | | vo.setNodeId(dto.getNodeId()); |
| | | vo.setNodeName(nodeIndexInfo.get(0).getName()); |
| | | Map<Date, List<DataItem>> dateListMap = dataItemlist.stream().collect(Collectors.groupingBy(DataItem::getDataTime)); |
| | | |
| | | List<DataItem> results = new ArrayList<>(); |
| | | dateListMap.forEach((key, value) -> { |
| | | DataItem dataItem = new DataItem(); |
| | | dataItem.setDataTime(key); |
| | | //ä¿çåä½å°æ° |
| | | double totalValue = value.stream().map(data -> BigDecimal.valueOf(data.getValue())) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_UP).doubleValue(); |
| | | dataItem.setValue(totalValue); |
| | | results.add(dataItem); |
| | | }); |
| | | //æ ¹æ®æ¶é´æåº |
| | | results.sort(Comparator.comparing(DataItem::getDataTime)); |
| | | for (int i = 0; i < dateTimeList.size(); i++) { |
| | | TypeTime typeTime = dateTimeList.get(i); |
| | | Optional<DataItem> dataItem = results.stream().filter(result -> result.getDataTime().equals(typeTime.getDateTime())).findFirst(); |
| | | if (dataItem.isPresent()) { |
| | | DataItem item = dataItem.get(); |
| | | PropUtils.setValue(vo, "value" + i, item.getValue()); |
| | | } else { |
| | | PropUtils.setValue(vo, "value" + i, null); |
| | | } |
| | | } |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | |
| | | // è®¡ç®æ¯ç§è½æºçå½åå¼åå»å¹´çå¼ |
| | | for (String s : energyType) { |
| | | final double value = getValues(energyMap, upCarbonEmission,energyType); |
| | | final double lastYearValueNum = getValues(energyMap, upLastCarbonEmission,energyType); |
| | | final double value = getValues(energyMap, upCarbonEmission, s); |
| | | final double lastYearValueNum = getValues(energyMap, upLastCarbonEmission, s); |
| | | allValue += value; |
| | | allLastValue += lastYearValueNum; |
| | | final CarbonEmissionRankVO carbonEmissionRankVO = new CarbonEmissionRankVO(); |
| | |
| | | upData.add(carbonEmissionRankVOAll); |
| | | |
| | | // 计ç®ä¸æ¹çç¢³ææ¾å¹¶æåº |
| | | List<CarbonEmissionRankVO> carbonEmissionRankVOS = calculateDownCarbonEmission(beginTime, endTime, carbonEmissionDTO, energyMap,sysEnergies); |
| | | List<CarbonEmissionRankVO> carbonEmissionRankVOS = calculateDownCarbonEmission(beginTime, endTime, carbonEmissionDTO, energyMap, sysEnergies); |
| | | carbonEmissionRankVOS.sort(Comparator.comparing(CarbonEmissionRankVO::getAllValue).reversed()); |
| | | stringObjectMap.put("down", carbonEmissionRankVOS); |
| | | stringObjectMap.put("upData", upData); |
| | |
| | | |
| | | // 计ç®åæ¯å¢é¿ç |
| | | private double calculateYOY(double current, double last) { |
| | | if(last !=0.0) { |
| | | if (last != 0.0) { |
| | | return (current - last) / last * 100; |
| | | } |
| | | return 0; |
| | |
| | | } |
| | | |
| | | // 计ç®ä¸æ¹çç¢³ææ¾ |
| | | private List<CarbonEmissionRankVO> calculateDownCarbonEmission(Date beginTime, Date endTime, CarbonEmissionDTO carbonEmissionDTO, Map<String, SysEnergy> energyMap,List<SysEnergy> sysEnergies) { |
| | | private List<CarbonEmissionRankVO> calculateDownCarbonEmission(Date beginTime, Date endTime, CarbonEmissionDTO carbonEmissionDTO, Map<String, SysEnergy> energyMap, List<SysEnergy> sysEnergies) { |
| | | List<CarbonEmission> downCarbonEmission = dataItemMapper.getDownCarbonEmission(beginTime, endTime, carbonEmissionDTO.getTimeType(), carbonEmissionDTO.getNodeId()); |
| | | List<CarbonEmissionRankVO> carbonEmissionRankVOS = new ArrayList<>(); |
| | | |
| | |
| | | throw new RuntimeException("è·åç¢³ææ¾è½¬æ¢çæ¶åºé: ç³»ç»è½æºæ°æ®ä¸ä¸åå¨" + s + "è½æºç±»å"); |
| | | } |
| | | double value = v.stream().filter(ec -> ec.getEnergyId().equals(s)) |
| | | .mapToDouble(CarbonEmission::getValue) |
| | | .sum(); |
| | | .mapToDouble(CarbonEmission::getValue) |
| | | .sum(); |
| | | double calculatedValue = Double.parseDouble(df.format(sysEnergy.getCoefficient().doubleValue() * value)); |
| | | |
| | | switch (s) { |
| | |
| | | // ä¸ä¸æ¶é´æ®µçç¢³ææ¾æ°æ® |
| | | final List<CarbonEmission> lastCarbonEmissions = lastCollect.get(XAxis[i]); |
| | | // æ»å¼ |
| | | double totalValue = getValues(energyMap, carbonEmissions,energyType); |
| | | double totalValue = getValues(energyMap, carbonEmissions, energyType); |
| | | // ä¸ä¸æ¶é´æ®µçæ»å¼ |
| | | double totalLastValue = getValues(energyMap, lastCarbonEmissions,energyType); |
| | | double totalLastValue = getValues(energyMap, lastCarbonEmissions, energyType); |
| | | // å䏿¬¡çæ»å¼ |
| | | double totalFrontValue = (i == 0) ? 0.0 : getValues(energyMap, collect.get(XAxis[i - 1]),energyType); |
| | | final carbonEmissionYQVO carbonEmissionYQVO = new carbonEmissionYQVO(XAxis[i] , String.format("%.2f", totalValue) ,String.format("%.2f", calculateYOY(totalValue, totalLastValue)) , String.format("%.2f", calculateYOY(totalValue, totalFrontValue))); |
| | | double totalFrontValue = (i == 0) ? 0.0 : getValues(energyMap, collect.get(XAxis[i - 1]), energyType); |
| | | final carbonEmissionYQVO carbonEmissionYQVO = new carbonEmissionYQVO(XAxis[i], String.format("%.2f", totalValue), String.format("%.2f", calculateYOY(totalValue, totalLastValue)), String.format("%.2f", calculateYOY(totalValue, totalFrontValue))); |
| | | carbonEmissionYQVOS.add(carbonEmissionYQVO); |
| | | } |
| | | return carbonEmissionYQVOS; |
| | |
| | | } |
| | | |
| | | |
| | | public static double getValues(Map<String, SysEnergy> energyMap, List<CarbonEmission> carbonEmissions,List<String> energyType) { |
| | | public static double getValues(Map<String, SysEnergy> energyMap, List<CarbonEmission> carbonEmissions, List<String> energyTypeList) { |
| | | if (CollectionUtils.isEmpty(carbonEmissions)) { |
| | | return 0.0; |
| | | } |
| | | |
| | | // åå§åæ»å¼ |
| | | double allValue = 0.0; |
| | | |
| | | // æè½æºIDåç» |
| | | final Map<String, List<CarbonEmission>> energyValueMap = carbonEmissions.stream() |
| | | .collect(Collectors.groupingBy(CarbonEmission::getEnergyId)); |
| | | // final List<String> energyType = sysEnergies.stream().map(SysEnergy::getEnersno).collect(Collectors.toList()); |
| | | // è®¡ç®æ¯ç§è½æºçå½åå¼ |
| | | for (String s : energyType) { |
| | | SysEnergy sysEnergy = energyMap.get(s); |
| | | |
| | | for (String energyType : energyTypeList) { |
| | | // è®¡ç®æ¯ç§è½æºçå½åå¼ |
| | | SysEnergy sysEnergy = energyMap.get(energyType); |
| | | |
| | | // ç¡®ä¿è½æºåå¨ä¸ç³»æ°ä¸ä¸ºç©º |
| | | if (sysEnergy == null || sysEnergy.getCoefficient() == null) { |
| | | throw new RuntimeException("è·åç¢³ææ¾è½¬æ¢çæ¶åºé: ç³»ç»è½æºæ°æ®ä¸ä¸åå¨æç³»æ°ä¸ºç©º" + s + "è½æºç±»å"); |
| | | throw new RuntimeException("è·åç¢³ææ¾è½¬æ¢çæ¶åºé: ç³»ç»è½æºæ°æ®ä¸ä¸åå¨æç³»æ°ä¸ºç©º" + energyType + "è½æºç±»å"); |
| | | } |
| | | |
| | | // è·å对åºè½æºçå¼ |
| | | double value = energyValueMap.getOrDefault(s, Collections.emptyList()).stream() |
| | | double value = energyValueMap.getOrDefault(energyType, Collections.emptyList()).stream() |
| | | .mapToDouble(CarbonEmission::getValue) |
| | | .sum(); |
| | | |
| | | // ç´æ¥è®¡ç®æ»å¼ï¼é¿å
åä½çè½¬æ¢ |
| | | allValue += sysEnergy.getCoefficient().doubleValue() * value; |
| | | } |
| | | // æ ¼å¼åæç»ç»æ |
| | | return Double.parseDouble(new DecimalFormat("#.00").format(allValue)); |
| | | } |
| | | |
| | | public static double getValues(Map<String, SysEnergy> energyMap, List<CarbonEmission> carbonEmissions, String energyType) { |
| | | if (CollectionUtils.isEmpty(carbonEmissions)) { |
| | | return 0.0; |
| | | } |
| | | // åå§åæ»å¼ |
| | | double allValue = 0.0; |
| | | // æè½æºIDåç» |
| | | final Map<String, List<CarbonEmission>> energyValueMap = carbonEmissions.stream() |
| | | .collect(Collectors.groupingBy(CarbonEmission::getEnergyId)); |
| | | // è®¡ç®æ¯ç§è½æºçå½åå¼ |
| | | SysEnergy sysEnergy = energyMap.get(energyType); |
| | | |
| | | // ç¡®ä¿è½æºåå¨ä¸ç³»æ°ä¸ä¸ºç©º |
| | | if (sysEnergy == null || sysEnergy.getCoefficient() == null) { |
| | | throw new RuntimeException("è·åç¢³ææ¾è½¬æ¢çæ¶åºé: ç³»ç»è½æºæ°æ®ä¸ä¸åå¨æç³»æ°ä¸ºç©º" + energyType + "è½æºç±»å"); |
| | | } |
| | | |
| | | // è·å对åºè½æºçå¼ |
| | | double value = energyValueMap.getOrDefault(energyType, Collections.emptyList()).stream() |
| | | .mapToDouble(CarbonEmission::getValue) |
| | | .sum(); |
| | | |
| | | // ç´æ¥è®¡ç®æ»å¼ï¼é¿å
åä½çè½¬æ¢ |
| | | allValue += sysEnergy.getCoefficient().doubleValue() * value; |
| | | |
| | | // æ ¼å¼åæç»ç»æ |
| | | return Double.parseDouble(new DecimalFormat("#.00").format(allValue)); |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<DailyComprehensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | List<DailyComprehensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<MonthlyComprehensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | |
| | | List<MonthlyComprehensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<YearComperhensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | |
| | | List<YearComperhensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2020-03-25 |
| | | */ |
| | | public interface IDailyComprehensiveService { |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * å
¨å综åè½èç»è®¡ æ |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @return |
| | | */ |
| | | List<YearComperhensive> getYearComprehensiveList(String nodeId, List<YearComperhensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * è·åç»¼åææ åæï¼å¹´ï¼å¾è¡¨æ°æ® |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.DailyComprehensiveMapper; |
| | | import com.zhitan.comprehensivestatistics.service.IDailyComprehensiveService; |
| | |
| | | private DailyComprehensiveMapper dailyMapper; |
| | | |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return dailyMapper.getDailyComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return dailyMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.MonthlyComprehensiveMapper; |
| | | import com.zhitan.comprehensivestatistics.service.ImonthlyComprehensive; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private MonthlyComprehensiveMapper monthMapper; |
| | | |
| | | public List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return monthMapper.getMonthlyComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.constant.CommonConst; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.YearComprehensiveMapper; |
| | |
| | | |
| | | @Override |
| | | public List<YearComperhensive> getYearComprehensiveList(String nodeId, List<YearComperhensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return yearMapper.getYearComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | List<YearComperhensive> dataList = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(indexId)) { |
| | | List<YearComperhensive> listChart = yearMapper.getListChart(indexId, beginTime, endTime, timeType, indexStorageId); |
| | |
| | | } else { |
| | | yearComperhensive.setTimeCode(format); |
| | | yearComperhensive.setIndexId(indexId); |
| | | yearComperhensive.setTimeType(timeType.name()); |
| | | yearComperhensive.setTimeType(timeType); |
| | | yearComperhensive.setUnitId(first.getUnitId()); |
| | | yearComperhensive.setIndexName(first.getIndexName()); |
| | | } |
| | |
| | | package com.zhitan.consumptionanalysis.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Data |
| | | public class RankingEnergyData { |
| | | |
| | | public String nodeId; |
| | | |
| | | public String nodeName; |
| | | public String energyTypeNo; |
| | | public String energyTypeName; |
| | |
| | | import com.zhitan.dataitem.service.IDataItemService; |
| | | import com.zhitan.energyIndicators.domain.EnergyIndicators; |
| | | import com.zhitan.energyIndicators.mapper.EnergyIndicatorsMapper; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.productoutput.domain.ProductOutput; |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | |
| | | // if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | // return consumptionAnalysisVO; |
| | | // } |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime; |
| | | Date endTime; |
| | | Date lastTime; |
| | |
| | | final String parentId = dto.getNodeId(); |
| | | |
| | | //æ ¹æ®æ»ç»ç¹æ¥è¯¢ |
| | | final List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeByParentId(parentId); |
| | | final List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeByParentId(parentId); |
| | | |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList), SysEnergy::getEnersno, eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | }); |
| | | |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | |
| | | // æ ¹æ®nodeIdè·åè½æºç±»å |
| | | // ææç¹ä½ä¿¡æ¯ |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).distinct().collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).distinct().collect(Collectors.toList()); |
| | | |
| | | Date beginTime; |
| | | Date endTime; |
| | |
| | | * @param nodeId |
| | | * @return |
| | | */ |
| | | private List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInfor(String nodeId) { |
| | | List<ModelNodeIndexInfor> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); |
| | | private List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInfor(String nodeId) { |
| | | List<ModelNodeIndexInfo> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); |
| | | // 妿æ¯ç©ºåå¨ä¸¤ç§æ
åµï¼1ï¼idæé®é¢ï¼2ï¼æåºå± |
| | | if (CollectionUtils.isEmpty(nodeInforList)) { |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); |
| | | if (CollectionUtils.isNotEmpty(inforList)) { |
| | | nodeInforList.addAll(inforList); |
| | | } |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | |
| | | // if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | // return consumptionAnalysisVO; |
| | | // } |
| | | //ä¿®æ¹è¿æ»¤ç»è®¡ç¹ä½ |
| | | nodeIndexInforList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList), SysEnergy::getEnersno, eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | indexIdEnergyIdMap.put(indexId, energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime; |
| | | Date endTime; |
| | | Date lastTime; |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | |
| | | // if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | // return consumptionAnalysisVO; |
| | | // } |
| | | nodeIndexInforList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList), SysEnergy::getEnersno, eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | indexIdEnergyIdMap.put(indexId, energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String queryTimeType = dto.getTimeType(); |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeByParentId(nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeByParentId(nodeId); |
| | | final Map<String, String> nodeNameMap = new HashMap<>(); |
| | | nodeIndexInforList.forEach(n -> { |
| | | final String id = n.getNodeId(); |
| | |
| | | } |
| | | }); |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList), SysEnergy::getEnersno, eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | indexIdEnergyIdMap.put(indexId, energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String queryTimeType = dto.getTimeType(); |
| | |
| | | Map<String, BigDecimal> resultMap = new HashMap<>(); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | indexIdList.forEach(indexId -> { |
| | | final List<DataItem> dataItems = dataItemMap.get(indexId); |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.getModelNodeIndexIdByNodeId(nodeId, energyType); |
| | | |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList), SysEnergy::getEnersno, eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | indexIdEnergyIdMap.put(indexId, energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String queryTimeType = dto.getTimeType(); |
| | |
| | | import com.zhitan.costmanagement.mapper.CostPriceRelevancyMapper; |
| | | import com.zhitan.costmanagement.service.DeviationAnalysisService; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelInfoMapper; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.peakvalley.domain.ElectricityDataItem; |
| | |
| | | }else{ |
| | | out.setNodeId(nodeId); |
| | | List<StatisticsInfoListOut> child = new ArrayList<>(); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData = compute(dto.getTimeType(),dto.getDate(),nodeId,dataItemList); |
| | | BeanUtil.copyProperties(nowData,out); |
| | |
| | | for(ModelNode modelNode:modelNodeList){ |
| | | StatisticsInfoListOut out = new StatisticsInfoListOut(); |
| | | String nodeId = modelNode.getNodeId(); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData = compute(dto.getTimeType(),dto.getDate(),nodeId,dataItemList); |
| | | BeanUtil.copyProperties(nowData,out); |
| | |
| | | List<String>xData2 = new ArrayList<>(); |
| | | List<BigDecimal>yData = new ArrayList<>(); |
| | | Map<String, Object>result = new HashMap<>(); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | |
| | | String dateStr = dto.getDate(); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | |
| | | List<ElectricityDataItem> dataItemList = new ArrayList<>(); |
| | | |
| | |
| | | StatisticsDataOutItem result = new StatisticsDataOutItem(); |
| | | |
| | | // // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData = compute(dto.getTimeType(),dto.getDate(),dto.getNodeId(),dataItemList); |
| | | BeanUtil.copyProperties(nowData,result); |
| | |
| | | private StatisticsInfoListOut computeInfoList(DeviationAnalysisDTO dto,List<String>nodes,List<ModelNode>modelNodeList,String nodeId){ |
| | | StatisticsInfoListOut out = new StatisticsInfoListOut(); |
| | | List<StatisticsInfoListOut> child = new ArrayList<>(); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData = compute(dto.getTimeType(),dto.getDate(),nodeId,dataItemList); |
| | | BeanUtil.copyProperties(nowData,out); |
| | |
| | | |
| | | StatisticsInfoListOut out2 = new StatisticsInfoListOut(); |
| | | out2.setNodeId(node); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList2 = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), node); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList2 = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), node); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList2)) { |
| | | Set<String> indexSet2 = nodeIndexInfoList2.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet2 = nodeIndexInfoList2.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList2 = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet2, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData2 = compute(dto.getTimeType(),dto.getDate(),node,dataItemList2); |
| | | BeanUtil.copyProperties(nowData2,out2); |
| | |
| | | }else{ |
| | | out.setNodeId(nodeId); |
| | | List<StatisticsInfoListOut> child = new ArrayList<>(); |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), nodeId); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatisticsDeviationAnalysis(indexSet, dto.getTimeType()); |
| | | StatisticsDataOutItem nowData = compute(dto.getTimeType(),dto.getDate(),nodeId,dataItemList); |
| | | BeanUtil.copyProperties(nowData,out); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zhitan.carbonemission.domain.CarbonEmission; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData; |
| | | import com.zhitan.dataitem.domain.StagseDataEntry; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | |
| | | /** |
| | | * é¶æ®µæ°æ®å½å
¥æ¥å£ |
| | | * |
| | | * |
| | | * @author sys |
| | | * @date 2020-03-25 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®indexId䏿¶é´èå´æ¥è¯¢ç¢³ææ¾æ°æ®ï¼ä¸åé¨å |
| | | * |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®indexId䏿¶é´èå´æ¥è¯¢ç¢³ææ¾æ°æ®ï¼ä¸é´é¨å |
| | | * |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | |
| | | * @return |
| | | */ |
| | | List<CarbonEmission> getMiddleCarbonEmission(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, @Param("indexId") String indexId,@Param("emissionType") String emissionType); |
| | | @Param("timeType") String timeType, @Param("indexId") String indexId, @Param("emissionType") String emissionType); |
| | | |
| | | /** |
| | | * æ ¹æ®indexId䏿¶é´èå´æ¥è¯¢ç¢³ææ¾æ°æ®ï¼ä¸åé¨å |
| | | * |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | |
| | | * @return |
| | | */ |
| | | List<CarbonEmission> getDownCarbonEmission(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, @Param("indexId") String indexId); |
| | | @Param("timeType") String timeType, @Param("indexId") String indexId); |
| | | |
| | | /** |
| | | * æ ¹æ®indexId䏿¶é´èå´æ¥è¯¢å°æ¶çdataitemä¿¡æ¯ |
| | |
| | | |
| | | /** |
| | | * æ¥è¯¢è½æºç±»åéçµçç¨é |
| | | * |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType æ¶é´ç±»å |
| | | * @param nodeId èç¹Id |
| | | * @param timeType æ¶é´ç±»å |
| | | * @param nodeId èç¹Id |
| | | * @param energyType è½æºç±»å |
| | | * @return |
| | | */ |
| | | BigDecimal getDataItemTimeRangeValueByNodeId(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, @Param("nodeId") String nodeId, @Param("energyType") String energyType); |
| | | @Param("timeType") String timeType, @Param("nodeId") String nodeId, @Param("energyType") String energyType); |
| | | |
| | | /** |
| | | * è½æºæ¶èæå |
| | | * |
| | | * @param nodeIds |
| | | * @param timeType |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<RankingEnergyData> getHomePageConsumptionRanking(@Param("nodeIds") List<String> nodeIds, |
| | | @Param("timeType") String timeType, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime); |
| | | } |
| | |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData; |
| | | import com.zhitan.dataitem.domain.StagseDataEntry; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import com.zhitan.statisticalAnalysis.domain.dto.FlowChartsDTO; |
| | |
| | | * @return ç»æ |
| | | */ |
| | | FlowChartsVO getFlowCharts(FlowChartsDTO dto); |
| | | |
| | | /** |
| | | * è·åé¦é¡µè½èæå |
| | | * @param nodeIds |
| | | * @param timeType |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<RankingEnergyData> getHomePageConsumptionRanking(List<String> nodeIds, String timeType, Date beginTime, Date endTime); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData; |
| | | import com.zhitan.dataitem.domain.StagseDataEntry; |
| | | import com.zhitan.dataitem.domain.vo.NodeIndexValueVO; |
| | | import com.zhitan.dataitem.mapper.DataItemMapper; |
| | |
| | | .eq(ModelNode::getModelCode, dto.getModelCode()) |
| | | .isNull(ModelNode::getParentId); |
| | | List<ModelNode> modelNodes = modelNodeMapper.selectList(wrapper); |
| | | if(ObjectUtils.isEmpty(modelNodes)){ |
| | | if (ObjectUtils.isEmpty(modelNodes)) { |
| | | throw new RuntimeException("æªæ¥è¯¢å°æ¨¡åä¿¡æ¯"); |
| | | } |
| | | ModelNode modelNode = modelNodes.stream().findFirst().get(); |
| | |
| | | return flowChartsVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<RankingEnergyData> getHomePageConsumptionRanking(List<String> nodeIds, String timeType, Date beginTime, Date endTime) { |
| | | return dataItemMapper.getHomePageConsumptionRanking(nodeIds, timeType, beginTime, endTime); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®indexIdæ¥è¯¢è½èæ°æ® |
| | | */ |
| | |
| | | package com.zhitan.energydata.mapper; |
| | | |
| | | import com.zhitan.model.domain.CalcFunction; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | public interface EnergyDataStatisticMapper |
| | | { |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdByFixedNodeIds(@Param("modelCode")String modelCode,@Param("fixedNodeIds") List<String> fixedNodeIds); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdByFixedNodeIds(@Param("modelCode")String modelCode, @Param("fixedNodeIds") List<String> fixedNodeIds); |
| | | } |
| | |
| | | import com.zhitan.home.domain.vo.HomeEnergyStatisticsVO; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.EnergyIndexMapper; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.service.IEnergyIndexService; |
| | |
| | | import com.zhitan.peakvalley.domain.vo.peakvalley.*; |
| | | import com.zhitan.peakvalley.mapper.PeakValleyMapper; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æé¦ç»¼åæ²»ç大屿¥å£å®ç°ç±» |
| | | * ç»¼åæ²»ç大屿¥å£å®ç°ç±» |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class EnergyDataStatisticServiceImpl implements IEnergyDataStatisticService { |
| | | |
| | | @Autowired |
| | | private ModelNodeMapper modelNodeMapper; |
| | | @Autowired |
| | | private PeakValleyMapper electricityDataItemMapper; |
| | | @Autowired |
| | | CostPriceRelevancyMapper costPriceRelevancyMapper; |
| | | |
| | | @Autowired |
| | | CostElectricityInputMapper electricityInputMapper; |
| | | @Autowired |
| | | private IDataItemService dataItemService; |
| | | |
| | | @Autowired |
| | | private SysEnergyMapper sysEnergyMapper; |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | @Autowired |
| | | private IEnergyIndexService energyIndexService; |
| | | |
| | | @Autowired |
| | | private EnergyDataStatisticMapper statisticMapper; |
| | | |
| | | @Autowired |
| | | private EnergyIndexMapper energyIndexMapper; |
| | | |
| | | @Autowired |
| | | private MeterImplementMapper meterImplementMapper; |
| | | |
| | | @Override |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | return energyDataList; |
| | | } |
| | | final List<String> nodeIds = modelNodeList.stream().map(ModelNode::getNodeId).collect(Collectors.toList()); |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.selectIndexByNodeIds(modelCode ,nodeIds); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = modelNodeMapper.selectIndexByNodeIds(modelCode ,nodeIds); |
| | | |
| | | final Map<String, String> nodeNameMap = new HashMap<>(); |
| | | nodeIndexInforList.forEach(n->{ |
| | |
| | | }); |
| | | |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList),SysEnergy::getEnersno,eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | indexIdEnergyIdMap.put(indexId,energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date queryTime = new Date(); |
| | | Date beginTime; |
| | | Date endTime; |
| | |
| | | Map<String,BigDecimal> resultMap = new HashMap<>(); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | if (null!=indexIdList &&!indexIdList.isEmpty()){ |
| | | indexIdList.forEach(indexId -> { |
| | | final List<DataItem> dataItems = dataItemMap.get(indexId); |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(modelCode, nodeId); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(modelCode, nodeId); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime,endTime , timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | fixedNodeIds.add("dca20897-5977-40ae-a28a-88a6acdee335");//å¶ä¸ |
| | | fixedNodeIds.add("4912c751-0611-4f4b-afce-0f58629512b7");//ç²¾ç¼ |
| | | fixedNodeIds.add("8eef471f-880c-4636-a428-620a4d2ccd5d");//ç¿ä¸ |
| | | fixedNodeIds.add("6d6a0412-7c6d-4654-9cb3-0079655e23e5");//æé¦æ°ææ |
| | | fixedNodeIds.add("6d6a0412-7c6d-4654-9cb3-0079655e23e5");//æ°ææ |
| | | |
| | | LambdaQueryWrapper<ModelNode> nodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | nodeLambdaQueryWrapper.eq(ModelNode::getModelCode,modelCode); |
| | |
| | | |
| | | Map<String,ModelNode> nodeMap=nodeList.stream().collect(Collectors.toMap(ModelNode::getNodeId,x->x)); |
| | | |
| | | List<ModelNodeIndexInfor> indexList=statisticMapper.getModelNodeIndexIdByFixedNodeIds(modelCode,fixedNodeIds); |
| | | List<ModelNodeIndexInfo> indexList=statisticMapper.getModelNodeIndexIdByFixedNodeIds(modelCode,fixedNodeIds); |
| | | |
| | | |
| | | // æ ¹æ®ååºåç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = indexList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = indexList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | //æ¥è¯¢ææè½æºç±»å |
| | | final List<String> eneryIdList = indexList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final List<String> eneryIdList = indexList.stream().map(ModelNodeIndexInfo::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList),SysEnergy::getEnersno,eneryIdList); |
| | | |
| | |
| | | indexIdEnergyIdMap.put(indexId,energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = indexList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = indexList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // Date queryTime = new Date(); |
| | | Date queryTime = new Date(); |
| | | Date beginTime; |
| | |
| | | } |
| | | |
| | | //nodeåindexå
³èéå |
| | | List<ModelNodeIndexInfor> value=nodeIndexMap.get(key); |
| | | List<ModelNodeIndexInfo> value=nodeIndexMap.get(key); |
| | | |
| | | List<HomeEnergyStatisticsVO> itemVo=new ArrayList<>(); |
| | | //æ ¹æ®è½æºç±»ååç» |
| | | Map<String, List<ModelNodeIndexInfor>> sysEnergyIds = value.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getEnergyId)); |
| | | Map<String, List<ModelNodeIndexInfo>> sysEnergyIds = value.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getEnergyId)); |
| | | |
| | | if (!sysEnergyIds.isEmpty()) { |
| | | //éå |
| | | for (Map.Entry<String, List<ModelNodeIndexInfor>> entry : sysEnergyIds.entrySet()) { |
| | | for (Map.Entry<String, List<ModelNodeIndexInfo>> entry : sysEnergyIds.entrySet()) { |
| | | String energyIndex = entry.getKey(); |
| | | List<ModelNodeIndexInfor> energyValue = entry.getValue(); |
| | | List<ModelNodeIndexInfo> energyValue = entry.getValue(); |
| | | if (energyCoefficientMap.containsKey(energyIndex)) { |
| | | SysEnergy sysEnergy = energyCoefficientMap.get(energyIndex); |
| | | HomeEnergyStatisticsVO item = new HomeEnergyStatisticsVO(); |
| | |
| | | BigDecimal totalConsumption = BigDecimal.ZERO; |
| | | BigDecimal totalCount = BigDecimal.ZERO; |
| | | //åè®¡å¼ |
| | | for (ModelNodeIndexInfor valueItem:entry.getValue()){ |
| | | for (ModelNodeIndexInfo valueItem:entry.getValue()){ |
| | | List<DataItem> dataItems = dataItemMap.get(valueItem.getIndexId()); |
| | | if (CollectionUtils.isNotEmpty(dataItems)) { |
| | | BigDecimal sum = BigDecimal.valueOf(dataItems.stream() |
| | |
| | | if (ObjectUtils.isEmpty(modelNode)) { |
| | | return voList; |
| | | } |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // éè¿indexIdsæ¾data_Itemæ°æ® |
| | | List<DataItem> itemList = dataItemService.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, shixuTimeType, indexIds); |
| | | // æ¥è¯¢ç¹ä½è¯¦ç»ä¿¡æ¯ |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zhitan.basicdata.domain.SysEnergy; |
| | | import com.zhitan.basicdata.mapper.SysEnergyMapper; |
| | | import com.zhitan.common.constant.CommonConst; |
| | | import com.zhitan.common.core.domain.entity.SysDictData; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData; |
| | |
| | | import com.zhitan.home.service.impl.IHomePageService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.service.IEnergyIndexService; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | public class HomePageServiceImpl implements IHomePageService { |
| | | |
| | | private final SysEnergyMapper sysEnergyMapper; |
| | | |
| | | private final IModelNodeService modelNodeService; |
| | | |
| | | private final IDataItemService dataItemService; |
| | | |
| | | private final IEnergyIndexService energyIndexService; |
| | | |
| | | private final ISysDictDataService sysDictDataService; |
| | | |
| | | @Resource |
| | | private ModelNodeMapper modelNodeMapper; |
| | | @Resource |
| | | private PeakValleyMapper electricityDataItemMapper; |
| | | |
| | | |
| | |
| | | |
| | | DateTime tongbiTime = DateUtil.offsetMonth(currentTime, -12); |
| | | DateTime huanbiTime = DateUtil.offsetMonth(currentTime, -1); |
| | | if(TimeType.DAY.name().equals( timeType)){ |
| | | if (TimeType.DAY.name().equals(timeType)) { |
| | | huanbiTime = DateUtil.offsetDay(currentTime, -1); |
| | | } |
| | | |
| | |
| | | final Map<String, List<HomeEnergyStatisticsVO>> tongbiMap = tongbi.stream().collect(Collectors.groupingBy(HomeEnergyStatisticsVO::getEnergyNo)); |
| | | final Map<String, List<HomeEnergyStatisticsVO>> huanbiMap = huanbi.stream().collect(Collectors.groupingBy(HomeEnergyStatisticsVO::getEnergyNo)); |
| | | |
| | | current.stream().forEach(vo->{ |
| | | current.stream().forEach(vo -> { |
| | | final String energyNo = vo.getEnergyNo(); |
| | | final Double count = vo.getCount(); |
| | | final Double tongbiCount = tongbiMap.get(energyNo).stream().map(HomeEnergyStatisticsVO::getCount).mapToDouble(Double::doubleValue).sum(); |
| | | final Double huanbiCount = huanbiMap.get(energyNo).stream().map(HomeEnergyStatisticsVO::getCount).mapToDouble(Double::doubleValue).sum(); |
| | | |
| | | vo.setTonCount(format2Double( vo.getCount() * Double.valueOf(vo.getCoefficient()))); |
| | | vo.setTonCount(format2Double(vo.getCount() * Double.valueOf(vo.getCoefficient()))); |
| | | if (tongbiCount != 0) { |
| | | vo.setTongbi(format2Double( (count - tongbiCount) / tongbiCount * 100)); |
| | | }else { |
| | | vo.setTongbi(format2Double((count - tongbiCount) / tongbiCount * 100)); |
| | | } else { |
| | | vo.setTongbi(0D); |
| | | } |
| | | |
| | | if (huanbiCount != 0) { |
| | | vo.setHuanbi (format2Double((count - huanbiCount) / huanbiCount * 100)); |
| | | }else { |
| | | vo.setHuanbi(format2Double((count - huanbiCount) / huanbiCount * 100)); |
| | | } else { |
| | | vo.setHuanbi(0D); |
| | | } |
| | | }); |
| | |
| | | if (ObjectUtils.isEmpty(modelNode)) { |
| | | return voList; |
| | | } |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // éè¿indexIdsæ¾data_Itemæ°æ® |
| | | List<DataItem> itemList = dataItemService.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, shixuTimeType, indexIds); |
| | | // æ¥è¯¢ç¹ä½è¯¦ç»ä¿¡æ¯ |
| | |
| | | List<String> indexs = energyTypeMap.get(ratioVO.getEnergyNo()); |
| | | if (CollectionUtils.isEmpty(indexs)) { |
| | | ratioVO.setCount(0D); |
| | | }else { |
| | | } else { |
| | | // æ¾å°åè®¡å¼ |
| | | double doubleCount = itemList.stream().filter(li -> indexs.contains(li.getIndexId())).mapToDouble(DataItem::getValue).sum(); |
| | | ratioVO.setCount(format2Double(doubleCount)); |
| | |
| | | List<HomePeakValleyVO> voList = new ArrayList<>(); |
| | | // æ¥è¯¢å¨å
፱Ȍ |
| | | final List<SysDictData> electricityPrice = sysDictDataService.selectDictDataByType("electricity_price"); |
| | | electricityPrice.stream().forEach(v->{ |
| | | electricityPrice.stream().forEach(v -> { |
| | | HomePeakValleyVO vo = new HomePeakValleyVO(); |
| | | vo.setTimeName(v.getDictLabel()); |
| | | vo.setTimeType(v.getDictValue()); |
| | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap; |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | final ModelNode firstModeNodeInfo = modelNodeMapper.getFirstModeNodeInfo(modelcode); |
| | | if(null == firstModeNodeInfo){ |
| | | if (null == firstModeNodeInfo) { |
| | | return voList; |
| | | } |
| | | |
| | | double totalElectric; |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(modelcode, firstModeNodeInfo.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(modelcode, firstModeNodeInfo.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, beginTime, endTime, shixuTimeType); |
| | | if(null != dataItemList){ |
| | | if (null != dataItemList) { |
| | | totalElectric = dataItemList.stream().map(ElectricityDataItem::getElectricity).mapToDouble(BigDecimal::doubleValue).sum(); |
| | | } else { |
| | | totalElectric = 0; |
| | |
| | | totalElectric = 0; |
| | | electricityDataMap = null; |
| | | } |
| | | if(null != electricityDataMap) { |
| | | if (null != electricityDataMap) { |
| | | voList.stream().forEach(vo -> { |
| | | final List<ElectricityDataItem> electricityDataItems = electricityDataMap.get(vo.getTimeType()); |
| | | if(null != electricityDataItems) { |
| | | if (null != electricityDataItems) { |
| | | final double sum = electricityDataItems.stream().map(ElectricityDataItem::getElectricity).mapToDouble(BigDecimal::doubleValue).sum(); |
| | | vo.setCount(format2Double(sum)); |
| | | if(totalElectric != 0) { |
| | | if (totalElectric != 0) { |
| | | vo.setPercentage(format2Double(sum / totalElectric * 100)); |
| | | } |
| | | } |
| | |
| | | List<String> xdataList = new ArrayList<>(); |
| | | // æ¥è¯¢ææè½æºç±»å |
| | | List<SysEnergy> sysEnergies = sysEnergyMapper.selectSysEnergyList(new SysEnergy()); |
| | | final Map<String, Object> energyCollectMap = sysEnergies.stream().collect(Collectors.toMap(SysEnergy::getEnersno, SysEnergy::getCoefficient)); |
| | | final Map<String, String> energyNameMap = sysEnergies.stream().collect(Collectors.toMap(SysEnergy::getEnersno, SysEnergy::getEnername)); |
| | | |
| | | |
| | | Date queryTime = new Date(); |
| | | // Date queryTime = DateUtil.parseDateTime("2023-03-28 00:00:00"); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String shixuTimeType; |
| | |
| | | if (ObjectUtils.isEmpty(modelNode)) { |
| | | return vo; |
| | | } |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelNode.getNodeId()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // éè¿indexIdsæ¾data_Itemæ°æ® |
| | | List<DataItem> itemList = dataItemService.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, shixuTimeType, indexIds); |
| | | final Map<String, List<DataItem>> dataItemMap = itemList.stream().collect(Collectors.groupingBy(li -> DateUtil.format(li.getDataTime(), timeFormat))); |
| | |
| | | .filter(l -> StringUtils.isNotEmpty(l.getEnergyId())).collect(Collectors.groupingBy( |
| | | EnergyIndex::getEnergyId, Collectors.mapping(EnergyIndex::getIndexId, Collectors.toList()) |
| | | )); |
| | | |
| | | List<String> lengList = new ArrayList<>(); |
| | | |
| | | while (!beginTime.after(endTime)) { |
| | | final String currentTime = DateUtil.format(beginTime, timeFormat); |
| | | xdataList.add(currentTime); |
| | | final List<DataItem> dataItems = dataItemMap.get(currentTime); |
| | | List<Double> energyCount = new ArrayList<>(); |
| | | energyTypeMap.forEach((energyType,IndexIdList)->{ |
| | | double sum; |
| | | if(null == dataItems){ |
| | | sum = 0; |
| | | }else { |
| | | sum = dataItems.stream().filter(li -> IndexIdList.contains(li.getIndexId())).mapToDouble(DataItem::getValue).sum(); |
| | | |
| | | sysEnergies.forEach(x -> { |
| | | if(!lengList.contains(x.getEnername())){ |
| | | lengList.add(x.getEnername()); |
| | | } |
| | | final BigDecimal coefficient = (BigDecimal) energyCollectMap.get(energyType); |
| | | energyCount.add(sum * coefficient.doubleValue()); |
| | | List<String> indexIdList = energyTypeMap.get(x.getEnersno()); |
| | | double sum; |
| | | if (null == dataItems || CollectionUtils.isEmpty(indexIdList)) { |
| | | sum = 0; |
| | | } else { |
| | | sum = dataItems.stream().filter(li -> indexIdList.contains(li.getIndexId())).mapToDouble(DataItem::getValue).sum(); |
| | | } |
| | | energyCount.add(sum * x.getCoefficient().doubleValue()); |
| | | }); |
| | | ydataList.add(energyCount); |
| | | |
| | | switch (TimeType.valueOf(timeType)) { |
| | | case DAY: |
| | | beginTime = DateUtil.offsetHour(beginTime, 1); |
| | |
| | | } |
| | | vo.setXdata(xdataList.toArray(new String[0])); |
| | | Double[][] array = new Double[sysEnergies.size()][xdataList.size()]; |
| | | List<String> lengList = new ArrayList<>(); |
| | | energyCollectMap.keySet().forEach(key->{ |
| | | final String name = energyNameMap.get(key); |
| | | lengList.add(name); |
| | | }); |
| | | |
| | | for(int i = 0; i < ydataList.size(); i++){ |
| | | for (int i = 0; i < ydataList.size(); i++) { |
| | | final List<Double> doubleList = ydataList.get(i); |
| | | for(int n = 0; n < doubleList.size(); n++){ |
| | | for (int n = 0; n < doubleList.size(); n++) { |
| | | array[n][i] = format2Double(doubleList.get(n)); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<RankingEnergyData> energyConsumptionRanking(String modelcode, String timeType) { |
| | | public List<RankingEnergyData> energyConsumptionRanking(String modelCode, String timeType) { |
| | | |
| | | List<RankingEnergyData> energyDataList = new ArrayList<>(); |
| | | String nodeCategory = "2"; |
| | | LambdaQueryWrapper<ModelNode> modelNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | modelNodeLambdaQueryWrapper.eq(ModelNode::getModelCode,modelcode); |
| | | modelNodeLambdaQueryWrapper.eq(ModelNode::getNodeCategory,nodeCategory); |
| | | List<ModelNode> modelNodeList = modelNodeMapper.selectList(modelNodeLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty(modelNodeList)){ |
| | | return energyDataList; |
| | | } |
| | | final List<String> nodeIds = modelNodeList.stream().map(ModelNode::getNodeId).collect(Collectors.toList()); |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = modelNodeMapper.selectIndexByNodeIds(modelcode ,nodeIds); |
| | | |
| | | final Map<String, String> nodeNameMap = new HashMap<>(); |
| | | nodeIndexInforList.forEach(n->{ |
| | | final String id = n.getNodeId(); |
| | | final String name = n.getName(); |
| | | if(!nodeNameMap.containsKey(id)){ |
| | | nodeNameMap.put(id,name); |
| | | } |
| | | }); |
| | | |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList),SysEnergy::getEnersno,eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | | //è½æºç¼å·åè½æºææ ç³»æ° |
| | | final Map<String, Object> energyCoefficientMap = sysEnergies.stream().collect(Collectors.toMap(SysEnergy::getEnersno, SysEnergy::getCoefficient)); |
| | | //indexåè½æº |
| | | final Map<String, String> indexIdEnergyIdMap = new HashMap<>(); |
| | | nodeIndexInforList.forEach(n->{ |
| | | final String indexId = n.getIndexId(); |
| | | final String energyId = n.getEnergyId(); |
| | | if(!indexIdEnergyIdMap.containsKey(indexId)){ |
| | | indexIdEnergyIdMap.put(indexId,energyId); |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | Date queryTime = new Date(); |
| | | // Date queryTime = DateUtil.parseDateTime("2023-03-28 00:00:00"); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String shixuTimeType; |
| | | if (TimeType.DAY.name().equals(timeType)) { |
| | | beginTime = DateUtil.beginOfDay(queryTime); |
| | | endTime = DateUtil.endOfDay(queryTime); |
| | | shixuTimeType = TimeType.HOUR.name(); |
| | | timeType = TimeType.HOUR.name(); |
| | | // æ |
| | | } else if (TimeType.MONTH.name().equals(timeType)) { |
| | | beginTime = DateUtil.beginOfMonth(queryTime); |
| | | endTime = DateUtil.endOfMonth(queryTime); |
| | | shixuTimeType = TimeType.DAY.name(); |
| | | timeType = TimeType.DAY.name(); |
| | | |
| | | // å¹´ |
| | | } else { |
| | | } else if (TimeType.YEAR.name().equals(timeType)) { |
| | | beginTime = DateUtil.beginOfYear(queryTime); |
| | | endTime = DateUtil.endOfYear(queryTime); |
| | | shixuTimeType = TimeType.MONTH.name(); |
| | | timeType = TimeType.MONTH.name(); |
| | | |
| | | } else { |
| | | return energyDataList; |
| | | } |
| | | // æ ¹æ®indexIdæ¥è¯¢dataItem |
| | | List<DataItem> dataItemList = new ArrayList<>(); |
| | | if(CollectionUtils.isNotEmpty(indexIds)) { |
| | | dataItemList = dataItemService.getDataItemTimeRangeInforByIndexIds(beginTime, endTime, shixuTimeType, indexIds); |
| | | |
| | | LambdaQueryWrapper<ModelNode> parentNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | parentNodeLambdaQueryWrapper.eq(ModelNode::getModelCode, modelCode); |
| | | List<ModelNode> modelNodeList = modelNodeMapper.selectList(parentNodeLambdaQueryWrapper); |
| | | if (CollectionUtils.isEmpty(modelNodeList)) { |
| | | return energyDataList; |
| | | } |
| | | Map<String, List<DataItem>> dataItemMap = dataItemList.stream().collect(Collectors.groupingBy(DataItem::getIndexId)); |
| | | |
| | | Map<String,BigDecimal> resultMap = new HashMap<>(); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | |
| | | indexIdList.forEach(indexId->{ |
| | | final List<DataItem> dataItems = dataItemMap.get(indexId); |
| | | final String energyId = indexIdEnergyIdMap.get(indexId); |
| | | final BigDecimal coefficient = (BigDecimal) energyCoefficientMap.get(energyId); |
| | | |
| | | if(CollectionUtils.isNotEmpty(dataItems) ){ |
| | | BigDecimal sum = BigDecimal.valueOf(dataItems.stream() |
| | | .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP).multiply(coefficient); |
| | | |
| | | if (resultMap.containsKey(key)) { |
| | | resultMap.put(key, resultMap.get(key).add(sum)); |
| | | } else { |
| | | resultMap.put(key, sum); |
| | | } |
| | | } |
| | | }); |
| | | ModelNode parentNode = modelNodeList.stream().filter(x -> ObjectUtils.isEmpty(x.getParentId())).findFirst().orElse(null); |
| | | if (ObjectUtils.isEmpty(parentNode)) { |
| | | return energyDataList; |
| | | } |
| | | List<String> nodeIds = modelNodeList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getParentId()) && parentNode.getNodeId().equals(x.getParentId())) |
| | | .map(ModelNode::getNodeId).collect(Collectors.toList()); |
| | | if (ObjectUtils.isEmpty(nodeIds)) { |
| | | return energyDataList; |
| | | } |
| | | energyDataList = dataItemService.getHomePageConsumptionRanking(nodeIds, timeType, beginTime, endTime); |
| | | energyDataList.forEach(x -> { |
| | | x.energyConsumption = new BigDecimal(x.energyConsumption).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | }); |
| | | |
| | | resultMap.forEach((key,value)->{ |
| | | RankingEnergyData rankingEnergyData = new RankingEnergyData(); |
| | | rankingEnergyData.setNodeId(key); |
| | | rankingEnergyData.setNodeName(nodeNameMap.get(key)); |
| | | rankingEnergyData.setEnergyConsumption(value.doubleValue()); |
| | | energyDataList.add(rankingEnergyData); |
| | | }); |
| | | Collections.sort(energyDataList, Comparator.comparingDouble((RankingEnergyData item) -> item.getEnergyConsumption()).reversed()); |
| | | // è·åå5æ¡è®°å½ |
| | | List<RankingEnergyData> top5Items = energyDataList.subList(0, Math.min(5, energyDataList.size())); |
| | | |
| | | return top5Items; |
| | | return energyDataList; |
| | | } |
| | | } |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<DailyKeyEquipment> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<DailyKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<FacilityArchives> getFacilityArchives(); |
| | | List<FacilityArchives> getPointFacility(); |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<MonthlyKeyEquipment> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<MonthlyKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface YearKeyEquipmentMapper { |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<YearKeyEquipment> dataList, |
| | | @Param("dataList") List<TypeTime> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<YearKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | @Param("timeType") String timeType |
| | | ); |
| | | |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IDailyKeyEquipmentService { |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | public List<FacilityArchives> getFacilityArchives(); |
| | | public List<FacilityArchives> getPointFacility(); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IMonthlyKeyEquipmentService { |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | |
| | | List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IYearKeyEquipmentService { |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<YearKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<YearKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | List<YearKeyEquipment> getListChart(DataItemQueryDTO queryDto); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.DailyKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IDailyKeyEquipmentService; |
| | |
| | | @Autowired |
| | | private DailyKeyEquipmentMapper dailyKeyEquipmentMapper; |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return dailyKeyEquipmentMapper.getdailyKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return dailyKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.MonthlyKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IMonthlyKeyEquipmentService; |
| | |
| | | private MonthlyKeyEquipmentMapper monthlyKeyEquipmentMapper; |
| | | |
| | | @Override |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return monthlyKeyEquipmentMapper.getMonthlyKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthlyKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.YearKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IYearKeyEquipmentService; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Autowired |
| | | private YearKeyEquipmentMapper yearKeyEquipmentMapper; |
| | | |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<YearKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return yearKeyEquipmentMapper.getYearKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<YearKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return yearKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | public List<YearKeyEquipment> getListChart(DataItemQueryDTO queryDto){ |
| | | if(ObjectUtils.isEmpty(queryDto.getIndexId())){ |
| | | return Collections.emptyList();} |
| | | Date convertTime = DateTimeUtil.getTime(queryDto.getTimeType(), queryDto.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | return yearKeyEquipmentMapper.getListChart(queryDto.getIndexId(),beginTime,endTime,queryDto.getTimeType()); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.model.domain.vo; |
| | | |
| | | |
| | | import com.zhitan.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 模åèç¹ä¸ç¹ä½å
³ç³»å¯¹è±¡ |
| | | * |
| | | * @Author: Zhujw |
| | | * @Date: 2023/3/2 |
| | | */ |
| | | @Data |
| | | public class ModelNodeIndexInfo extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 模ååç§° |
| | | */ |
| | | private String modelName; |
| | | /** |
| | | * 模åç¼ç |
| | | */ |
| | | private String modelCode; |
| | | /** |
| | | * èç¹id |
| | | */ |
| | | private String nodeId; |
| | | /** |
| | | * èç¹åç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * èç¹ç¼ç |
| | | */ |
| | | private String nodeCode; |
| | | /** |
| | | * åç§° |
| | | */ |
| | | private String nodeName; |
| | | /** |
| | | * ç¹ä½id |
| | | */ |
| | | private String indexId; |
| | | /** |
| | | * ç¹ä½åç§° |
| | | */ |
| | | private String indexName; |
| | | /** |
| | | * ç¹ä½ç¼ç |
| | | */ |
| | | private String indexCode; |
| | | |
| | | /** |
| | | * è½æºç±»å |
| | | */ |
| | | private String energyId; |
| | | /** |
| | | * ç¹ä½ç±»å |
| | | */ |
| | | private String indexType; |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unitId; |
| | | } |
| | |
| | | |
| | | |
| | | import com.zhitan.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 模åèç¹ä¸ç¹ä½å
³ç³»å¯¹è±¡ |
| | |
| | | * @Author: Zhujw |
| | | * @Date: 2023/3/2 |
| | | */ |
| | | @Data |
| | | public class ModelNodeIndexInfor extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | private String energyId; |
| | | |
| | | private String indexType; |
| | | |
| | | public String getNodeId() { |
| | | return nodeId; |
| | | } |
| | | |
| | | public void setNodeId(String nodeId) { |
| | | this.nodeId = nodeId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getIndexId() { |
| | | return indexId; |
| | | } |
| | | |
| | | public void setIndexId(String indexId) { |
| | | this.indexId = indexId; |
| | | } |
| | | |
| | | public String getEnergyId() { |
| | | return energyId; |
| | | } |
| | | |
| | | public void setEnergyId(String energyId) { |
| | | this.energyId = energyId; |
| | | } |
| | | |
| | | public String getIndexType() { |
| | | return indexType; |
| | | } |
| | | |
| | | public void setIndexType(String indexType) { |
| | | this.indexType = indexType; |
| | | } |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unitId; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zhitan.basicdata.domain.vo.MeterImplementModel; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.EnergyIndexQuery; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<EnergyIndex> selectEnergyIndex(EnergyIndexQuery query); |
| | | |
| | | void removeNodeIndex(@Param("nodeId")String nodeId, @Param("indexIds")List<String> indexIds); |
| | | void removeEnergyIndex(@Param("indexIds")List<String> indexIds); |
| | | |
| | | void saveEnergyIndex(List<EnergyIndex> insertData); |
| | | |
| | |
| | | |
| | | List<EnergyIndex> getIndexByMeterIdIndexCode(@Param("meterId") String meterId, @Param("indexCode") String indexCode, @Param("nodeId") String nodeId); |
| | | |
| | | int deleteByIndexId(String indexId); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexInfoListByIndexIds(@Param("indexIds") String[] indexIds); |
| | | |
| | | List<MeterImplementModel> selectEnergyTypeByIndex(@Param("indexIds") List<String> indexIds); |
| | | } |
| | |
| | | import com.zhitan.dataitem.domain.vo.NodeIndexValueVO; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByCode(@Param("code") String code); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByCode(@Param("code") String code); |
| | | |
| | | /** |
| | | * æ ¹æ®nodeIdæ¥è¯¢å¯¹åºè¯¦ç»ä¿¡æ¯ |
| | |
| | | * @param nodeId |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByNodeId(@Param("nodeId") String nodeId); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByNodeId(@Param("nodeId") String nodeId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶idæ¥è¯¢è¯¦ç»ä¿¡æ¯ |
| | |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInforByParentId(@Param("parentId") String parentId); |
| | | List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInforByParentId(@Param("parentId") String parentId); |
| | | |
| | | /** |
| | | * æ ¹æ®codeæ¥è¯¢ç¶çº§ä¿¡æ¯ |
| | |
| | | * @param nodeId èç¹id |
| | | * @return ç»æ |
| | | */ |
| | | List<ModelNodeIndexInfor> selectIndexByModelCodeAndNodeId(@Param("modelCode") String modelCode, @Param("nodeId") String nodeId); |
| | | List<ModelNodeIndexInfo> selectIndexByModelCodeAndNodeId(@Param("modelCode") String modelCode, @Param("nodeId") String nodeId); |
| | | |
| | | void delIndexNodeIdAndIndexType(@Param("nodeId")String nodeId, @Param("indexType")String indexType); |
| | | |
| | |
| | | * @author: hmj |
| | | * @date: 2024/10/16 19:16 |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdByNodeId(@Param("nodeId")String nodeId, @Param("energyType")String energyType); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdByNodeId(@Param("nodeId")String nodeId, @Param("energyType")String energyType); |
| | | |
| | | /** |
| | | * @description: æ ¹æ®nodeIdæ¥è¯¢åèç¹çææç»è®¡ææ |
| | |
| | | * @author: hmj |
| | | * @date: 2024/10/18 16:12 |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeByParentId(String parentId); |
| | | List<ModelNodeIndexInfo> getModelNodeByParentId(String parentId); |
| | | |
| | | ModelNode getFirstModeNodeInfo(String modelCode); |
| | | |
| | | List<ModelNodeIndexInfor> selectIndexByNodeIds(@Param("modelCode") String modelCode,@Param("nodeIds") List<String> nodeIds); |
| | | List<ModelNodeIndexInfo> selectIndexByNodeIds(@Param("modelCode") String modelCode, @Param("nodeIds") List<String> nodeIds); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶èç¹idåè½æºç±»åæ¥è¯¢ç¹ä½ä¸ç累积é |
| | |
| | | @Param("energyType") String energyType, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("dateTimeMap") Map<String, LocalDateTime> dateTimeMap); |
| | | |
| | | /** |
| | | * éè¿èç¹å°åæ¥è¯¢èç¹ä¸ååèç¹ä¸çææç¹ä½ä¿¡æ¯ |
| | | */ |
| | | List<ModelNodeIndexInfo> getAllModelNodeIndexByAddress(@Param("modelCode") String modelCode, @Param("address") String address); |
| | | } |
| | |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.EnergyIndexQuery; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | List<EnergyIndex> searchIndexByNodeAndChildrenNode(String nodeId, String filter); |
| | | |
| | | void removeNodeIndex(String nodeId, List<String> removeLink); |
| | | void removeEnergyIndex(List<String> removeLink); |
| | | |
| | | AjaxResult importEnergyIndex(List<EnergyIndex> energyIndexList, boolean updateSupport); |
| | | |
| | |
| | | List<EnergyIndex> listDeviceIndex(String nodeId, String meterId); |
| | | |
| | | /** |
| | | * éè¿idå é¤ééç¹ |
| | | * æ ¹æ®ç¹ä½idè·å模åèç¹ç¹ä½ä¿¡æ¯ |
| | | * @param indexIds |
| | | * @return |
| | | */ |
| | | boolean deleteByIndexId(String indexId); |
| | | |
| | | List<ModelNodeIndexInfo> getModelNodeIndexInfoListByIndexIds(String[] indexIds); |
| | | } |
| | |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.TreeObject; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByCode(String code); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByCode(String code); |
| | | |
| | | /** |
| | | * æ ¹æ®nodeIdæ¥è¯¢å¯¹åºè¯¦ç»ä¿¡æ¯ |
| | |
| | | * @param nodeId |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByNodeId(String nodeId); |
| | | List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByNodeId(String nodeId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶idæ¥è¯¢è¯¦ç»ä¿¡æ¯ |
| | |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInforByParentId(String parentId); |
| | | List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInforByParentId(String parentId); |
| | | |
| | | /** |
| | | * æ ¹æ®codeæ¥è¯¢ç¶çº§ä¿¡æ¯ |
| | |
| | | package com.zhitan.model.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zhitan.basicdata.domain.MeterImplement; |
| | | import com.zhitan.basicdata.services.IMeterImplementService; |
| | |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.EnergyIndexQuery; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.EnergyIndexMapper; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.service.IDaqTemplateService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void removeNodeIndex(String nodeId, List<String> removeLink) { |
| | | energyIndexMapper.removeNodeIndex(nodeId, removeLink); |
| | | public void removeEnergyIndex(List<String> removeLink) { |
| | | energyIndexMapper.removeEnergyIndex(removeLink); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return energyIndexList; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean deleteByIndexId(String indexId) { |
| | | return energyIndexMapper.deleteByIndexId(indexId) > 0; |
| | | public List<ModelNodeIndexInfo> getModelNodeIndexInfoListByIndexIds(String[] indexIds) { |
| | | return energyIndexMapper.getModelNodeIndexInfoListByIndexIds(indexIds); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zhitan.basicdata.services.IMeterImplementService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelInfo; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.domain.vo.PointDataVO; |
| | | import com.zhitan.model.mapper.ModelInfoMapper; |
| | | import com.zhitan.model.service.IEnergyIndexService; |
| | |
| | | public List<PointDataVO> listEnergyIndexByModelId(String modelId) { |
| | | List<PointDataVO> voList = new ArrayList<>(); |
| | | // æ ¹æ®idæ¥è¯¢ä¸çº§idä¸indexId |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(modelId); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(modelId); |
| | | if (CollectionUtils.isEmpty(inforList)) { |
| | | List<ModelNodeIndexInfor> indexInforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelId); |
| | | List<ModelNodeIndexInfo> indexInforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(modelId); |
| | | if (CollectionUtils.isEmpty(indexInforList)) { |
| | | return voList; |
| | | } |
| | | inforList.addAll(indexInforList); |
| | | } |
| | | // å»é¤ææç¹ä½idä¿¡æ¯ |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = inforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | List<EnergyIndex> energyIndexList = energyIndexService.getEnergyIndexByIds(indexIds); |
| | | // æ ¹æ®indexidæ¥è¯¢å¯¹åºè®¡éå¨å
·ä¿¡æ¯ |
| | | List<String> meterIds = energyIndexList.stream().map(EnergyIndex::getMeterId).collect(Collectors.toList()); |
| | |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.domain.TreeObject; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.model.service.IEnergyIndexService; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByCode(String code) { |
| | | public List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByCode(String code) { |
| | | return modelNodeMapper.getModelNodeIndexIdRelationInforByCode(code); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ModelNodeIndexInfor> getModelNodeIndexIdRelationInforByNodeId(String nodeId) { |
| | | public List<ModelNodeIndexInfo> getModelNodeIndexIdRelationInforByNodeId(String nodeId) { |
| | | return modelNodeMapper.getModelNodeIndexIdRelationInforByNodeId(nodeId); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInforByParentId(String parentId) { |
| | | public List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInforByParentId(String parentId) { |
| | | return modelNodeMapper.listModelNodeIndexIdRelationInforByParentId(parentId); |
| | | } |
| | | |
| | |
| | | @Excel(name = "ç»ææ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | private String remark; |
| | | |
| | | |
| | | // /** æ¯å¦é¶æ¢¯ä»·æ ¼0å¦1æ¯ */ |
| | | // @Excel(name = "æ¯å¦é¶æ¢¯ä»·æ ¼0å¦1æ¯") |
| | | // private String type; |
| | |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | |
| | | @Override |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | @Override |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | } |
| | |
| | | import com.zhitan.common.enums.ElectricityTypeEnum; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.DateUtils; |
| | | import com.zhitan.costmanagement.domain.vo.CostPriceRelevancyVo; |
| | | import com.zhitan.costmanagement.mapper.CostPriceRelevancyMapper; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.mapper.ModelNodeMapper; |
| | | import com.zhitan.peakvalley.domain.ElectricityDataItem; |
| | | import com.zhitan.peakvalley.domain.dto.ElectricityDataItemListDTO; |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | // æ ¹æ®å°æ¶æ°æ®è®¡ç®å¤©çæ°æ® |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, TimeType.HOUR.name()); |
| | | |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | |
| | | * è´è´£äººçµè¯ |
| | | */ |
| | | private String principalsTel; |
| | | |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Data |
| | | public class DailyProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | private String unitId; |
| | | @Excel(name = "1æ¶") |
| | | private Double value1; |
| | | @Excel(name = "2æ¶") |
| | | private Double value2; |
| | | @Excel(name = "3æ¶") |
| | | private Double value3; |
| | | @Excel(name = "4æ¶") |
| | | private Double value4; |
| | | @Excel(name = "5æ¶") |
| | | private Double value5; |
| | | @Excel(name = "6æ¶") |
| | | private Double value6; |
| | | @Excel(name = "7æ¶") |
| | | private Double value7; |
| | | @Excel(name = "8æ¶") |
| | | private Double value8; |
| | | @Excel(name = "9æ¶") |
| | | private Double value9; |
| | | @Excel(name = "10æ¶") |
| | | private Double value10; |
| | | @Excel(name = "11æ¶") |
| | | private Double value11; |
| | | @Excel(name = "12æ¶") |
| | | private Double value12; |
| | | @Excel(name = "13æ¶") |
| | | private Double value13; |
| | | @Excel(name = "14æ¶") |
| | | private Double value14; |
| | | @Excel(name = "15æ¶") |
| | | private Double value15; |
| | | @Excel(name = "16æ¶") |
| | | private Double value16; |
| | | @Excel(name = "17æ¶") |
| | | private Double value17; |
| | | @Excel(name = "18æ¶") |
| | | private Double value18; |
| | | @Excel(name = "19æ¶") |
| | | private Double value19; |
| | | @Excel(name = "20æ¶") |
| | | private Double value20; |
| | | @Excel(name = "21æ¶") |
| | | private Double value21; |
| | | @Excel(name = "22æ¶") |
| | | private Double value22; |
| | | @Excel(name = "23æ¶") |
| | | private Double value23; |
| | | @Excel(name = "0æ¶") |
| | | private Double value0; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public class MonthlyProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | @Excel(name = "1æ¥") |
| | | private Double value1; |
| | | @Excel(name = "2æ¥") |
| | | private Double value2; |
| | | @Excel(name = "3æ¥") |
| | | private Double value3; |
| | | @Excel(name = "4æ¥") |
| | | private Double value4; |
| | | @Excel(name = "5æ¥") |
| | | private Double value5; |
| | | @Excel(name = "6æ¥") |
| | | private Double value6; |
| | | @Excel(name = "7æ¥") |
| | | private Double value7; |
| | | @Excel(name = "8æ¥") |
| | | private Double value8; |
| | | @Excel(name = "9æ¥") |
| | | private Double value9; |
| | | @Excel(name = "10æ¥") |
| | | private Double value10; |
| | | @Excel(name = "11æ¥") |
| | | private Double value11; |
| | | @Excel(name = "12æ¥") |
| | | private Double value12; |
| | | @Excel(name = "13æ¥") |
| | | private Double value13; |
| | | @Excel(name = "14æ¥") |
| | | private Double value14; |
| | | @Excel(name = "15æ¥") |
| | | private Double value15; |
| | | @Excel(name = "16æ¥") |
| | | private Double value16; |
| | | @Excel(name = "17æ¥") |
| | | private Double value17; |
| | | @Excel(name = "18æ¥") |
| | | private Double value18; |
| | | @Excel(name = "19æ¥") |
| | | private Double value19; |
| | | @Excel(name = "20æ¥") |
| | | private Double value20; |
| | | @Excel(name = "21æ¥") |
| | | private Double value21; |
| | | @Excel(name = "22æ¥") |
| | | private Double value22; |
| | | @Excel(name = "23æ¥") |
| | | private Double value23; |
| | | @Excel(name = "24æ¥") |
| | | private Double value24; |
| | | @Excel(name = "25æ¥") |
| | | private Double value25; |
| | | @Excel(name = "26æ¥") |
| | | private Double value26; |
| | | @Excel(name = "27æ¥") |
| | | private Double value27; |
| | | @Excel(name = "28æ¥") |
| | | private Double value28; |
| | | @Excel(name = "29æ¥") |
| | | private Double value29; |
| | | @Excel(name = "30æ¥") |
| | | private Double value30; |
| | | @Excel(name = "31æ¥") |
| | | private Double value31; |
| | | private Integer count; |
| | | private String unitId; |
| | | /** æ»è®°å½æ° */ |
| | | private long total; |
| | | private List<Map> tablehead =new ArrayList<>(); |
| | | private List<MonthlyProcessEnergy> tabledata =new ArrayList<MonthlyProcessEnergy>(); |
| | | public String getIndexId() { |
| | | return indexId; |
| | | } |
| | | |
| | | public void setIndexId(String indexId) { |
| | | this.indexId = indexId; |
| | | } |
| | | |
| | | public String getIndexName() { |
| | | return indexName; |
| | | } |
| | | |
| | | public void setIndexName(String indexName) { |
| | | this.indexName = indexName; |
| | | } |
| | | public String getUnitId() { |
| | | return unitId; |
| | | } |
| | | |
| | | public void setUnitId(String unitId) { |
| | | this.unitId = unitId; |
| | | } |
| | | |
| | | public String getTimeCode() { |
| | | return timeCode; |
| | | } |
| | | |
| | | public void setTimeCode(String timeCode) { |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
| | | public Date getDataTime() { |
| | | return dataTime; |
| | | } |
| | | |
| | | public void setDataTime(Date dataTime) { |
| | | this.dataTime = dataTime; |
| | | } |
| | | |
| | | public Double getValue1() { |
| | | return value1; |
| | | } |
| | | |
| | | public void setValue1(Double value1) { |
| | | this.value1 = value1; |
| | | } |
| | | |
| | | public Double getValue2() { |
| | | return value2; |
| | | } |
| | | |
| | | public void setValue2(Double value2) { |
| | | this.value2 = value2; |
| | | } |
| | | |
| | | public Double getValue3() { |
| | | return value3; |
| | | } |
| | | |
| | | public void setValue3(Double value3) { |
| | | this.value3 = value3; |
| | | } |
| | | |
| | | public Double getValue4() { |
| | | return value4; |
| | | } |
| | | |
| | | public void setValue4(Double value4) { |
| | | this.value4 = value4; |
| | | } |
| | | |
| | | public Double getValue5() { |
| | | return value5; |
| | | } |
| | | |
| | | public void setValue5(Double value5) { |
| | | this.value5 = value5; |
| | | } |
| | | |
| | | public Double getValue6() { |
| | | return value6; |
| | | } |
| | | |
| | | public void setValue6(Double value6) { |
| | | this.value6 = value6; |
| | | } |
| | | |
| | | public Double getValue7() { |
| | | return value7; |
| | | } |
| | | |
| | | public void setValue7(Double value7) { |
| | | this.value7 = value7; |
| | | } |
| | | |
| | | public Double getValue8() { |
| | | return value8; |
| | | } |
| | | |
| | | public void setValue8(Double value8) { |
| | | this.value8 = value8; |
| | | } |
| | | |
| | | public Double getValue9() { |
| | | return value9; |
| | | } |
| | | |
| | | public void setValue9(Double value9) { |
| | | this.value9 = value9; |
| | | } |
| | | |
| | | public Double getValue10() { |
| | | return value10; |
| | | } |
| | | |
| | | public void setValue10(Double value10) { |
| | | this.value10 = value10; |
| | | } |
| | | |
| | | public Double getValue11() { |
| | | return value11; |
| | | } |
| | | |
| | | public void setValue11(Double value11) { |
| | | this.value11 = value11; |
| | | } |
| | | |
| | | public Double getValue12() { |
| | | return value12; |
| | | } |
| | | |
| | | public void setValue12(Double value12) { |
| | | this.value12 = value12; |
| | | } |
| | | |
| | | public Double getValue13() { |
| | | return value13; |
| | | } |
| | | |
| | | public void setValue13(Double value13) { |
| | | this.value13 = value13; |
| | | } |
| | | |
| | | public Double getValue14() { |
| | | return value14; |
| | | } |
| | | |
| | | public void setValue14(Double value14) { |
| | | this.value14 = value14; |
| | | } |
| | | |
| | | public Double getValue15() { |
| | | return value15; |
| | | } |
| | | |
| | | public void setValue15(Double value15) { |
| | | this.value15 = value15; |
| | | } |
| | | |
| | | public Double getValue16() { |
| | | return value16; |
| | | } |
| | | |
| | | public void setValue16(Double value16) { |
| | | this.value16 = value16; |
| | | } |
| | | |
| | | public Double getValue17() { |
| | | return value17; |
| | | } |
| | | |
| | | public void setValue17(Double value17) { |
| | | this.value17 = value17; |
| | | } |
| | | |
| | | public Double getValue18() { |
| | | return value18; |
| | | } |
| | | |
| | | public void setValue18(Double value18) { |
| | | this.value18 = value18; |
| | | } |
| | | |
| | | public Double getValue19() { |
| | | return value19; |
| | | } |
| | | |
| | | public void setValue19(Double value19) { |
| | | this.value19 = value19; |
| | | } |
| | | |
| | | public Double getValue20() { |
| | | return value20; |
| | | } |
| | | |
| | | public void setValue20(Double value20) { |
| | | this.value20 = value20; |
| | | } |
| | | |
| | | public Double getValue21() { |
| | | return value21; |
| | | } |
| | | |
| | | public void setValue21(Double value21) { |
| | | this.value21 = value21; |
| | | } |
| | | |
| | | public Double getValue22() { |
| | | return value22; |
| | | } |
| | | |
| | | public void setValue22(Double value22) { |
| | | this.value22 = value22; |
| | | } |
| | | |
| | | public Double getValue23() { |
| | | return value23; |
| | | } |
| | | |
| | | public void setValue23(Double value23) { |
| | | this.value23 = value23; |
| | | } |
| | | |
| | | public Double getValue24() { |
| | | return value24; |
| | | } |
| | | |
| | | public void setValue24(Double value24) { |
| | | this.value24 = value24; |
| | | } |
| | | |
| | | public Double getValue25() { |
| | | return value25; |
| | | } |
| | | |
| | | public void setValue25(Double value25) { |
| | | this.value25 = value25; |
| | | } |
| | | |
| | | public Double getValue26() { |
| | | return value26; |
| | | } |
| | | |
| | | public void setValue26(Double value26) { |
| | | this.value26 = value26; |
| | | } |
| | | |
| | | public Double getValue27() { |
| | | return value27; |
| | | } |
| | | |
| | | public void setValue27(Double value27) { |
| | | this.value27 = value27; |
| | | } |
| | | |
| | | public Double getValue28() { |
| | | return value28; |
| | | } |
| | | |
| | | public void setValue28(Double value28) { |
| | | this.value28 = value28; |
| | | } |
| | | |
| | | public Double getValue29() { |
| | | return value29; |
| | | } |
| | | |
| | | public void setValue29(Double value29) { |
| | | this.value29 = value29; |
| | | } |
| | | |
| | | public Double getValue30() { |
| | | return value30; |
| | | } |
| | | |
| | | public void setValue30(Double value30) { |
| | | this.value30 = value30; |
| | | } |
| | | |
| | | public Double getValue31() { |
| | | return value31; |
| | | } |
| | | |
| | | public void setValue31(Double value31) { |
| | | this.value31 = value31; |
| | | } |
| | | |
| | | public List<Map> getTablehead() { |
| | | return tablehead; |
| | | } |
| | | |
| | | public void setTablehead(List<Map> tablehead) { |
| | | this.tablehead = tablehead; |
| | | } |
| | | public List<MonthlyProcessEnergy> getTabledata() { |
| | | return tabledata; |
| | | } |
| | | |
| | | public void setTabledata(List<MonthlyProcessEnergy> tabledata) { |
| | | this.tabledata = tabledata; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public long getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) { |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public class YearProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | @Excel(name = "1æ") |
| | | private Double value1; |
| | | @Excel(name = "2æ") |
| | | private Double value2; |
| | | @Excel(name = "3æ") |
| | | private Double value3; |
| | | @Excel(name = "4æ") |
| | | private Double value4; |
| | | @Excel(name = "5æ") |
| | | private Double value5; |
| | | @Excel(name = "6æ") |
| | | private Double value6; |
| | | @Excel(name = "7æ") |
| | | private Double value7; |
| | | @Excel(name = "8æ") |
| | | private Double value8; |
| | | @Excel(name = "9æ") |
| | | private Double value9; |
| | | @Excel(name = "10æ") |
| | | private Double value10; |
| | | @Excel(name = "11æ") |
| | | private Double value11; |
| | | @Excel(name = "12æ") |
| | | private Double value12; |
| | | private Integer count; |
| | | private String unitId; |
| | | /** æ»è®°å½æ° */ |
| | | private long total; |
| | | private List<Map> tablehead =new ArrayList<>(); |
| | | private List<YearProcessEnergy> tabledata =new ArrayList<YearProcessEnergy>(); |
| | | public String getIndexId() { |
| | | return indexId; |
| | | } |
| | | |
| | | public void setIndexId(String indexId) { |
| | | this.indexId = indexId; |
| | | } |
| | | |
| | | public String getIndexName() { |
| | | return indexName; |
| | | } |
| | | |
| | | public void setIndexName(String indexName) { |
| | | this.indexName = indexName; |
| | | } |
| | | public String getUnitId() { |
| | | return unitId; |
| | | } |
| | | |
| | | public void setUnitId(String unitId) { |
| | | this.unitId = unitId; |
| | | } |
| | | |
| | | public String getTimeCode() { |
| | | return timeCode; |
| | | } |
| | | |
| | | public void setTimeCode(String timeCode) { |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
| | | public Date getDataTime() { |
| | | return dataTime; |
| | | } |
| | | |
| | | public void setDataTime(Date dataTime) { |
| | | this.dataTime = dataTime; |
| | | } |
| | | |
| | | public Double getValue1() { |
| | | return value1; |
| | | } |
| | | |
| | | public void setValue1(Double value1) { |
| | | this.value1 = value1; |
| | | } |
| | | |
| | | public Double getValue2() { |
| | | return value2; |
| | | } |
| | | |
| | | public void setValue2(Double value2) { |
| | | this.value2 = value2; |
| | | } |
| | | |
| | | public Double getValue3() { |
| | | return value3; |
| | | } |
| | | |
| | | public void setValue3(Double value3) { |
| | | this.value3 = value3; |
| | | } |
| | | |
| | | public Double getValue4() { |
| | | return value4; |
| | | } |
| | | |
| | | public void setValue4(Double value4) { |
| | | this.value4 = value4; |
| | | } |
| | | |
| | | public Double getValue5() { |
| | | return value5; |
| | | } |
| | | |
| | | public void setValue5(Double value5) { |
| | | this.value5 = value5; |
| | | } |
| | | |
| | | public Double getValue6() { |
| | | return value6; |
| | | } |
| | | |
| | | public void setValue6(Double value6) { |
| | | this.value6 = value6; |
| | | } |
| | | |
| | | public Double getValue7() { |
| | | return value7; |
| | | } |
| | | |
| | | public void setValue7(Double value7) { |
| | | this.value7 = value7; |
| | | } |
| | | |
| | | public Double getValue8() { |
| | | return value8; |
| | | } |
| | | |
| | | public void setValue8(Double value8) { |
| | | this.value8 = value8; |
| | | } |
| | | |
| | | public Double getValue9() { |
| | | return value9; |
| | | } |
| | | |
| | | public void setValue9(Double value9) { |
| | | this.value9 = value9; |
| | | } |
| | | |
| | | public Double getValue10() { |
| | | return value10; |
| | | } |
| | | |
| | | public void setValue10(Double value10) { |
| | | this.value10 = value10; |
| | | } |
| | | |
| | | public Double getValue11() { |
| | | return value11; |
| | | } |
| | | |
| | | public void setValue11(Double value11) { |
| | | this.value11 = value11; |
| | | } |
| | | |
| | | public Double getValue12() { |
| | | return value12; |
| | | } |
| | | |
| | | public void setValue12(Double value12) { |
| | | this.value12 = value12; |
| | | } |
| | | |
| | | public List<Map> getTablehead() { |
| | | return tablehead; |
| | | } |
| | | |
| | | public void setTablehead(List<Map> tablehead) { |
| | | this.tablehead = tablehead; |
| | | } |
| | | public List<YearProcessEnergy> getTabledata() { |
| | | return tabledata; |
| | | } |
| | | |
| | | public void setTabledata(List<YearProcessEnergy> tabledata) { |
| | | this.tabledata = tabledata; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public long getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) { |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¨ææ°æ®é¡¹. |
| | | */ |
| | | @Data |
| | | public class DataItemQueryDTO { |
| | | |
| | | |
| | | @ApiModelProperty(value = "ææ id") |
| | | private String indexId; |
| | | |
| | | @ApiModelProperty(value = "模åcode") |
| | | private String indexCode; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´å符串") |
| | | private String dataTime; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´ç±»å") |
| | | private String timeType; |
| | | |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface DailyProcessEnergyMapper extends BaseMapper<DailyProcessEnergy> { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getDailyProcessEnergyList(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<DailyProcessEnergy> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface MonthlyProcessEnergyMapper { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyProcessEnergy> getMonthlyProcessEnergy(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<MonthlyProcessEnergy> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface YearProcessEnergyMapper { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getYearProcessEnergy(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<TypeTime> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IDailyProcessEnergyService { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getDailyProcessEnergyList(List<String> indexIds, List<DailyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IMonthlyProcessEnergyService { |
| | | public List<MonthlyProcessEnergy> getMonthlyProcessEnergy(List<String> indexIds, List<MonthlyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | List<MonthlyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IYearProcessEnergyService { |
| | | |
| | | List<YearProcessEnergy> getYearProcessEnergy(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param queryDto |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getListChart(DataItemQueryDTO queryDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.DailyProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IDailyProcessEnergyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class DailyProcessEnergyServiceImpl extends ServiceImpl<DailyProcessEnergyMapper,DailyProcessEnergy> implements IDailyProcessEnergyService { |
| | | |
| | | |
| | | @Override |
| | | public List<DailyProcessEnergy> getDailyProcessEnergyList(List<String> indexIds, List<DailyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()){ |
| | | return baseMapper.getDailyProcessEnergyList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<DailyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return baseMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.MonthlyProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IMonthlyProcessEnergyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class MonthlyProcessEnergyServiceImpl implements IMonthlyProcessEnergyService { |
| | | |
| | | @Resource |
| | | private MonthlyProcessEnergyMapper monthlyProcessEnergyMapper; |
| | | |
| | | @Override |
| | | public List<MonthlyProcessEnergy> getMonthlyProcessEnergy(List<String> indexIds, List<MonthlyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()){ |
| | | return monthlyProcessEnergyMapper.getMonthlyProcessEnergy(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthlyProcessEnergyMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.YearProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IYearProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.annotation.Resources; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class YearProcessEnergyServiceImpl implements IYearProcessEnergyService { |
| | | |
| | | @Resource |
| | | private YearProcessEnergyMapper yearProcessEnergyMapper; |
| | | |
| | | @Override |
| | | public List<YearProcessEnergy> getYearProcessEnergy(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return yearProcessEnergyMapper.getYearProcessEnergy(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param queryDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<YearProcessEnergy> getListChart(DataItemQueryDTO queryDto) { |
| | | |
| | | if(ObjectUtil.isEmpty(queryDto.getIndexId())) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | Date convertTime = DateTimeUtil.getTypeTime(queryDto.getTimeType(), queryDto.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | return yearProcessEnergyMapper.getListChart(queryDto.getIndexId(),beginTime,endTime,queryDto.getTimeType()); |
| | | } |
| | | } |
| | |
| | | wrapper.like(StringUtils.isNotEmpty(productOutput.getDataTime()),ProductOutput::getDataTime,productOutput.getDataTime()); |
| | | wrapper.eq(StringUtils.isNotEmpty(productOutput.getProductType()),ProductOutput::getProductType,productOutput.getProductType()); |
| | | wrapper.eq(StringUtils.isNotEmpty(productOutput.getNodeId()),ProductOutput::getNodeId,productOutput.getNodeId()); |
| | | wrapper.eq(StringUtils.isNotEmpty(productOutput.getTimeType()),ProductOutput::getTimeType,productOutput.getTimeType()); |
| | | wrapper.orderByDesc(ProductOutput::getCreateTime); |
| | | Page<ProductOutput> page = productOutputMapper.selectPage(new Page<ProductOutput>(pageNum, pageSize), wrapper); |
| | | return page; |
| | |
| | | package com.zhitan.realtimedata.domain; |
| | | |
| | | import com.zhitan.common.enums.Quality; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | @ApiModelProperty(value = "æ¶é´ç±»åç¼ç ") |
| | | private String timeCode; |
| | | @ApiModelProperty(value = "æ¶é´ç±»å") |
| | | private TimeType timeType; |
| | | private String timeType; |
| | | @ApiModelProperty(value = "å¼") |
| | | private Double value; |
| | | @ApiModelProperty(value = "è´¨é") |
| | |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public TimeType getTimeType() { |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(TimeType timeType) { |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.realtimedata.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | @Data |
| | | public class BranchAnalysisDTO { |
| | | |
| | | |
| | | @ApiModelProperty(value="èç¹id") |
| | | private String nodeId; |
| | | @ApiModelProperty(value ="æ¶é´å符串") |
| | | private String dataTime; |
| | | @ApiModelProperty(value ="æ¶é´ç±»å") |
| | | private String timeType; |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.realtimedata.domain.dto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¨ææ°æ®é¡¹. |
| | | */ |
| | | @Data |
| | | public class DataItemQueryDTO { |
| | | @ApiModelProperty(value ="ææ id") |
| | | private String indexId; |
| | | |
| | | @ApiModelProperty(value="模åcode") |
| | | private String indexCode; |
| | | @ApiModelProperty(value ="æ¶é´å符串") |
| | | private String dataTime; |
| | | @ApiModelProperty(value ="æ¶é´ç±»å") |
| | | private String timeType; |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | } |
| | |
| | | |
| | | public BigDecimal getEnergyLossRatio() { |
| | | if (BigDecimal.ZERO.compareTo(totalAccumulatedAmount) == 0 |
| | | || BigDecimal.ZERO.compareTo(difference) == 0){ |
| | | || BigDecimal.ZERO.compareTo(difference) == 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | return energyLossRatio = difference.divide(totalAccumulatedAmount, 2, RoundingMode.HALF_UP); |
| | | // å
è®¡ç®æ¯ä¾ï¼åä¹ä»¥ 100 转æ¢ä¸ºç¾åæ° |
| | | return energyLossRatio = difference.divide(totalAccumulatedAmount, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | public FlowChartsVO() { |
| | |
| | | import com.zhitan.common.constant.TimeTypeConst; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.dataitem.service.IDataItemService; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.zhitan.model.domain.vo.ModelNodeIndexInfo; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import com.zhitan.statisticalAnalysis.domain.dto.DataAnalysisMoMDTO; |
| | |
| | | public List<DataAnalysisYoYVO> listElectricDataComparisonYoY(DataAnalysisMoMDTO dto) { |
| | | List<DataAnalysisYoYVO> yoyList = new ArrayList<>(); |
| | | // æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | if (CollectionUtils.isEmpty(nodeInforList)) { |
| | | return yoyList; |
| | | } |
| | | List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | // è·åæ¥è¯¢æ¶é´ |
| | | Date beginTime = dto.getBeginTime(); |
| | | Date endTime = dto.getEndTime(); |
| | |
| | | BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | DataAnalysisYoYVO yoyVO = new DataAnalysisYoYVO(); |
| | | Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); |
| | | Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); |
| | | first.ifPresent(modelNodeIndexInfor -> yoyVO.setEnergyUnitName(modelNodeIndexInfor.getName())); |
| | | // èµå¼åä½ |
| | | yoyVO.setUnit("kWh"); |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æ±å |
| | | BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) |
| | | .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | |
| | | public List<DataAnalysisMoMVO> listElectricDataComparisonMoM(DataAnalysisMoMDTO dto) { |
| | | List<DataAnalysisMoMVO> momList = new ArrayList<>(); |
| | | // æ ¹æ®idæ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | return momList; |
| | | } |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime = dto.getBeginTime(); |
| | | Date endTime = dto.getEndTime(); |
| | | Date lastTime; |
| | |
| | | lastEndTime = DateUtil.offset(endTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); |
| | | } |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | // æ ¹æ®indexIdæ¥è¯¢dataItem |
| | | List<DataItem> dataItemList = dataItemService.getDataItemHourInforByIndexIds(beginTime, endTime, TimeType.HOUR.name(), indexIds); |
| | | List<DataItem> lastDataItemList = dataItemService.getDataItemHourInforByIndexIds(lastTime, lastEndTime, TimeType.HOUR.name(), indexIds); |
| | |
| | | BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | DataAnalysisMoMVO momVO = new DataAnalysisMoMVO(); |
| | | Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); |
| | | Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); |
| | | first.ifPresent(modelNodeIndexInfor -> momVO.setEnergyUnitName(modelNodeIndexInfor.getName())); |
| | | // èµå¼åä½ |
| | | momVO.setUnit("kWh"); |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æ±å |
| | | BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) |
| | | .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | |
| | | public List<DataAnalysisYoYVO> listWaterDataComparisonYoY(DataAnalysisMoMDTO dto) { |
| | | List<DataAnalysisYoYVO> yoyList = new ArrayList<>(); |
| | | // æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | if (CollectionUtils.isEmpty(nodeInforList)) { |
| | | return yoyList; |
| | | } |
| | | List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | // æ¶é´ç±»å |
| | | // è·åæ¥è¯¢æ¶é´ |
| | | Date beginTime = dto.getBeginTime(); |
| | |
| | | BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | DataAnalysisYoYVO yoyVO = new DataAnalysisYoYVO(); |
| | | Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); |
| | | Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); |
| | | first.ifPresent(modelNodeIndexInfor -> yoyVO.setEnergyUnitName(modelNodeIndexInfor.getName())); |
| | | // èµå¼åä½ |
| | | yoyVO.setUnit("m³"); |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æ±å |
| | | BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) |
| | | .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | |
| | | public List<DataAnalysisMoMVO> listWaterDataComparisonMoM(DataAnalysisMoMDTO dto) { |
| | | List<DataAnalysisMoMVO> momList = new ArrayList<>(); |
| | | // æ ¹æ®idæ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); |
| | | if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | return momList; |
| | | } |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | Date beginTime = dto.getBeginTime(); |
| | | Date endTime = dto.getEndTime(); |
| | | Date lastTime; |
| | |
| | | lastEndTime = DateUtil.offset(endTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); |
| | | } |
| | | // æç
§ç¹ä½è¿è¡åç» |
| | | Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); |
| | | Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( |
| | | Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); |
| | | // æ¥è¯¢å¯¹åºindexIdsï¼æ¾å°å¯¹åºdataItemä¿¡æ¯ |
| | | List<DataItem> dataItemList = dataItemService.getDataItemHourInforByIndexIds(beginTime, endTime, TimeType.HOUR.name(), indexIds); |
| | | List<DataItem> lastDataItemList = dataItemService.getDataItemHourInforByIndexIds(lastTime, lastEndTime, TimeType.HOUR.name(), indexIds); |
| | |
| | | BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); |
| | | nodeIndexMap.forEach((key, value) -> { |
| | | DataAnalysisMoMVO momVO = new DataAnalysisMoMVO(); |
| | | Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); |
| | | Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); |
| | | first.ifPresent(modelNodeIndexInfor -> momVO.setEnergyUnitName(modelNodeIndexInfor.getName())); |
| | | // èµå¼åä½ |
| | | momVO.setUnit("m³"); |
| | | // æ¾åºindexIds |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | // æ±å |
| | | BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) |
| | | .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | |
| | | /** |
| | | * æ¥è¯¢ç¹ä½ä¸ç¨è½åå
ä¿¡æ¯ |
| | | */ |
| | | private List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInfor(String nodeId) { |
| | | List<ModelNodeIndexInfor> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); |
| | | private List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInfor(String nodeId) { |
| | | List<ModelNodeIndexInfo> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); |
| | | // 妿æ¯ç©ºåå¨ä¸¤ç§æ
åµï¼1ï¼idæé®é¢ï¼2ï¼æåºå± |
| | | if (CollectionUtils.isEmpty(nodeInforList)) { |
| | | List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); |
| | | List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); |
| | | if (CollectionUtils.isNotEmpty(inforList)) { |
| | | nodeInforList.addAll(inforList); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zhitan.system.domain.SysRoleMenu; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * è§è²ä¸èåå
³è表 æ°æ®å± |
| | |
| | | * @param ids éè¦å é¤çæ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | int deleteRoleMenu(Long[] ids); |
| | | int deleteRoleMenu(@Param("ids") Long[] ids); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢è§è²èåä¿¡æ¯ |
| | |
| | | * @param roleMenuList è§è²èåå表 |
| | | * @return ç»æ |
| | | */ |
| | | int batchRoleMenu(List<SysRoleMenu> roleMenuList); |
| | | int batchRoleMenu(@Param("list") List<SysRoleMenu> roleMenuList); |
| | | } |
| | |
| | | DateUtils.parseDate(role.getParams().get("beginTime")), |
| | | DateUtils.parseDate(role.getParams().get("endTime"))); |
| | | } |
| | | queryWrapper.eq(SysRole::getDelFlag, 0); |
| | | return roleMapper.selectPage(new Page<SysRole>(pageNum,pageSize),queryWrapper); |
| | | } |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.alarm.mapper.HistoryAlarmMapper"> |
| | | |
| | | <resultMap type="HistoryAlarm" id="HistoryAlarmResult"> |
| | | <resultMap type="com.zhitan.alarm.domain.HistoryAlarm" id="HistoryAlarmResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="endTime" column="end_time"/> |
| | | <result property="indexId" column="index_id"/> |
| | |
| | | <result property="content" column="content"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="JkHistoryAlarm" id="JkHistoryAlarmResult"> |
| | | <resultMap type="com.zhitan.alarm.domain.JkHistoryAlarm" id="JkHistoryAlarmResult"> |
| | | <result property="modelName" column="modelname"/> |
| | | <result property="code" column="code"/> |
| | | <result property="indexName" column="indexname"/> |
| | |
| | | from history_alarm |
| | | </sql> |
| | | |
| | | <select id="selectHistoryAlarmList" parameterType="HistoryAlarm" resultMap="HistoryAlarmResult"> |
| | | <select id="selectHistoryAlarmList" parameterType="com.zhitan.alarm.domain.HistoryAlarm" resultMap="HistoryAlarmResult"> |
| | | <include refid="selectHistoryAlarmVo"/> |
| | | <where> |
| | | <if test="indexName != null and indexName != ''">and index_name like concat('%', |
| | |
| | | </select> |
| | | |
| | | |
| | | <update id="updateHistoryAlarm" parameterType="HistoryAlarm"> |
| | | <update id="updateHistoryAlarm" parameterType="com.zhitan.alarm.domain.HistoryAlarm"> |
| | | delete from realtime_alarm where alarm_code = #{alarmCode}; |
| | | insert into history_alarm |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </delete> |
| | | |
| | | <!--åå² æ¥è¦åè¡¨é¡µé¢ ééç¹ ä¸»é¡µé¢å表æ¥è¯¢--> |
| | | <select id="selectJkHistoryAlarmList" parameterType="JkHistoryAlarm" |
| | | <select id="selectJkHistoryAlarmList" parameterType="com.zhitan.alarm.domain.JkHistoryAlarm" |
| | | resultMap="JkHistoryAlarmResult"> |
| | | SELECT |
| | | mo."name" AS modelname, |
| | |
| | | order by alarm_level,mo.node_id,limit_type asc |
| | | </select> |
| | | |
| | | <select id="selectJkHistoryAlarmListExcel" parameterType="JkHistoryAlarm" |
| | | <select id="selectJkHistoryAlarmListExcel" parameterType="com.zhitan.alarm.domain.JkHistoryAlarm" |
| | | resultMap="JkHistoryAlarmResult"> |
| | | SELECT |
| | | mo."name" AS modelname, |
| | |
| | | order by alarm_level,mo.node_id,limit_type asc |
| | | </select> |
| | | |
| | | <select id="selectHistoryAlarmNoteList" parameterType="JkHistoryAlarm" |
| | | <select id="selectHistoryAlarmNoteList" parameterType="com.zhitan.alarm.domain.JkHistoryAlarm" |
| | | resultMap="JkHistoryAlarmResult"> |
| | | SELECT |
| | | ei.code, |
| | |
| | | </if> |
| | | order by alarm_level,limit_type asc |
| | | </select> |
| | | <select id="selectJkHistoryAlarmPage" resultType="JkHistoryAlarm"> |
| | | <select id="selectJkHistoryAlarmPage" resultType="com.zhitan.alarm.domain.JkHistoryAlarm"> |
| | | SELECT |
| | | mo."name" AS modelname, |
| | | ei.code, |
| | |
| | | energy_index ei, |
| | | node_index ni, |
| | | model_node mo, |
| | | history_alarm bj , |
| | | history_alarm bj, |
| | | alarm_item alit |
| | | WHERE |
| | | ni.node_id IN ( |
| | |
| | | AND alit.alarm_code = bj.alarm_code |
| | | AND alit.time_slot='LIVE' |
| | | AND ei.index_type=#{jkHistoryAlarm.indexType} |
| | | <if test="jkHistoryAlarm.indexName != null and jkHistoryAlarm.indexName != ''">and ei.name like concat('%', #{jkHistoryAlarm.indexName}, |
| | | '%') |
| | | <if test="jkHistoryAlarm.indexName != null and jkHistoryAlarm.indexName != ''"> |
| | | and ei.name like concat('%', #{jkHistoryAlarm.indexName}, '%') |
| | | </if> |
| | | <if test="jkHistoryAlarm.limitType != null and jkHistoryAlarm.limitType != ''">and alit.limit_type=#{jkHistoryAlarm.limitType}</if> |
| | | <if test="jkHistoryAlarm.alarmLevel != null and jkHistoryAlarm.alarmLevel != ''">and alit.alarm_level=#{jkHistoryAlarm.alarmLevel}</if> |
| | | <if test="jkHistoryAlarm.beginTime != null and jkHistoryAlarm.beginTime != ''">and begin_time >= |
| | | to_timestamp(#{jkHistoryAlarm.beginTime},'yyyy-mm-dd hh24:mi:ss') |
| | | <if test="jkHistoryAlarm.limitType != null and jkHistoryAlarm.limitType != ''"> |
| | | and alit.limit_type=#{jkHistoryAlarm.limitType} |
| | | </if> |
| | | <if test="jkHistoryAlarm.alarmLevel != null and jkHistoryAlarm.alarmLevel != ''"> |
| | | and alit.alarm_level=#{jkHistoryAlarm.alarmLevel} |
| | | </if> |
| | | <if test="jkHistoryAlarm.beginTime != null and jkHistoryAlarm.beginTime != ''"> |
| | | and begin_time >= to_timestamp(#{jkHistoryAlarm.beginTime}, 'yyyy-mm-dd hh24:mi:ss') |
| | | </if> |
| | | <if test="jkHistoryAlarm.endTime != null and jkHistoryAlarm.endTime != ''">and begin_time <= |
| | | to_timestamp(#{jkHistoryAlarm.endTime},'yyyy-mm-dd hh24:mi:ss') |
| | | <if test="jkHistoryAlarm.endTime != null and jkHistoryAlarm.endTime != ''"> |
| | | and begin_time <= to_timestamp(#{jkHistoryAlarm.endTime},'yyyy-mm-dd hh24:mi:ss') |
| | | </if> |
| | | order by alarm_level,mo.node_id,limit_type asc |
| | | </select> |
| | | |
| | | <select id="selectCountByTime" resultType="java.lang.Integer"> |
| | | select count(0) |
| | | from history_alarm |
| | | <where> |
| | | <if test="beginTime != null "> |
| | | and begin_time >= #{beginTime} |
| | | and begin_time >= #{beginTime} |
| | | </if> |
| | | <if test="endTime != null "> |
| | | and begin_time <= #{endTime} |
| | | and begin_time <= #{endTime} |
| | | </if> |
| | | <if test="indexIdList != null and indexIdList.size() > 0"> |
| | | and index_id in |
| | | <foreach collection="indexIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getHistoryAlarmList" resultType="com.zhitan.alarm.domain.JkHistoryAlarm"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn."name" modelName, |
| | | mi.meter_name meterName, |
| | | mi.energy_type energyId, |
| | | his.index_id indexId, |
| | | ei."name" indexName, |
| | | ei.index_type indexType, |
| | | ei.code code, |
| | | ei.unit_id unitId, |
| | | ai.alarm_level alarmLevel, |
| | | ai.limit_type limitType, |
| | | his.limiting_value limitingValue, |
| | | his.alarm_value alarmValue, |
| | | his.begin_time alarmBeginTime, |
| | | his.end_time alarmEndTime, |
| | | his.duration duration |
| | | FROM |
| | | history_alarm his |
| | | LEFT JOIN alarm_item ai ON his.item_id = ai."id" |
| | | LEFT JOIN energy_index ei ON his.index_id = ei.index_id |
| | | LEFT JOIN meter_implement mi ON ei.meter_id = mi."id" |
| | | LEFT JOIN model_node mn ON mn.node_id = ai.node_id |
| | | WHERE |
| | | his.begin_time BETWEEN #{beginTime} AND #{endTime} |
| | | <if test="indexIdList != null and indexIdList.size() > 0"> |
| | | AND his.index_id IN |
| | | <foreach collection="indexIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.branchanalysis.mapper.BranchAnalysisMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.branchanalysis.domain.BranchAnalysisVO"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | </resultMap> |
| | | <!--å
¨åè½èç»è®¡--> |
| | | <select id="getBranchAnalysisList" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dateTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | LEFT JOIN facility_archives f ON f."id"=ci.equipment |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ci.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | COALESCE ( MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ), null ) AS ${item.value}, |
| | | </foreach> |
| | |
| | | SELECT |
| | | ni.index_id, |
| | | ei."name" AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id, aa.index_name, aa.time_type, aa.order_num |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | </select> |
| | | |
| | |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | COALESCE ( MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ), null ) AS ${item.value}, |
| | | </foreach> |
| | |
| | | SELECT |
| | | ni.index_id, |
| | | ei."name" AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id, aa.index_name, aa.time_type, aa.order_num |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | </select> |
| | | |
| | |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | COALESCE ( MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ), null ) AS ${item.value}, |
| | | </foreach> |
| | |
| | | SELECT |
| | | ni.index_id, |
| | | ei."name" AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | |
| | | AND di.data_time >= #{beginTime} |
| | | AND di.data_time <= #{endTime} |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY aa.index_id, aa.index_name, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | GROUP BY aa.index_id, aa.index_name, aa.unit_id, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.DailyProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.DailyProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | <result column="value13" property="value13"/> |
| | | <result column="value14" property="value14"/> |
| | | <result column="value15" property="value15"/> |
| | | <result column="value16" property="value16"/> |
| | | <result column="value17" property="value17"/> |
| | | <result column="value18" property="value18"/> |
| | | <result column="value19" property="value19"/> |
| | | <result column="value20" property="value20"/> |
| | | <result column="value21" property="value21"/> |
| | | <result column="value22" property="value22"/> |
| | | <result column="value23" property="value23"/> |
| | | <result column="value0" property="value0"/> |
| | | </resultMap> |
| | | <select id="getDailyProcessEnergyList" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | | SELECT |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id =#{indexId} |
| | | AND di.data_time < #{endTime} |
| | | AND di.data_time >= #{beginTime} |
| | | AND di.time_type = #{timeType} |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.MonthlyProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.MonthlyProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | <result column="value13" property="value13"/> |
| | | <result column="value14" property="value14"/> |
| | | <result column="value15" property="value15"/> |
| | | <result column="value16" property="value16"/> |
| | | <result column="value17" property="value17"/> |
| | | <result column="value18" property="value18"/> |
| | | <result column="value19" property="value19"/> |
| | | <result column="value20" property="value20"/> |
| | | <result column="value21" property="value21"/> |
| | | <result column="value22" property="value22"/> |
| | | <result column="value23" property="value23"/> |
| | | <result column="value24" property="value24"/> |
| | | <result column="value25" property="value25"/> |
| | | <result column="value26" property="value26"/> |
| | | <result column="value27" property="value27"/> |
| | | <result column="value28" property="value28"/> |
| | | <result column="value29" property="value29"/> |
| | | <result column="value30" property="value30"/> |
| | | <result column="value31" property="value31"/> |
| | | </resultMap> |
| | | |
| | | <select id="getMonthlyProcessEnergy" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | | SELECT |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id =#{indexId} |
| | | AND di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.time_type = #{timeType} |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.YearProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.YearProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | </resultMap> |
| | | |
| | | <select id="getYearProcessEnergy" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dateTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | | SELECT |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id = #{indexId} |
| | | AND di.time_type = #{timeType} |
| | | <if test="endTime != null"> |
| | | AND di.data_time < #{endTime} |
| | | </if> |
| | | <if test="beginTime != null"> |
| | | AND di.data_time >= #{beginTime} |
| | | </if> |
| | | order by di.data_time |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | WHEN di.time_type = 'DAY' THEN |
| | | TO_CHAR( di.create_time, 'DD' ) |
| | | WHEN di.time_type = 'HOUR' THEN |
| | | TO_CHAR( di.data_time, 'HH' ) |
| | | TO_CHAR( di.data_time, 'HH24' ) |
| | | ELSE TO_CHAR( di.data_time, 'YYMMDD' ) |
| | | END AS dataTimeStr, |
| | | di.value, |
| | |
| | | AND (di.data_time BETWEEN #{beginTime} AND #{endTime}) |
| | | AND di.time_type = #{timeType} |
| | | </select> |
| | | <select id="getHomePageConsumptionRanking" |
| | | resultType="com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData"> |
| | | SELECT |
| | | A.node_Id, |
| | | A."name" AS nodeName, |
| | | A.energy_id AS energyTypeNo, |
| | | A.index_type AS energyTypeName, |
| | | A."value" AS energyConsumption |
| | | FROM |
| | | ( |
| | | SELECT |
| | | mn.node_id, |
| | | mn."name", |
| | | ei.energy_id, |
| | | ei.index_type, |
| | | se.coefficient, |
| | | (SUM ( di."value" ) * se.coefficient) AS "value" |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN data_item di ON di.index_id = ni.index_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN sys_energy se ON se.enersno = ei.energy_id |
| | | WHERE |
| | | mn.node_id IN |
| | | <foreach collection="nodeIds" item="nodeId" open="(" separator="," close=")"> |
| | | #{nodeId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | AND di.begin_time between #{beginTime} AND #{endTime} |
| | | AND ei.index_type = 'STATISTIC' |
| | | GROUP BY |
| | | mn.node_id, |
| | | mn."name", |
| | | ei.energy_id, |
| | | ei.index_type, |
| | | se.coefficient |
| | | ) A |
| | | ORDER BY |
| | | A."value" DESC |
| | | LIMIT 5 |
| | | </select> |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.energydata.mapper.EnergyDataStatisticMapper"> |
| | | |
| | | <select id="getModelNodeIndexIdByFixedNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | <select id="getModelNodeIndexIdByFixedNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId, |
| | |
| | | </resultMap> |
| | | <select id="getdailyKeyEquipmentList" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | LEFT JOIN facility_archives f ON f."id"=ci.equipment |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")">#{indexId} </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ci.equipment=#{indexStorageId} |
| | | </if> |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | LEFT JOIN facility_archives f ON f."id"=ci.equipment |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")">#{indexId} </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ci.equipment=#{indexStorageId} |
| | | </if> |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.keyequipment.mapper.YearKeyEquipmentMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.keyequipment.domain.YearKeyEquipment"> |
| | | <result column="index_id" property="indexId"/> |
| | |
| | | <!--å
¨åè½èç»è®¡--> |
| | | <select id="getYearKeyEquipmentList" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dateTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | LEFT JOIN facility_archives f ON f."id"=ci.equipment |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")">#{indexId} </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ci.equipment=#{indexStorageId} |
| | | </if> |
| | | SELECT |
| | | ni.index_id, |
| | | ei.NAME AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | LEFT JOIN energy_index ei ON ei.index_id = ni.index_id |
| | | LEFT JOIN data_item di ON ni.index_id = di.index_id |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | aa.index_id, aa.index_name, aa.unit_id, aa.time_type |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | | SELECT |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id =#{indexId} |
| | | AND di.data_time < #{endTime} |
| | | AND di.data_time >= #{beginTime} |
| | | di.index_id =#{indexId} |
| | | AND di.data_time < #{endTime} |
| | | <if test="endTime != null"> |
| | | AND di.data_time >= #{beginTime} |
| | | </if> |
| | | <if test="beginTime != null"> |
| | | AND di.time_type = #{timeType} |
| | | </if> |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.model.mapper.EnergyIndexMapper"> |
| | | |
| | | <resultMap type="EnergyIndex" id="EnergyIndexResult"> |
| | | <result property="indexId" column="index_id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="code" column="code"/> |
| | | <result property="indexType" column="index_type"/> |
| | | <result property="indexCategory" column="index_category"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="unitId" column="unit_id"/> |
| | | <result property="meterId" column="meter_id"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="equipment" column="equipment"/> |
| | | <result property="energyId" column="energy_id"/> |
| | | <result property="meterName" column="meter_name"/> |
| | | </resultMap> |
| | | <resultMap type="com.zhitan.model.domain.EnergyIndex" id="EnergyIndexResult"> |
| | | <result property="indexId" column="index_id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="code" column="code"/> |
| | | <result property="indexType" column="index_type"/> |
| | | <result property="indexCategory" column="index_category"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="unitId" column="unit_id"/> |
| | | <result property="meterId" column="meter_id"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="equipment" column="equipment"/> |
| | | <result property="energyId" column="energy_id"/> |
| | | <result property="meterName" column="meter_name"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectEnergyIndexVo"> |
| | | select index_id, |
| | | name, |
| | | code, |
| | | index_type, |
| | | index_category, |
| | | remark, |
| | | unit_id, |
| | | meter_id, |
| | | order_num, |
| | | equipment, |
| | | energy_id |
| | | from energy_index |
| | | </sql> |
| | | <sql id="selectEnergyIndexVo"> |
| | | select index_id, |
| | | name, |
| | | code, |
| | | index_type, |
| | | index_category, |
| | | remark, |
| | | unit_id, |
| | | meter_id, |
| | | order_num, |
| | | equipment, |
| | | energy_id |
| | | from energy_index |
| | | </sql> |
| | | |
| | | <select id="selectEnergyIndexList" parameterType="EnergyIndex" resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | <if test="code != null and code != ''">and code like concat('%', #{code}, '%')</if> |
| | | <if test="indexType != null">and index_type = #{indexType}</if> |
| | | <if test="nodeId != null and nodeId != ''">and node_id = #{nodeId}</if> |
| | | <if test="indexCategory != null and indexCategory != ''">and index_category = |
| | | #{indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="selectEnergyIndexList" parameterType="com.zhitan.model.domain.EnergyIndex" |
| | | resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | <if test="code != null and code != ''">and code like concat('%', #{code}, '%')</if> |
| | | <if test="indexType != null">and index_type = #{indexType}</if> |
| | | <if test="nodeId != null and nodeId != ''">and node_id = #{nodeId}</if> |
| | | <if test="indexCategory != null and indexCategory != ''">and index_category = |
| | | #{indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | </select> |
| | | |
| | | <select id="selectEnergyIndexById" parameterType="String" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where index_id = #{indexId} |
| | | order by order_num |
| | | </select> |
| | | <select id="selectEnergyIndexById" parameterType="String" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where index_id = #{indexId} |
| | | order by order_num |
| | | </select> |
| | | |
| | | <select id="selectEnergyIndexByIds" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where |
| | | <select id="selectEnergyIndexByIds" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where |
| | | index_id IN |
| | | <foreach collection="list" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | <foreach collection="indexIds" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </select> |
| | | </select> |
| | | |
| | | <select id="energyIndexHasExist" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from energy_index |
| | | where code = #{code}; |
| | | </select> |
| | | <select id="energyIndexHasExistWhenUpdate" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from energy_index |
| | | where code = #{code} |
| | | AND index_id != #{indexId}; |
| | | </select> |
| | | <select id="getMeterIndex" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where meter_id = #{meterId} |
| | | order by order_num |
| | | </select> |
| | | <select id="modelHasConfig" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where model_code = #{modelCode}; |
| | | </select> |
| | | <select id="selectCollectIndex" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where meter_id = #{deviceId} |
| | | order by order_num |
| | | </select> |
| | | <select id="getEnergyIndexByIds" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where index_id in |
| | | <foreach item="indexId" collection="list" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getEnergyIndexByCodes" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where code in |
| | | <foreach item="indexCode" collection="list" open="(" separator="," close=")"> |
| | | #{indexCode} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getIndexByNodeAndChildrenNode" resultMap="EnergyIndexResult"> |
| | | select ei.* |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id in (select node_id |
| | | from model_node |
| | | where address like (select address |
| | | from model_node |
| | | where node_id = #{nodeId}) || '%') |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="searchIndexByNodeAndChildrenNode" resultMap="EnergyIndexResult"> |
| | | select ei.* |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id in (select node_id |
| | | from model_node |
| | | where address like (select address |
| | | from model_node |
| | | where node_id = #{nodeId}) || '%') |
| | | and (ei.code like concat('%', #{filter}, '%') or ei.name like concat('%', #{filter}, '%')) |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="selectEnergyIndex" resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="codeOrName != null and codeOrName != ''">and (name like concat('%', #{codeOrName}, |
| | | '%') or code like concat('%', #{codeOrName}, '%')) |
| | | </if> |
| | | <if test="nodeId != null and nodeId != ''">and node_id = #{nodeId}</if> |
| | | <if test="indexType != null">and index_type = #{indexType}</if> |
| | | <if test="indexCategory != null and indexCategory != ''">and index_category = |
| | | #{indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="energyIndexHasExist" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from energy_index |
| | | where code = #{code}; |
| | | </select> |
| | | <select id="energyIndexHasExistWhenUpdate" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from energy_index |
| | | where code = #{code} |
| | | AND index_id != #{indexId}; |
| | | </select> |
| | | <select id="getMeterIndex" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where meter_id = #{meterId} |
| | | order by order_num |
| | | </select> |
| | | <select id="modelHasConfig" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where model_code = #{modelCode}; |
| | | </select> |
| | | <select id="selectCollectIndex" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where meter_id = #{deviceId} |
| | | order by order_num |
| | | </select> |
| | | <select id="getEnergyIndexByIds" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where index_id in |
| | | <foreach item="indexId" collection="list" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getEnergyIndexByCodes" resultMap="EnergyIndexResult"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where code in |
| | | <foreach item="indexCode" collection="list" open="(" separator="," close=")"> |
| | | #{indexCode} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getIndexByNodeAndChildrenNode" resultMap="EnergyIndexResult"> |
| | | select ei.* |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id in (select node_id |
| | | from model_node |
| | | where address like (select address |
| | | from model_node |
| | | where node_id = #{nodeId}) || '%') |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="searchIndexByNodeAndChildrenNode" resultMap="EnergyIndexResult"> |
| | | select ei.* |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id in (select node_id |
| | | from model_node |
| | | where address like (select address |
| | | from model_node |
| | | where node_id = #{nodeId}) || '%') |
| | | and (ei.code like concat('%', #{filter}, '%') or ei.name like concat('%', #{filter}, '%')) |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="selectEnergyIndex" resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="codeOrName != null and codeOrName != ''">and (name like concat('%', #{codeOrName}, |
| | | '%') or code like concat('%', #{codeOrName}, '%')) |
| | | </if> |
| | | <if test="nodeId != null and nodeId != ''">and node_id = #{nodeId}</if> |
| | | <if test="indexType != null">and index_type = #{indexType}</if> |
| | | <if test="indexCategory != null and indexCategory != ''">and index_category = |
| | | #{indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | </select> |
| | | |
| | | <insert id="insertEnergyIndex" parameterType="EnergyIndex"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="indexId != null and indexId != ''">index_id,</if> |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="code != null and code != ''">code,</if> |
| | | <if test="indexType != null">index_type,</if> |
| | | <if test="indexCategory != null and indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="unitId != null and unitId != ''">unit_id,</if> |
| | | <if test="orderNum != null">order_num,</if> |
| | | <if test="equipment != null">equipment,</if> |
| | | <if test="energyId != null">energy_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=");" suffixOverrides=","> |
| | | <if test="indexId != null and indexId != ''"> |
| | | #{indexId}, |
| | | </if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="code != null and code != ''">#{code},</if> |
| | | <if test="indexType != null"> |
| | | #{indexType}, |
| | | </if> |
| | | <if test="indexCategory != null and indexCategory != ''"> |
| | | #{indexCategory}, |
| | | </if> |
| | | <if test="remark != null and remark != ''">#{remark}, |
| | | </if> |
| | | <if test="unitId != null and unitId != ''">#{unitId}, |
| | | </if> |
| | | <if test="orderNum != null">#{orderNum}, |
| | | </if> |
| | | <if test="equipment != null">#{equipment}, |
| | | </if> |
| | | <if test="energyId != null">#{energyId}, |
| | | </if> |
| | | </trim> |
| | | <insert id="insertEnergyIndex" parameterType="com.zhitan.model.domain.EnergyIndex"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="indexId != null and indexId != ''">index_id,</if> |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="code != null and code != ''">code,</if> |
| | | <if test="indexType != null">index_type,</if> |
| | | <if test="indexCategory != null and indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="unitId != null and unitId != ''">unit_id,</if> |
| | | <if test="orderNum != null">order_num,</if> |
| | | <if test="equipment != null">equipment,</if> |
| | | <if test="energyId != null">energy_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=");" suffixOverrides=","> |
| | | <if test="indexId != null and indexId != ''"> |
| | | #{indexId}, |
| | | </if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="code != null and code != ''">#{code},</if> |
| | | <if test="indexType != null"> |
| | | #{indexType}, |
| | | </if> |
| | | <if test="indexCategory != null and indexCategory != ''"> |
| | | #{indexCategory}, |
| | | </if> |
| | | <if test="remark != null and remark != ''">#{remark}, |
| | | </if> |
| | | <if test="unitId != null and unitId != ''">#{unitId}, |
| | | </if> |
| | | <if test="orderNum != null">#{orderNum}, |
| | | </if> |
| | | <if test="equipment != null">#{equipment}, |
| | | </if> |
| | | <if test="energyId != null">#{energyId}, |
| | | </if> |
| | | </trim> |
| | | |
| | | </insert> |
| | | <insert id="insertNodeIndex"> |
| | | insert into node_index (node_id, index_id) values (#{nodeId}, #{indexId}); |
| | | </insert> |
| | | <insert id="insertEnergyIndices"> |
| | | <foreach collection="energyIndices" item="energyIndex" separator=";"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''">index_id,</if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">name,</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">code,</if> |
| | | <if test="energyIndex.indexType != null">index_type,</if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">remark,</if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">unit_id,</if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''">meter_id,</if> |
| | | <if test="energyIndex.orderNum != null">order_num,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''"> |
| | | #{energyIndex.indexId}, |
| | | </if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">#{energyIndex.name},</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">#{energyIndex.code},</if> |
| | | <if test="energyIndex.indexType != null"> |
| | | #{energyIndex.indexType}, |
| | | </if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | #{energyIndex.indexCategory}, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">#{energyIndex.remark}, |
| | | </if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">#{energyIndex.unitId}, |
| | | </if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''"> |
| | | #{energyIndex.meterId}, |
| | | </if> |
| | | <if test="energyIndex.orderNum != null">#{energyIndex.orderNum},</if> |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | | <insert id="saveEnergyIndex"> |
| | | <foreach collection="list" item="energyIndex" separator=";"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''">index_id,</if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">name,</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">code,</if> |
| | | <if test="energyIndex.indexType != null">index_type,</if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">remark,</if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">unit_id,</if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''">meter_id,</if> |
| | | <if test="energyIndex.orderNum != null">order_num,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''"> |
| | | #{energyIndex.indexId}, |
| | | </if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">#{energyIndex.name},</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">#{energyIndex.code},</if> |
| | | <if test="energyIndex.indexType != null"> |
| | | #{energyIndex.indexType}, |
| | | </if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | #{energyIndex.indexCategory}, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">#{energyIndex.remark}, |
| | | </if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">#{energyIndex.unitId}, |
| | | </if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''"> |
| | | #{energyIndex.meterId}, |
| | | </if> |
| | | <if test="energyIndex.orderNum != null">#{energyIndex.orderNum},</if> |
| | | </trim> |
| | | ; |
| | | insert into node_index (node_id, index_id) values (#{energyIndex.nodeId}, |
| | | #{energyIndex.indexId}); |
| | | </foreach> |
| | | </insert> |
| | | </insert> |
| | | <insert id="insertNodeIndex"> |
| | | insert into node_index (node_id, index_id) |
| | | values (#{nodeId}, #{indexId}); |
| | | </insert> |
| | | <insert id="insertEnergyIndices"> |
| | | <foreach collection="energyIndices" item="energyIndex" separator=";"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''">index_id,</if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">name,</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">code,</if> |
| | | <if test="energyIndex.indexType != null">index_type,</if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">remark,</if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">unit_id,</if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''">meter_id,</if> |
| | | <if test="energyIndex.orderNum != null">order_num,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''"> |
| | | #{energyIndex.indexId}, |
| | | </if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">#{energyIndex.name},</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">#{energyIndex.code},</if> |
| | | <if test="energyIndex.indexType != null"> |
| | | #{energyIndex.indexType}, |
| | | </if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | #{energyIndex.indexCategory}, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">#{energyIndex.remark}, |
| | | </if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">#{energyIndex.unitId}, |
| | | </if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''"> |
| | | #{energyIndex.meterId}, |
| | | </if> |
| | | <if test="energyIndex.orderNum != null">#{energyIndex.orderNum},</if> |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | | <insert id="saveEnergyIndex"> |
| | | <foreach collection="list" item="energyIndex" separator=";"> |
| | | insert into energy_index |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''">index_id,</if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">name,</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">code,</if> |
| | | <if test="energyIndex.indexType != null">index_type,</if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | index_category, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">remark,</if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">unit_id,</if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''">meter_id,</if> |
| | | <if test="energyIndex.orderNum != null">order_num,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="energyIndex.indexId != null and energyIndex.indexId != ''"> |
| | | #{energyIndex.indexId}, |
| | | </if> |
| | | <if test="energyIndex.name != null and energyIndex.name != ''">#{energyIndex.name},</if> |
| | | <if test="energyIndex.code != null and energyIndex.code != ''">#{energyIndex.code},</if> |
| | | <if test="energyIndex.indexType != null"> |
| | | #{energyIndex.indexType}, |
| | | </if> |
| | | <if test="energyIndex.indexCategory != null and energyIndex.indexCategory != ''"> |
| | | #{energyIndex.indexCategory}, |
| | | </if> |
| | | <if test="energyIndex.remark != null and energyIndex.remark != ''">#{energyIndex.remark}, |
| | | </if> |
| | | <if test="energyIndex.unitId != null and energyIndex.unitId != ''">#{energyIndex.unitId}, |
| | | </if> |
| | | <if test="energyIndex.meterId != null and energyIndex.meterId != ''"> |
| | | #{energyIndex.meterId}, |
| | | </if> |
| | | <if test="energyIndex.orderNum != null">#{energyIndex.orderNum},</if> |
| | | </trim> |
| | | ; |
| | | insert into node_index (node_id, index_id) values (#{energyIndex.nodeId}, |
| | | #{energyIndex.indexId}); |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateEnergyIndex" parameterType="EnergyIndex"> |
| | | update energy_index |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="code != null and code != ''">code = #{code},</if> |
| | | <if test="indexType != null">index_type = #{indexType},</if> |
| | | <if test="indexCategory != null and indexCategory != ''">index_category = #{indexCategory}, |
| | | </if> |
| | | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| | | <if test="unitId != null and unitId != ''">unit_id = #{unitId},</if> |
| | | <if test="orderNum != null">order_num = #{orderNum},</if> |
| | | <if test="equipment != null">equipment = #{equipment},</if> |
| | | <if test="energyId != null">energy_id=#{energyId},</if> |
| | | </trim> |
| | | where index_id = #{indexId} |
| | | </update> |
| | | <update id="updateEnergyIndex" parameterType="com.zhitan.model.domain.EnergyIndex"> |
| | | update energy_index |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="code != null and code != ''">code = #{code},</if> |
| | | <if test="indexType != null">index_type = #{indexType},</if> |
| | | <if test="indexCategory != null and indexCategory != ''">index_category = #{indexCategory}, |
| | | </if> |
| | | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| | | <if test="unitId != null and unitId != ''">unit_id = #{unitId},</if> |
| | | <if test="orderNum != null">order_num = #{orderNum},</if> |
| | | <if test="equipment != null">equipment = #{equipment},</if> |
| | | <if test="energyId != null">energy_id=#{energyId},</if> |
| | | </trim> |
| | | where index_id = #{indexId} |
| | | </update> |
| | | |
| | | <delete id="deleteEnergyIndexByIds" parameterType="String"> |
| | | delete from energy_index where index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach>; |
| | | delete from node_index where node_id = #{nodeId} and index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach>; |
| | | </delete> |
| | | <delete id="deleteIndexByMeterId"> |
| | | delete |
| | | from energy_index |
| | | where meter_id = #{meterId} |
| | | </delete> |
| | | <delete id="removeNodeIndex"> |
| | | delete from node_index where node_id = #{nodeId} and index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach>; |
| | | </delete> |
| | | <delete id="deleteByIndexId"> |
| | | delete |
| | | from energy_index |
| | | where index_id = #{indexId} |
| | | </delete> |
| | | <delete id="deleteEnergyIndexByIds" parameterType="String"> |
| | | delete from energy_index where index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach>; |
| | | delete from node_index where node_id = #{nodeId} and index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach>; |
| | | </delete> |
| | | <delete id="deleteIndexByMeterId"> |
| | | delete |
| | | from energy_index |
| | | where meter_id = #{meterId} |
| | | </delete> |
| | | <delete id="removeEnergyIndex"> |
| | | delete from energy_index where index_id in |
| | | <foreach collection="indexIds" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getEnergyIndexMeterByCodes" resultMap="EnergyIndexResult"> |
| | | select ei.index_id, |
| | | <select id="getEnergyIndexMeterByCodes" resultMap="EnergyIndexResult"> |
| | | select ei.index_id, |
| | | ei.name, |
| | | ei.code, |
| | | ei.index_type, |
| | |
| | | ei.energy_id, |
| | | meter_name |
| | | from energy_index as ei,meter_implement as me |
| | | where ei.code in |
| | | <foreach item="indexCode" collection="list" open="(" separator="," close=")"> |
| | | #{indexCode} |
| | | </foreach> |
| | | and ei.meter_id = me.id |
| | | order by ei.order_num |
| | | </select> |
| | | |
| | | <select id="selectEnergyIndexPage" resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="query.codeOrName != null and query.codeOrName != ''">and (name like concat('%', #{query.codeOrName}, |
| | | '%') or code like concat('%', #{query.codeOrName}, '%')) |
| | | </if> |
| | | <if test="query.indexType != null">and index_type = #{query.indexType}</if> |
| | | <if test="query.nodeId != null and query.nodeId != ''">and ni.node_id = #{query.nodeId}</if> |
| | | <if test="query.indexCategory != null and query.indexCategory != ''">and index_category = |
| | | #{query.indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | |
| | | </select> |
| | | <select id="listIndexByMeterIds" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | select ei.index_id, |
| | | name, |
| | | code, |
| | | index_type, |
| | | index_category, |
| | | remark, |
| | | unit_id, |
| | | meter_id, |
| | | order_num, |
| | | equipment, |
| | | energy_id |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | |
| | | <if test="nodeId != null and nodeId != ''">and ni.node_id = #{nodeId}</if> |
| | | <if test="meterIds != null"> |
| | | and ei.meter_id in |
| | | <foreach collection="meterIds" item="meterId" open="(" separator="," close=")"> |
| | | #{meterId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | where ei.code in |
| | | <foreach item="indexCode" collection="list" open="(" separator="," close=")"> |
| | | #{indexCode} |
| | | </foreach> |
| | | and ei.meter_id = me.id |
| | | order by ei.order_num |
| | | </select> |
| | | <select id="getiEnergyIndexByCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where code = #{cdoe} |
| | | </select> |
| | | <select id="getIndexByCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei |
| | | LEFT JOIN node_device nd on ei.meter_id = nd.device_id |
| | | LEFT JOIN meter_implement mi on mi."id" = nd.device_id |
| | | <where> |
| | | <if test="nodeId != null and nodeId != ''">and nd.node_id = #{nodeId}</if> |
| | | <if test="code != null and code != ''"> |
| | | and (mi.meter_name like concat('%', #{code}, '%') |
| | | or ei.code like concat('%', #{code}, '%') |
| | | or ei.name like concat('%', #{code}, '%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getIndexByMeterIdIndexCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei |
| | | LEFT JOIN node_device nd on ei.meter_id = nd.device_id |
| | | LEFT JOIN meter_implement mi on mi."id" = nd.device_id |
| | | <where> |
| | | <if test="nodeId != null and nodeId != ''">and nd.node_id = #{nodeId}</if> |
| | | <if test="indexCode != null and indexCode != ''"> |
| | | and (mi.meter_name like concat('%', #{indexCode}, '%') |
| | | or ei.code like concat('%', #{indexCode}, '%') |
| | | or ei.name like concat('%', #{indexCode}, '%') |
| | | ) |
| | | </if> |
| | | <if test="meterId != null and meterId != ''"> |
| | | and ei.meter_id = #{meterId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectEnergyIndexPage" resultMap="EnergyIndexResult"> |
| | | select ni.index_id, name, code, index_type, remark, unit_id, index_category |
| | | from energy_index ei left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | <if test="query.codeOrName != null and query.codeOrName != ''">and (name like concat('%', |
| | | #{query.codeOrName}, |
| | | '%') or code like concat('%', #{query.codeOrName}, '%')) |
| | | </if> |
| | | <if test="query.indexType != null">and index_type = #{query.indexType}</if> |
| | | <if test="query.nodeId != null and query.nodeId != ''">and ni.node_id = #{query.nodeId}</if> |
| | | <if test="query.indexCategory != null and query.indexCategory != ''">and index_category = |
| | | #{query.indexCategory} |
| | | </if> |
| | | </where> |
| | | order by ei.order_num |
| | | |
| | | </select> |
| | | <select id="listIndexByMeterIds" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | select ei.index_id, |
| | | name, |
| | | code, |
| | | index_type, |
| | | index_category, |
| | | remark, |
| | | unit_id, |
| | | meter_id, |
| | | order_num, |
| | | equipment, |
| | | energy_id |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | <where> |
| | | |
| | | <if test="nodeId != null and nodeId != ''">and ni.node_id = #{nodeId}</if> |
| | | <if test="meterIds != null"> |
| | | and ei.meter_id in |
| | | <foreach collection="meterIds" item="meterId" open="(" separator="," close=")"> |
| | | #{meterId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getiEnergyIndexByCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | <include refid="selectEnergyIndexVo"/> |
| | | where code = #{cdoe} |
| | | </select> |
| | | <select id="getIndexByCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei |
| | | LEFT JOIN node_device nd on ei.meter_id = nd.device_id |
| | | LEFT JOIN meter_implement mi on mi."id" = nd.device_id |
| | | <where> |
| | | <if test="nodeId != null and nodeId != ''">and nd.node_id = #{nodeId}</if> |
| | | <if test="code != null and code != ''"> |
| | | and (mi.meter_name like concat('%', #{code}, '%') |
| | | or ei.code like concat('%', #{code}, '%') |
| | | or ei.name like concat('%', #{code}, '%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getIndexByMeterIdIndexCode" resultType="com.zhitan.model.domain.EnergyIndex"> |
| | | SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei |
| | | LEFT JOIN node_device nd on ei.meter_id = nd.device_id |
| | | LEFT JOIN meter_implement mi on mi."id" = nd.device_id |
| | | <where> |
| | | <if test="nodeId != null and nodeId != ''">and nd.node_id = #{nodeId}</if> |
| | | <if test="indexCode != null and indexCode != ''"> |
| | | and (mi.meter_name like concat('%', #{indexCode}, '%') |
| | | or ei.code like concat('%', #{indexCode}, '%') |
| | | or ei.name like concat('%', #{indexCode}, '%') |
| | | ) |
| | | </if> |
| | | <if test="meterId != null and meterId != ''"> |
| | | and ei.meter_id = #{meterId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getModelNodeIndexInfoListByIndexIds" |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mi.model_name modelName, |
| | | mi.model_code, |
| | | mn."name" "name", |
| | | ei.index_id, |
| | | ei.code indexCode, |
| | | ei."name" indexName, |
| | | ei.energy_id, |
| | | ei.energy_id |
| | | FROM node_index ni |
| | | INNER JOIN energy_index ei ON ni.index_id = ei.index_id |
| | | LEFT JOIN model_node mn ON ni.node_id = mn.node_id |
| | | LEFT JOIN model_info mi ON mn.model_code = mi.model_code |
| | | WHERE ei.index_id IN |
| | | <foreach collection="indexIds" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="selectEnergyTypeByIndex" resultType="com.zhitan.basicdata.domain.vo.MeterImplementModel"> |
| | | select ex.index_id indexId, |
| | | mi.id meterId, |
| | | mi.energy_type energyType |
| | | from energy_index ex |
| | | left join meter_implement mi on ex.meter_id = mi.id |
| | | where ex.index_id in |
| | | <foreach collection="indexIds" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="getModelNodeIndexIdRelationInforByCode" |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId |
| | |
| | | </select> |
| | | |
| | | <select id="listModelNodeIndexIdRelationInforByParentId" |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId |
| | |
| | | </select> |
| | | |
| | | <select id="getModelNodeIndexIdRelationInforByNodeId" |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId |
| | |
| | | LIMIT 1; |
| | | </select> |
| | | <select id="selectIndexByModelCodeAndNodeId" |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name", |
| | | ni.index_id indexId |
| | |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="getModelNodeIndexIdByNodeId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | <select id="getModelNodeIndexIdByNodeId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId, |
| | | ei.energy_id energyId, |
| | | ei.index_type indexType |
| | | ei.index_type indexType, |
| | | ei.unit_id unitId |
| | | FROM "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | LEFT JOIN energy_index ei on ni.index_id = ei.index_id |
| | |
| | | and ei.energy_id = #{energyType} |
| | | </if> |
| | | </select> |
| | | <select id="getModelNodeByParentId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | <select id="getModelNodeByParentId" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId, |
| | |
| | | where model_code = #{modelCode} AND parent_id is null |
| | | order by order_num |
| | | </select> |
| | | <select id="selectIndexByNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfor"> |
| | | <select id="selectIndexByNodeIds" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" "name", |
| | | ni.index_id indexId, |
| | |
| | | AND di.data_time >= #{dateTimeMap.startTime} |
| | | AND di.data_time <= #{dateTimeMap.endTime} |
| | | </select> |
| | | <select id="getAllModelNodeIndexByAddress" resultType="com.zhitan.model.domain.vo.ModelNodeIndexInfo"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn.code nodeCode, |
| | | mn."name" nodeName, |
| | | ni.index_id indexId, |
| | | ei."name" indexName, |
| | | ei.index_type indexType, |
| | | mi.energy_type |
| | | FROM |
| | | "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | LEFT JOIN energy_index ei ON ni.index_id = ei.index_id |
| | | LEFT JOIN meter_implement mi ON mi."id" = ei.meter_id |
| | | WHERE |
| | | mn.model_code = #{modelCode} |
| | | AND mn.address LIKE concat( #{address} , '%' ) |
| | | </select> |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.system.mapper.SysConfigMapper"> |
| | | |
| | | <resultMap type="SysConfig" id="SysConfigResult"> |
| | | <resultMap type="com.zhitan.system.domain.SysConfig" id="SysConfigResult"> |
| | | <id property="configId" column="config_id" /> |
| | | <result property="configName" column="config_name" /> |
| | | <result property="configKey" column="config_key" /> |
| | |
| | | <include refid="selectConfigVo"/> |
| | | where config_key = #{configKey} |
| | | </select> |
| | | |
| | | <select id="selectConfigById" resultType="com.zhitan.system.domain.SysConfig"> |
| | | <include refid="selectConfigVo"/> |
| | | where config_id = #{configId} |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="SysConfig"> |
| | | insert into sys_config ( |
| | | <if test="configName != null and configName != '' ">config_name,</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.system.mapper.SysRoleMapper"> |
| | | |
| | | <resultMap type="SysRole" id="SysRoleResult"> |
| | | <resultMap type="com.zhitan.common.core.domain.entity.SysRole" id="SysRoleResult"> |
| | | <id property="roleId" column="role_id" /> |
| | | <result property="roleName" column="role_name" /> |
| | | <result property="roleKey" column="role_key" /> |
| | |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | </sql> |
| | | |
| | | <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult"> |
| | | <select id="selectRoleList" parameterType="com.zhitan.common.core.domain.entity.SysRole" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.del_flag = '0' |
| | | <if test="roleId != null and roleId != 0"> |
| | |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | <insert id="insertRole" parameterType="com.zhitan.common.core.domain.entity.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | insert into sys_role( |
| | | <if test="roleId != null and roleId != 0">role_id,</if> |
| | | <if test="roleName != null and roleName != ''">role_name,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateRole" parameterType="SysRole"> |
| | | <update id="updateRole" parameterType="com.zhitan.common.core.domain.entity.SysRole"> |
| | | update sys_role |
| | | <set> |
| | | <if test="roleName != null and roleName != ''">role_name = #{roleName},</if> |
| | |
| | | where role_id = #{roleId} |
| | | </update> |
| | | |
| | | <update id="updateRoleStatus" parameterType="SysRole"> |
| | | <update id="updateRoleStatus" parameterType="com.zhitan.common.core.domain.entity.SysRole"> |
| | | update sys_user set status = #{status} where user_id = #{userId} |
| | | </update> |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.system.mapper.SysRoleMenuMapper"> |
| | | |
| | | <resultMap type="SysRoleMenu" id="SysRoleMenuResult"> |
| | | <result property="roleId" column="role_id" /> |
| | | <result property="menuId" column="menu_id" /> |
| | | <resultMap type="com.zhitan.system.domain.SysRoleMenu" id="SysRoleMenuResult"> |
| | | <result property="roleId" column="role_id"/> |
| | | <result property="menuId" column="menu_id"/> |
| | | </resultMap> |
| | | |
| | | <select id="checkMenuExistRole" resultType="Integer"> |
| | |
| | | <delete id="deleteRoleMenuByRoleId" parameterType="Long"> |
| | | delete from sys_role_menu where role_id=#{roleId} |
| | | </delete> |
| | | |
| | | <delete id="deleteRoleMenu" parameterType="arraylist"> |
| | | delete from sys_role_menu where role_id in ( |
| | | <foreach collection="ids" item="roleId" separator=","> |
| | | #{roleId} |
| | | </foreach> |
| | | ) |
| | | </delete> |
| | | |
| | | <insert id="batchRoleMenu"> |
| | | insert into sys_role_menu(role_id, menu_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.system.mapper.SysUserMapper"> |
| | | |
| | | <resultMap type="SysUser" id="SysUserResult"> |
| | | <resultMap type="com.zhitan.common.core.domain.entity.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="userName" column="user_name"/> |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="singleUser" column="single_user"/> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <association property="dept" javaType="com.zhitan.common.core.domain.entity.SysDept" resultMap="deptResult"/> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="deptResult" type="SysDept"> |
| | | <resultMap id="deptResult" type="com.zhitan.common.core.domain.entity.SysDept"> |
| | | <id property="deptId" column="dept_id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="ancestors" column="ancestors" /> |
| | | <result property="ancestors" column="ancestors"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="leader" column="leader"/> |
| | | <result property="status" column="dept_status"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="RoleResult" type="SysRole"> |
| | | <resultMap id="RoleResult" type="com.zhitan.common.core.domain.entity.SysRole"> |
| | | <id property="roleId" column="role_id"/> |
| | | <result property="roleName" column="role_name"/> |
| | | <result property="roleKey" column="role_key"/> |
| | |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | <select id="selectUserList" parameterType="com.zhitan.common.core.domain.entity.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phone_number, u.password, u.sex, |
| | | u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.single_user, d.dept_name, d.leader from |
| | | u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.single_user, d.dept_name, |
| | | d.leader from |
| | | sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> |
| | |
| | | where u.user_id = #{userId} |
| | | </select> |
| | | |
| | | <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 |
| | | <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, user_name |
| | | from sys_user |
| | | where user_name = #{userName} |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, phone_number from sys_user where phone_number = #{phoneNumber} and del_flag = '0' limit 1 |
| | | select user_id, phone_number |
| | | from sys_user |
| | | where phone_number = #{phoneNumber} |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | select user_id, email |
| | | from sys_user |
| | | where email = #{email} |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | <select id="selectAllocatedList" parameterType="com.zhitan.common.core.domain.entity.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phone_number, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phoneNumber != null and phoneNumber != ''"> |
| | | AND u.phone_number like concat('%', #{phoneNumber}, '%') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="com.zhitan.common.core.domain.entity.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phone_number, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and |
| | | ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phoneNumber != null and phoneNumber != ''"> |
| | | AND u.phone_number like concat('%', #{phoneNumber}, '%') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.zhitan.common.core.domain.entity.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateUser" parameterType="SysUser"> |
| | | <update id="updateUser" parameterType="com.zhitan.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | <set> |
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
| | | <if test="userName != null and userName != ''">user_name = #{userName},</if> |
| | | <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> |
| | | <if test="email != null ">email = #{email},</if> |
| | | <if test="phoneNumber != null ">phone_number = #{phoneNumber},</if> |
| | | <if test="email != null ">email = #{email},</if> |
| | | <if test="phoneNumber != null ">phone_number = #{phoneNumber},</if> |
| | | <if test="sex != null and sex != ''">sex = #{sex},</if> |
| | | <if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
| | | <if test="password != null and password != ''">password = #{password},</if> |
| | |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserStatus" parameterType="SysUser"> |
| | | <update id="updateUserStatus" parameterType="com.zhitan.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | set status = #{status} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserAvatar" parameterType="SysUser"> |
| | | <update id="updateUserAvatar" parameterType="com.zhitan.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | set avatar = #{avatar} |
| | | where user_name = #{userName} |
| | | </update> |
| | | |
| | | <update id="resetUserPwd" parameterType="SysUser"> |
| | | <update id="resetUserPwd" parameterType="com.zhitan.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | set password = #{password} |
| | | where user_name = #{userName} |
| | |
| | | VITE_APP_ENV = 'development' |
| | | |
| | | # ç³»ç»/å¼åç¯å¢ |
| | | # test |
| | | VITE_APP_BASE_API = '/dev-api' |
| | | # hangmingjun |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // å项ç¨è½åæ |
| | | itemizedEnergyAnalysis(data) { |
| | | return request({ |
| | | url: "/itemizedEnergyAnalysis/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // æ¯è·¯ç¨è½åæ |
| | | branchanalysis(data) { |
| | | return request({ |
| | | url: "/branchanalysis/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // æ¥è¯¢ææè®¾å¤å表 |
| | | getFacilityArchives(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/getFacilityArchives", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // æ¥è¯¢éç¹è®¾å¤å表 |
| | | getPointFacility(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/getPointFacility", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼æï¼å表 |
| | | monthlyList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/MonthlyKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼æï¼å¾è¡¨ |
| | | monthlyChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/MonthlyKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å表 |
| | | yearList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/YearKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å¾è¡¨ |
| | | yearChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/YearKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å表 |
| | | monthlyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å¾è¡¨ |
| | | monthlyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å表 |
| | | yearList(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å¾è¡¨ |
| | | yearChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z"></path><path d="M12 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-4 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg> |
| | |
| | | body { |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | -moz-osx-font-smoothing: grayscale; |
| | | -webkit-font-smoothing: antialiased; |
| | | text-rendering: optimizeLegibility; |
| | | font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; |
| | | overflow-x: hidden; /* 鲿¢æ°´å¹³æ»å¨æ¡ */ |
| | | } |
| | | |
| | | label { |
| | |
| | | html { |
| | | height: 100%; |
| | | box-sizing: border-box; |
| | | margin: 0; |
| | | padding: 0; |
| | | overflow-x: hidden; /* 鲿¢æ°´å¹³æ»å¨æ¡ */ |
| | | } |
| | | |
| | | #app { |
| | | height: 100%; |
| | | width: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | overflow-x: hidden; /* 鲿¢æ°´å¹³æ»å¨æ¡ */ |
| | | } |
| | | |
| | | *, |
| | |
| | | // ::v-deep(.el-range-separator) { |
| | | color: #999 !important; |
| | | } |
| | | } |
| | | |
| | | /* æå èåæ ·å¼è°æ´ï¼ç¡®ä¿å¨æææ
åµä¸èå项å±
ä¸ */ |
| | | .el-menu--collapse { |
| | | width: 54px !important; |
| | | |
| | | .el-sub-menu, .el-menu-item { |
| | | width: 36px !important; |
| | | min-width: 36px !important; |
| | | margin-left: 9px !important; /* å
³é®ï¼è®¾ç½®åºå®ç左边è·9px使èå项å±
ä¸ */ |
| | | margin-right: 9px !important; |
| | | } |
| | | |
| | | .el-menu-item, .el-sub-menu__title { |
| | | display: flex !important; |
| | | justify-content: center !important; |
| | | align-items: center !important; |
| | | padding: 0 !important; |
| | | |
| | | .svg-icon, .el-icon { |
| | | margin: 0 !important; /* éè¦ï¼ç§»é¤å¾æ çææè¾¹è· */ |
| | | } |
| | | |
| | | .el-sub-menu__icon-arrow { |
| | | display: none !important; |
| | | } |
| | | |
| | | > span { |
| | | display: none !important; |
| | | } |
| | | } |
| | | |
| | | /* éä¸ç¶ææ ·å¼ */ |
| | | .el-menu-item.is-active, .el-sub-menu.is-active > .el-sub-menu__title { |
| | | background-color: #3883FA !important; |
| | | color: #fff !important; |
| | | } |
| | | } |
| | |
| | | display: flex; |
| | | |
| | | .page-container-left { |
| | | width: 280px; |
| | | width: 220px; |
| | | min-height: calc(100vh - 148px); |
| | | border-right: 1px solid #1a235d; |
| | | background: #1F1C49; |
| | | background: #08234F; |
| | | |
| | | .el-tree { |
| | | &.el-tree--highlight-current, |
| | | &:not(.el-tree--highlight-current) { |
| | | .el-tree-node { |
| | | .el-tree-node__content { |
| | | .el-tree-node__label, |
| | | span { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | |
| | | .el-tree-node__expand-icon { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tree-container, .tree { |
| | | .el-tree-node__label, |
| | | .el-tree-node__content span { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | |
| | | .tree { |
| | | height: calc(100vh - 170px); |
| | |
| | | } |
| | | |
| | | .form-card { |
| | | background: #1a235d; |
| | | border-radius: 0px 0px 0px 0px; |
| | | border: 1px solid #000000; |
| | | padding: 18px 0 0 15px; |
| | | background: #08234F; |
| | | border-radius: 0px; |
| | | height: 52px; |
| | | line-height: 52px; |
| | | margin: 0 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .el-form.el-form--inline { |
| | | margin-left: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: nowrap; |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | margin-right: 15px; |
| | | margin-bottom: 0; |
| | | height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | &.is-required { |
| | | .el-form-item__label::before { |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | color: #ffffff; |
| | | } |
| | | |
| | | .el-form-item__content { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 32px; |
| | | line-height: 32px; |
| | | |
| | | .el-input, .el-select, .el-date-editor { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .el-input__wrapper { |
| | | height: 32px; |
| | | } |
| | | |
| | | .el-button { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | padding-top: 0; |
| | | padding-bottom: 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .table-bg-style { |
| | |
| | | display: flex; |
| | | |
| | | .page-container-left { |
| | | width: 280px; |
| | | width: 220px; |
| | | min-height: calc(100vh - 148px); |
| | | border-right: 1px solid #fff; |
| | | border-right: 1px solid #e8e8e8; |
| | | background: #f1f4fa; |
| | | |
| | | .el-tree { |
| | | &.el-tree--highlight-current, |
| | | &:not(.el-tree--highlight-current) { |
| | | .el-tree-node { |
| | | .el-tree-node__content { |
| | | .el-tree-node__label, |
| | | span { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | |
| | | .el-tree-node__expand-icon { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // border-right: 1px solid #1a235d; |
| | | .tree-container, .tree { |
| | | .el-tree-node__label, |
| | | .el-tree-node__content span { |
| | | font-size: 14px !important; |
| | | } |
| | | } |
| | | |
| | | .tree { |
| | | height: calc(100vh - 170px) !important; |
| | | max-height: calc(100vh - 170px) !important; |
| | | height: calc(100vh - 170px); |
| | | max-height: calc(100vh - 170px); |
| | | overflow-y: auto; |
| | | } |
| | | } |
| | |
| | | |
| | | .form-card { |
| | | background: #fff; |
| | | // background: #F7F8FA; |
| | | border-radius: 0px 0px 0px 0px; |
| | | // border: 1px solid #000000; |
| | | padding: 18px 0 0 15px; |
| | | border-radius: 0px; |
| | | height: 52px; |
| | | line-height: 52px; |
| | | margin: 0 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .el-form.el-form--inline { |
| | | margin-left: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: nowrap; |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | margin-right: 15px; |
| | | margin-bottom: 0; |
| | | height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .el-form-item__label { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .el-form-item__content { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 32px; |
| | | line-height: 32px; |
| | | |
| | | .el-input, .el-select, .el-date-editor { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .el-input__wrapper { |
| | | height: 32px; |
| | | } |
| | | |
| | | .el-button { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | padding-top: 0; |
| | | padding-bottom: 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .table-bg-style { |
| | |
| | | |
| | | } |
| | | |
| | | // å é¤ä¹åæ·»å çå
¨å±æ ·å¼è¦çï¼é¿å
å½±åå
¨å± |
| | | // ä¿çè°è¯å»ºè®® |
| | | /* |
| | | æ¨å¯ä»¥å¨æµè§å¨ä¸ä½¿ç¨ä»¥ä¸å
èæ ·å¼è¿è¡è°è¯: |
| | | document.querySelectorAll('.page-container-left .el-tree-node__label').forEach(el => { |
| | | el.style.cssText = 'font-size: 14px !important'; |
| | | }); |
| | | */ |
| | | |
| | | .padding { |
| | | padding: 15px; |
| | | } |
| | |
| | | // æ |
| | | .el-tree { |
| | | background: transparent; |
| | | font-size: 16px; |
| | | font-size: 14px; |
| | | color: #ffffff; |
| | | |
| | | .el-tree-node__content { |
| | |
| | | .themeDark { |
| | | #app { |
| | | .el-menu-item.is-active { |
| | | background: #3271eb !important; |
| | | // background: #3271eb !important; |
| | | // border-radius: 30px 30px 30px 30px !important; |
| | | color: #fff; |
| | | } |
| | |
| | | |
| | | |
| | | .main-container { |
| | | background-color: #110f2e !important; |
| | | height: 100%; |
| | | transition: margin-left 0.28s; |
| | | margin-left: $base-sidebar-width; |
| | |
| | | transition: width 0.28s; |
| | | width: $base-sidebar-width !important; |
| | | background-color: $base-menu-background; |
| | | height: 100%; |
| | | height: calc(100% - 60px) !important; |
| | | position: fixed; |
| | | top: 0; |
| | | top: 60px; |
| | | bottom: 0; |
| | | left: 0; |
| | | z-index: 1001; |
| | | z-index: 999; |
| | | overflow: hidden; |
| | | background-color: #002866 !important; |
| | | -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); |
| | | box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); |
| | | font-family: OPPOSans, OPPOSans; |
| | |
| | | |
| | | .scrollbar-wrapper { |
| | | overflow-x: hidden !important; |
| | | height: calc(100% - 290px) !important; |
| | | } |
| | | |
| | | .el-scrollbar__bar.is-vertical { |
| | | right: 0px; |
| | | right: 0 !important; |
| | | } |
| | | |
| | | .el-scrollbar { |
| | |
| | | .menu-title { |
| | | overflow: hidden !important; |
| | | font-weight: 400 !important; |
| | | font-size: 16px !important; |
| | | font-size: 14px !important; |
| | | } |
| | | |
| | | // @media (min-width: 1440px) { |
| | |
| | | } |
| | | |
| | | .el-menu--collapse { |
| | | .el-sub-menu { |
| | | & > .el-sub-menu__title { |
| | | & > span { |
| | | height: 0; |
| | | width: 0; |
| | | overflow: hidden; |
| | | visibility: hidden; |
| | | display: inline-block; |
| | | } |
| | | & > i { |
| | | height: 0; |
| | | width: 0; |
| | | overflow: hidden; |
| | | visibility: hidden; |
| | | display: inline-block; |
| | | } |
| | | width: 54px !important; |
| | | |
| | | /* æ¸
é¤å代鿩å¨ä¸å¹²æ°å±
ä¸çæ ·å¼ */ |
| | | .el-sub-menu, .el-menu-item { |
| | | margin: 0 !important; |
| | | padding: 0 !important; |
| | | width: 100% !important; |
| | | |
| | | /* è®©å¾æ åèå项å±
ä¸ */ |
| | | .el-menu-item, .el-sub-menu__title { |
| | | width: 36px !important; |
| | | min-width: 36px !important; |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | margin: 4px 9px !important; /* 精确计ç®å±
ä¸è¾¹è· */ |
| | | padding: 0 !important; |
| | | display: flex !important; |
| | | justify-content: center !important; |
| | | align-items: center !important; |
| | | border-radius: 4px !important; |
| | | } |
| | | |
| | | /* ç¡®ä¿å¾æ å±
ä¸ */ |
| | | .svg-icon, .el-icon { |
| | | margin: 0 !important; |
| | | padding: 0 !important; |
| | | } |
| | | } |
| | | } |
| | |
| | | .themeLight { |
| | | #app { |
| | | .el-menu-item.is-active { |
| | | background: #e0eafc !important; |
| | | |
| | | // border-radius: 30px 30px 30px 30px !important; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .main-container { |
| | | background-color: #f7f8fa; |
| | | height: 100%; |
| | | transition: margin-left 0.28s; |
| | | margin-left: $base-sidebar-width; |
| | |
| | | transition: width 0.28s; |
| | | width: $base-sidebar-width !important; |
| | | background-color: $base-menu-background; |
| | | height: 100%; |
| | | height: calc(100% - 60px) !important; |
| | | position: fixed; |
| | | top: 0; |
| | | top: 60px; |
| | | bottom: 0; |
| | | left: 0; |
| | | z-index: 1001; |
| | | z-index: 999; |
| | | overflow: hidden; |
| | | -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); |
| | | box-shadow: none; |
| | |
| | | .menu-title { |
| | | overflow: hidden !important; |
| | | font-weight: 400 !important; |
| | | font-size: 16px !important; |
| | | font-size: 14px !important; |
| | | } |
| | | |
| | | // @media (min-width: 1440px) { |
| | |
| | | } |
| | | |
| | | .el-menu--collapse { |
| | | .el-sub-menu { |
| | | & > .el-sub-menu__title { |
| | | & > span { |
| | | height: 0; |
| | | width: 0; |
| | | overflow: hidden; |
| | | visibility: hidden; |
| | | display: inline-block; |
| | | } |
| | | & > i { |
| | | height: 0; |
| | | width: 0; |
| | | overflow: hidden; |
| | | visibility: hidden; |
| | | display: inline-block; |
| | | } |
| | | width: 54px !important; |
| | | |
| | | /* æ¸
é¤å代鿩å¨ä¸å¹²æ°å±
ä¸çæ ·å¼ */ |
| | | .el-sub-menu, .el-menu-item { |
| | | margin: 0 !important; |
| | | padding: 0 !important; |
| | | width: 100% !important; |
| | | |
| | | /* è®©å¾æ åèå项å±
ä¸ */ |
| | | .el-menu-item, .el-sub-menu__title { |
| | | width: 36px !important; |
| | | min-width: 36px !important; |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | margin: 4px 9px !important; /* 精确计ç®å±
ä¸è¾¹è· */ |
| | | padding: 0 !important; |
| | | display: flex !important; |
| | | justify-content: center !important; |
| | | align-items: center !important; |
| | | border-radius: 4px !important; |
| | | } |
| | | |
| | | /* ç¡®ä¿å¾æ å±
ä¸ */ |
| | | .svg-icon, .el-icon { |
| | | margin: 0 !important; |
| | | padding: 0 !important; |
| | | } |
| | | } |
| | | } |
| | |
| | | $--color-danger: #F56C6C; |
| | | $--color-info: #909399; |
| | | |
| | | $base-sidebar-width: 260px; |
| | | $base-sidebar-width: 220px; |
| | | |
| | | // the :export directive is the magic sauce for webpack |
| | | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="avatar-container"> |
| | | <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click"> |
| | | <div class="avatar-wrapper"> |
| | | <img :src="userStore.avatar" class="user-avatar" /> |
| | | <el-icon><caret-bottom /></el-icon> |
| | | </div> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <router-link to="/user/profile"> |
| | | <el-dropdown-item>个人ä¸å¿</el-dropdown-item> |
| | | </router-link> |
| | | <el-dropdown-item command="toggleTheme"> |
| | | <span>飿 ¼åæ¢</span> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item divided command="logout"> |
| | | <span>éåºç»å½</span> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ElMessageBox } from "element-plus" |
| | | import useUserStore from "@/store/modules/user" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | |
| | | const userStore = useUserStore() |
| | | const settingsStore = useSettingsStore() |
| | | |
| | | function handleCommand(command) { |
| | | switch (command) { |
| | | case "toggleTheme": |
| | | const newTheme = settingsStore.sideTheme === "theme-dark" ? "theme-light" : "theme-dark"; |
| | | settingsStore.changeSetting({ key: "sideTheme", value: newTheme }); |
| | | document.querySelector("body").className = newTheme === "theme-dark" ? "themeDark" : "themeLight"; |
| | | break; |
| | | case "logout": |
| | | ElMessageBox.confirm("ç¡®å®æ³¨éå¹¶éåºç³»ç»åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | userStore.logOut().then(() => { |
| | | location.href = "/index"; |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | break; |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .avatar-container { |
| | | margin-right: 20px; |
| | | |
| | | .avatar-wrapper { |
| | | margin-top: 5px; |
| | | position: relative; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .user-avatar { |
| | | cursor: pointer; |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .el-icon { |
| | | cursor: pointer; |
| | | margin-left: 8px; |
| | | font-size: 12px; |
| | | color: #ffffff; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .right-menu-item { |
| | | display: inline-block; |
| | | padding: 0 8px; |
| | | height: 100%; |
| | | font-size: 18px; |
| | | color: #ffffff; |
| | | vertical-align: text-bottom; |
| | | |
| | | &.hover-effect { |
| | | cursor: pointer; |
| | | transition: background 0.3s; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, 0.1); |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | font-family: YouSheBiaoTiHei; |
| | | font-size: 1.25vw; //24px; |
| | | color: #fff; |
| | | position: relative; |
| | | padding-left: 12px; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 5px; |
| | | height: 18px; |
| | | background-color: #3883FA; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | border-radius: 7px 7px 0 0; |
| | | padding: 20px; |
| | | background-color: #22408c; |
| | | |
| | | .name { |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #fff; |
| | | position: relative; |
| | | padding-left: 12px; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 5px; |
| | | height: 18px; |
| | | background-color: #3883FA; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | border: 1px solid #ebebeb; |
| | | padding-bottom: 10px; |
| | | background-color: #fff; |
| | | |
| | | .mycard-title { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | |
| | | border-radius: 7px 7px 0 0; |
| | | padding: 20px; |
| | | background-color: #e7eefd; |
| | | |
| | | .name { |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: bold; |
| | | font-size: 18px; |
| | | color: #2d2e31; |
| | | position: relative; |
| | | padding-left: 12px; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 5px; |
| | | height: 18px; |
| | | background-color: #3883FA; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // only show routes with meta.title |
| | | let matched = route.matched.filter(item => item.meta && item.meta.title); |
| | | const first = matched[0] |
| | | // 夿æ¯å¦ä¸ºé¦é¡µ |
| | | if (!isDashboard(first)) { |
| | | matched = [{ path: '/index', meta: { title: 'é¦é¡µ' } }].concat(matched) |
| | | |
| | | // æ·»å è°è¯æ¥å¿ |
| | | console.log('Current route path:', route.path); |
| | | console.log('Route matched:', route.matched); |
| | | console.log('Filtered matched routes:', matched); |
| | | |
| | | // 妿æ¯é¦é¡µçæ¿è·¯ç±ï¼ç¡®ä¿å®è¢«æ·»å å°é¢å
å±ä¸ |
| | | if (route.path === '/index' || route.path === '/index/index') { |
| | | matched = [{ path: '/index', meta: { title: 'é¦é¡µçæ¿' } }].concat(matched) |
| | | console.log('Added index route to matched:', matched); |
| | | } |
| | | |
| | | levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | console.log('Final breadcrumb items:', levelList.value); |
| | | } |
| | | |
| | | function isDashboard(route) { |
| | | const name = route && route.name |
| | | if (!name) { |
| | | return false |
| | | } |
| | | return name.trim() === 'Index' |
| | | return name.trim().toLowerCase() === 'index' |
| | | } |
| | | |
| | | function handleLink(item) { |
| | | const { redirect, path } = item |
| | | if (redirect) { |
| | |
| | | console.log("initChart", series) |
| | | let option = { |
| | | title: { |
| | | // text: props.chartData.title, |
| | | text: props.chartData.title || "", |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | |
| | | </svg> --> |
| | | |
| | | <img src="/src/assets/images/nav-btn.png" width="26" v-if="settingsStore.sideTheme == 'theme-dark'"> |
| | | <img src="/src/assets/images/nav-btn2.png" width="26" v-else> |
| | | <img src="/src/assets/images/nav-btn.png" width="26" v-else> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | window.open(path.substr(pindex, path.length), "_blank"); |
| | | } else { |
| | | if (query) { |
| | | router.push({ path: path, query: JSON.parse(query) }); |
| | | router.push({ path: path, query: query }); |
| | | } else { |
| | | router.push(path) |
| | | } |
| | |
| | | getTree(); |
| | | /** æ¥è¯¢é¨é¨ä¸ææ ç»æ */ |
| | | function getTree() { |
| | | // ç¡®ä¿query.valueæåå§å¼ |
| | | query.value = query.value || {}; |
| | | |
| | | // ä¼å
使ç¨propsä¸ä¼ å
¥çParentModelCode |
| | | if (props.ParentModelCode) { |
| | | query.value = { modelCode: props.ParentModelCode }; |
| | | query.value.modelCode = props.ParentModelCode; |
| | | } else if (useRoute().query.modelCode) { |
| | | // å
¶æ¬¡ä½¿ç¨è·¯ç±ä¸çmodelCode |
| | | query.value.modelCode = useRoute().query.modelCode; |
| | | } else { |
| | | query.value = { ...useRoute().query }; |
| | | // æå使ç¨é»è®¤å¼ |
| | | query.value.modelCode = 'JCZBK_CODE'; |
| | | } |
| | | |
| | | console.log('LeftTree getTree modelCode:', query.value.modelCode); |
| | | |
| | | treeList(query.value).then((response) => { |
| | | nodeOptions.value = response.data; |
| | | if (response.data.length > 0) { |
| | | defaultExpandedKeys.value = []; // æ¸
空已æçkeyï¼é¿å
éå¤ |
| | | response.data.map((item) => { |
| | | defaultExpandedKeys.value.push(item.id); |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | function isTags(route) { |
| | | return !route.hidden && route.name && |
| | | route.name !== 'login' && |
| | | route.name !== '404' && |
| | | route.name !== '401' && |
| | | route.name !== 'index' && |
| | | route.path !== '/index' && |
| | | route.path !== '/'; |
| | | } |
| | | |
| | | function addTags() { |
| | | const { name } = route; |
| | | if (name) { |
| | | // æ£æ¥æ¯å¦ä¸ºé¦é¡µ |
| | | if (name === 'index' || route.path === '/index' || route.path === '/') { |
| | | return; |
| | | } |
| | | store.dispatch('tagsView/addView', route); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | // åå§åæ ç¾ï¼ç¡®ä¿é¦é¡µä¸è¢«æ·»å 为åºå®æ ç¾ |
| | | function initTags() { |
| | | const affixTags = filterAffixTags(routes); |
| | | for (const tag of affixTags) { |
| | | // æé¤é¦é¡µ |
| | | if (tag.path === '/index' || tag.path === '/' || tag.name === 'Index') { |
| | | continue; |
| | | } |
| | | // æ·»å åºå®æ ç¾ |
| | | if (tag.name) { |
| | | store.dispatch('tagsView/addVisitedView', tag); |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-menu |
| | | :default-active="activeMenu" |
| | | mode="horizontal" |
| | | @select="handleSelect" |
| | | :ellipsis="false" |
| | | > |
| | | <template v-for="(item, index) in topMenus"> |
| | | <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"> |
| | | <svg-icon |
| | | v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" |
| | | :icon-class="item.meta.icon"/> |
| | | {{ item.meta.title }} |
| | | </el-menu-item> |
| | | </template> |
| | | |
| | | <!-- é¡¶é¨èåè¶
åºæ°éæå --> |
| | | <el-sub-menu :style="{'--theme': theme}" index="more" v-if="topMenus.length > visibleNumber"> |
| | | <template #title>æ´å¤èå</template> |
| | | <template v-for="(item, index) in topMenus"> |
| | | <el-menu-item |
| | | :index="item.path" |
| | | :key="index" |
| | | v-if="index >= visibleNumber"> |
| | | <svg-icon |
| | | v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" |
| | | :icon-class="item.meta.icon"/> |
| | | {{ item.meta.title }} |
| | | </el-menu-item> |
| | | </template> |
| | | </el-sub-menu> |
| | | </el-menu> |
| | | <div class="top-nav-container"> |
| | | <div class="scroll-arrow left-arrow" @click="scrollLeft" v-show="canScrollLeft"> |
| | | <el-icon><arrow-left /></el-icon> |
| | | </div> |
| | | |
| | | <div class="menu-container" ref="menuContainer"> |
| | | <el-menu |
| | | :default-active="activeMenu" |
| | | mode="horizontal" |
| | | @select="handleSelect" |
| | | :ellipsis="false" |
| | | class="top-menu" |
| | | :class="{ 'theme-dark': theme === 'dark' }" |
| | | > |
| | | <template v-for="(item, index) in topMenus" :key="index"> |
| | | <el-menu-item :style="{'--theme': theme}" :index="item.path"> |
| | | {{ item.meta.title }} |
| | | </el-menu-item> |
| | | </template> |
| | | </el-menu> |
| | | </div> |
| | | |
| | | <div class="scroll-arrow right-arrow" @click="scrollRight" v-show="canScrollRight"> |
| | | <el-icon><arrow-right /></el-icon> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | import useAppStore from '@/store/modules/app' |
| | | import useSettingsStore from '@/store/modules/settings' |
| | | import usePermissionStore from '@/store/modules/permission' |
| | | import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue' |
| | | |
| | | // 顶鍿 åå§æ° |
| | | const visibleNumber = ref(null); |
| | | // æ»å¨ç¸å
³ |
| | | const menuContainer = ref(null); |
| | | const canScrollLeft = ref(false); |
| | | const canScrollRight = ref(false); |
| | | |
| | | // å½åæ¿æ´»èåç index |
| | | const currentIndex = ref(null); |
| | | // éèä¾§è¾¹æ è·¯ç± |
| | |
| | | const tmpPath = path.substring(1, path.length); |
| | | activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); |
| | | if (!route.meta.link) { |
| | | appStore.toggleSideBarHide(false); |
| | | appStore.toggleSideBarHide(false); |
| | | } |
| | | } else if(!route.children) { |
| | | } else if (path === '/index' || path === '/') { |
| | | // é¦é¡µæ¶éèä¾§è¾¹æ |
| | | activePath = path; |
| | | appStore.toggleSideBarHide(true); |
| | | } else if (!route.children) { |
| | | activePath = path; |
| | | appStore.toggleSideBarHide(true); |
| | | } |
| | |
| | | return activePath; |
| | | }) |
| | | |
| | | function setVisibleNumber() { |
| | | const width = document.body.getBoundingClientRect().width / 3; |
| | | visibleNumber.value = parseInt(width / 85); |
| | | function updateScrollButtons() { |
| | | if (!menuContainer.value) return; |
| | | |
| | | const container = menuContainer.value; |
| | | canScrollLeft.value = container.scrollLeft > 10; |
| | | canScrollRight.value = container.scrollLeft < (container.scrollWidth - container.clientWidth - 10); |
| | | } |
| | | |
| | | function scrollLeft() { |
| | | if (!menuContainer.value) return; |
| | | menuContainer.value.scrollBy({ left: -200, behavior: 'smooth' }); |
| | | setTimeout(updateScrollButtons, 300); |
| | | } |
| | | |
| | | function scrollRight() { |
| | | if (!menuContainer.value) return; |
| | | menuContainer.value.scrollBy({ left: 200, behavior: 'smooth' }); |
| | | setTimeout(updateScrollButtons, 300); |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾ææ·±å±çåèåï¼å¶åèç¹ï¼ |
| | | * é彿¥æ¾ç¬¬ä¸ä¸ªæ²¡æchildrençåèå |
| | | */ |
| | | function findDeepestLeafMenu(route) { |
| | | if (!route) return null; |
| | | |
| | | // å¦ææ²¡æåèåæåèå为空ï¼åè¿åå½åè·¯ç± |
| | | if (!route.children || route.children.length === 0) { |
| | | return route; |
| | | } |
| | | |
| | | // æ¾å°ç¬¬ä¸ä¸ªééèçåèå |
| | | const firstVisibleChild = route.children.find(child => !child.hidden); |
| | | if (!firstVisibleChild) { |
| | | return route; // 妿ææåèå齿¯éèçï¼è¿åå½åè·¯ç± |
| | | } |
| | | |
| | | // é彿¥æ¾è¿ä¸ªåèåçææ·±å±åèå |
| | | return findDeepestLeafMenu(firstVisibleChild); |
| | | } |
| | | |
| | | function handleSelect(key, keyPath) { |
| | | currentIndex.value = key; |
| | | const route = routers.value.find(item => item.path === key); |
| | | |
| | | if (isHttp(key)) { |
| | | // http(s):// è·¯å¾æ°çªå£æå¼ |
| | | window.open(key, "_blank"); |
| | | } else if (!route || !route.children) { |
| | | // 没æåè·¯ç±è·¯å¾å
é¨æå¼ |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | // æ£æ¥æ¯å¦æåè·¯ç± |
| | | if (route && route.children && route.children.length > 0) { |
| | | // æåè·¯ç±ï¼æ¾ç¤ºä¾§è¾¹æ |
| | | activeRoutes(key); |
| | | |
| | | // æç
§æ£ç¡®çè·¯å¾æå»ºå±çº§ï¼è¿éæ¯ç¹æ®å¤ç |
| | | let targetPath = key; // ä»å½åç¹å»çèåè·¯å¾å¼å§ |
| | | let targetQuery = null; |
| | | let currentNode = route; |
| | | let pathSegments = []; |
| | | |
| | | // å½åè·¯å¾æ¯ç¬¬ä¸æ®µ |
| | | pathSegments.push(currentNode.path); |
| | | |
| | | // é屿·»å åè·¯å¾ |
| | | while (currentNode.children && currentNode.children.length > 0) { |
| | | const firstChild = currentNode.children.find(child => !child.hidden); |
| | | if (!firstChild) break; |
| | | |
| | | // è·³è¿ParentViewç±»åçä¸é´èç¹ï¼ç´æ¥ä½¿ç¨å
¶åèç¹çpath |
| | | if (firstChild.component === 'ParentView' || firstChild.component.name === 'ParentView') { |
| | | currentNode = firstChild; |
| | | pathSegments.push(firstChild.path); |
| | | continue; |
| | | } |
| | | |
| | | // æ®éèç¹å¤ç |
| | | currentNode = firstChild; |
| | | // å¦æè·¯å¾ä¸æ¯ä»¥/å¼å¤´ï¼åæ·»å å°è·¯å¾çæ®µä¸ |
| | | if (!firstChild.path.startsWith('/')) { |
| | | pathSegments.push(firstChild.path); |
| | | } else { |
| | | // 妿æ¯ç»å¯¹è·¯å¾ï¼åæ¿æ¢ä¹åææè·¯å¾ |
| | | pathSegments = [firstChild.path]; |
| | | } |
| | | |
| | | targetQuery = firstChild.query; |
| | | |
| | | // 妿å°è¾¾å¶åèç¹ï¼æ²¡æåèç¹ï¼ï¼åç»ææ¥æ¾ |
| | | if (!firstChild.children || firstChild.children.length === 0) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // æå»ºæç»è·¯å¾ |
| | | if (pathSegments.length > 0) { |
| | | // å¦æç¬¬ä¸æ®µä¸æ¯ä»¥/å¼å¤´ï¼æ·»å / |
| | | if (!pathSegments[0].startsWith('/')) { |
| | | pathSegments[0] = '/' + pathSegments[0]; |
| | | } |
| | | |
| | | // ç»åè·¯å¾ - ææ°ç»ä¸ææè·¯å¾æ¼æ¥èµ·æ¥ï¼å¦æææ®µå
å«å®æ´è·¯å¾ï¼ä»¥/å¼å¤´ï¼åä»è¯¥æ®µéæ°å¼å§ |
| | | targetPath = pathSegments.reduce((fullPath, segment, index) => { |
| | | if (segment.startsWith('/')) { |
| | | return segment; |
| | | } else if (index === 0) { |
| | | return segment; |
| | | } else { |
| | | return `${fullPath}/${segment}`; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 导èªå°ç®æ è·¯ç± |
| | | if (targetQuery) { |
| | | router.push({ path: targetPath, query: targetQuery }); |
| | | } else { |
| | | router.push({ path: targetPath }); |
| | | } |
| | | } else { |
| | | // 没æåè·¯ç±ï¼éèä¾§è¾¹æ |
| | | const routeMenu = childrenMenus.value.find(item => item.path === key); |
| | | if (routeMenu && routeMenu.query) { |
| | | let query = JSON.parse(routeMenu.query); |
| | | router.push({ path: key, query: query }); |
| | | // query å·²ç»å¨ permission.js ä¸è¢«å¤çä¸ºå¯¹è±¡ï¼æ é忬¡è§£æ |
| | | router.push({ path: key, query: routeMenu.query }); |
| | | } else { |
| | | router.push({ path: key }); |
| | | } |
| | | appStore.toggleSideBarHide(true); |
| | | } else { |
| | | // æ¾ç¤ºå·¦ä¾§èå¨èå |
| | | activeRoutes(key); |
| | | appStore.toggleSideBarHide(false); |
| | | } |
| | | } |
| | | |
| | | function activeRoutes(key) { |
| | | let routes = []; |
| | | |
| | | |
| | | // æ¥æ¾å¹é
çè·¯ç± |
| | | if (childrenMenus.value && childrenMenus.value.length > 0) { |
| | | childrenMenus.value.map((item) => { |
| | | if (key == item.parentPath || (key == "index" && "" == item.path)) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if(routes.length > 0) { |
| | | // æåè·¯ç±ï¼åæ¾ç¤ºä¾§è¾¹æ |
| | | permissionStore.setSidebarRouters(routes); |
| | | appStore.toggleSideBarHide(false); |
| | | } else { |
| | | // 没æåè·¯ç±ï¼éèä¾§è¾¹æ |
| | | appStore.toggleSideBarHide(true); |
| | | } |
| | | return routes; |
| | | } |
| | | |
| | | onMounted(() => { |
| | | window.addEventListener('resize', setVisibleNumber) |
| | | }) |
| | | onBeforeUnmount(() => { |
| | | window.removeEventListener('resize', setVisibleNumber) |
| | | // æ ¹æ®å½åè·¯ç±å³å®æ¯å¦æ¾ç¤ºä¾§è¾¹æ ï¼è䏿¯ç´æ¥éè |
| | | const currentPath = route.path; |
| | | if (currentPath === '/index' || currentPath === '/') { |
| | | // 妿å½åæ¯é¦é¡µï¼èªå¨è·³è½¬å°ç¬¬ä¸ä¸ªå¨æè·¯ç± |
| | | if (topMenus.value.length > 0) { |
| | | const firstRoute = topMenus.value[0]; |
| | | handleSelect(firstRoute.path); |
| | | } |
| | | } else { |
| | | // æ£æ¥å½åè·¯ç±æ¯å¦éè¦æ¾ç¤ºä¾§è¾¹æ |
| | | const routeConfig = routers.value.find(item => currentPath.startsWith(item.path) && item.path !== '/'); |
| | | if (routeConfig && routeConfig.children && routeConfig.children.length > 0) { |
| | | // æåèåï¼æ¾ç¤ºä¾§è¾¹æ |
| | | activeRoutes(routeConfig.path); |
| | | appStore.toggleSideBarHide(false); |
| | | } else { |
| | | // æ åèåï¼å¯ä»¥éèä¾§è¾¹æ |
| | | appStore.toggleSideBarHide(true); |
| | | } |
| | | } |
| | | |
| | | // ç嬿»å¨ç¶æ |
| | | if (menuContainer.value) { |
| | | menuContainer.value.addEventListener('scroll', updateScrollButtons); |
| | | nextTick(() => { |
| | | updateScrollButtons(); |
| | | }); |
| | | } |
| | | |
| | | window.addEventListener('resize', () => { |
| | | updateScrollButtons(); |
| | | }); |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | setVisibleNumber() |
| | | onBeforeUnmount(() => { |
| | | if (menuContainer.value) { |
| | | menuContainer.value.removeEventListener('scroll', updateScrollButtons); |
| | | } |
| | | window.removeEventListener('resize', updateScrollButtons); |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .topmenu-container.el-menu--horizontal > .el-menu-item { |
| | | float: left; |
| | | height: 50px !important; |
| | | line-height: 50px !important; |
| | | color: #999093 !important; |
| | | padding: 0 5px !important; |
| | | margin: 0 10px !important; |
| | | .top-nav-container { |
| | | display: flex; |
| | | align-items: center; |
| | | flex: 1; |
| | | position: relative; |
| | | height: 60px; |
| | | overflow: hidden; |
| | | padding: 0 40px; /* Increase padding for arrows */ |
| | | |
| | | .scroll-arrow { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 28px; |
| | | height: 28px; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | border-radius: 50%; |
| | | cursor: pointer; |
| | | color: #ffffff; |
| | | z-index: 20; |
| | | opacity: 0; |
| | | transition: opacity 0.3s; |
| | | position: absolute; |
| | | box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); |
| | | |
| | | &:hover { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | } |
| | | |
| | | &.left-arrow { |
| | | left: 8px; |
| | | } |
| | | |
| | | &.right-arrow { |
| | | right: 8px; |
| | | } |
| | | } |
| | | |
| | | &:hover { |
| | | .scroll-arrow { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | .menu-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow-x: auto; |
| | | overflow-y: hidden; |
| | | scrollbar-width: none; /* Firefox */ |
| | | -ms-overflow-style: none; /* IE and Edge */ |
| | | |
| | | &::-webkit-scrollbar { |
| | | display: none; /* Chrome, Safari, Opera */ |
| | | } |
| | | } |
| | | } |
| | | |
| | | .topmenu-container.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-sub-menu.is-active .el-submenu__title { |
| | | border-bottom: 2px solid #{'var(--theme)'} !important; |
| | | color: #303133; |
| | | .top-menu { |
| | | height: 60px; |
| | | border-bottom: none !important; |
| | | white-space: nowrap; |
| | | background: transparent !important; |
| | | |
| | | &.theme-dark { |
| | | background: #002866 !important; |
| | | } |
| | | } |
| | | |
| | | /* sub-menu item */ |
| | | .topmenu-container.el-menu--horizontal > .el-sub-menu .el-sub-menu__title { |
| | | float: left; |
| | | height: 50px !important; |
| | | line-height: 50px !important; |
| | | color: #999093 !important; |
| | | padding: 0 5px !important; |
| | | margin: 0 10px !important; |
| | | } |
| | | |
| | | /* èæ¯è²éè */ |
| | | .topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, .topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover, .topmenu-container.el-menu--horizontal>.el-submenu .el-submenu__title:hover { |
| | | background-color: #ffffff !important; |
| | | .el-menu--horizontal { |
| | | border-bottom: none !important; |
| | | |
| | | > .el-menu-item { |
| | | display: inline-block; |
| | | float: none; |
| | | height: 60px !important; |
| | | line-height: 60px !important; |
| | | color: #ffffff !important; |
| | | padding: 0 20px !important; |
| | | margin: 0 !important; |
| | | border-bottom: none !important; |
| | | position: relative; |
| | | font-size: 16px; |
| | | |
| | | &.is-active { |
| | | background-color: transparent !important; |
| | | color: #ffffff !important; |
| | | font-weight: bold; |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | bottom: 10px; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | width: calc(100% - 40px); |
| | | height: 2px; |
| | | background-color: #ffffff; |
| | | } |
| | | } |
| | | |
| | | &:hover { |
| | | background-color: rgba(255, 255, 255, 0.1) !important; |
| | | color: #ffffff !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* 徿 å³é´è· */ |
| | | .topmenu-container .svg-icon { |
| | | margin-right: 4px; |
| | | .svg-icon { |
| | | margin-right: 8px; |
| | | color: #ffffff; |
| | | } |
| | | |
| | | /* topmenu more arrow */ |
| | | .topmenu-container .el-sub-menu .el-sub-menu__icon-arrow { |
| | | position: static; |
| | | vertical-align: middle; |
| | | margin-left: 8px; |
| | | margin-top: 0px; |
| | | /* é¦é¡µæé®æ ·å¼ */ |
| | | .el-menu-item:first-child { |
| | | margin-left: 0 !important; |
| | | font-weight: bold; |
| | | |
| | | .svg-icon { |
| | | font-size: 18px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | position: relative; |
| | | overflow: hidden; |
| | | background: #110f2e; |
| | | padding: 14px 0 0 14px; |
| | | padding: 14px; |
| | | box-sizing: border-box; |
| | | padding-top: 8px; |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | |
| | | .hasTagsView { |
| | | .app-main { |
| | | /* 84 = navbar + tags-view + padding = 70 + 56 + 14 */ |
| | | min-height: calc(100vh - 125px); |
| | | // padding: 20px; |
| | | min-height: calc(100vh - 110px); |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | | padding-top: 130px; |
| | | padding-top: 108px; /* 60px(navbar) + 34px(tagsview) + 14px(å
è¾¹è·) */ |
| | | } |
| | | } |
| | | } |
| | |
| | | position: relative; |
| | | overflow: hidden; |
| | | background: #f7f8fa; |
| | | padding: 14px 0 0 14px; |
| | | padding: 14px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | |
| | | .hasTagsView { |
| | | .app-main { |
| | | /* 84 = navbar + tags-view + padding = 70 + 56 + 14 */ |
| | | min-height: calc(100vh - 125px); |
| | | // padding: 20px; |
| | | min-height: calc(100vh - 110px); |
| | | } |
| | | |
| | | .fixed-header + .app-main { |
| | | padding-top: 130px; |
| | | padding-top: 108px; /* 60px(navbar) + 34px(tagsview) + 14px(å
è¾¹è·) */ |
| | | } |
| | | } |
| | | } |
| | | |
| | | /* ç¨æ·ä¸ªäººèµæé¡µç¹æ®é«åº¦å¤ç */ |
| | | .user-profile-container { |
| | | min-height: calc(100vh - 50px) !important; |
| | | } |
| | | </style> |
| | | |
| | | <style lang="scss"> |
| | |
| | | </div> |
| | | |
| | | <div class="right-menu"> |
| | | <!-- <template v-if="appStore.device !== 'mobile'"> |
| | | <header-search id="header-search" class="right-menu-item" /> |
| | | |
| | | <screenfull id="screenfull" class="right-menu-item hover-effect" /> |
| | | |
| | | <el-tooltip content="å¸å±å¤§å°" effect="dark" placement="bottom"> |
| | | <size-select id="size-select" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | | </template> --> |
| | | <!-- <el-button @click="toggleTheme">忢</el-button> --> |
| | | <div class="avatar-container"> |
| | | <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click"> |
| | | <div class="avatar-wrapper"> |
| | | <img :src="userStore.avatar" class="user-avatar" /> |
| | | <el-icon><caret-bottom /></el-icon> |
| | | <!-- æ¥è¦æé® --> |
| | | <div class="right-menu-item hover-effect nav-btn-item"> |
| | | <el-tooltip content="æ¥è¦" effect="dark" placement="bottom"> |
| | | <div class="nav-btn" @click="handleAlarm"> |
| | | <img src="@/assets/images/alarm.png" alt="æ¥è¦" /> |
| | | <span>æ¥è¦</span> |
| | | </div> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <router-link to="/user/profile"> |
| | | <el-dropdown-item>个人ä¸å¿</el-dropdown-item> |
| | | </router-link> |
| | | <el-dropdown-item command="toggleTheme"> |
| | | <span>飿 ¼åæ¢</span> |
| | | </el-dropdown-item> |
| | | <!-- |
| | | <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings"> |
| | | <span>å¸å±è®¾ç½®</span> |
| | | </el-dropdown-item> --> |
| | | <el-dropdown-item divided command="logout"> |
| | | <span>éåºç»å½</span> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | <!-- 大模åæé® --> |
| | | <div class="right-menu-item hover-effect nav-btn-item"> |
| | | <el-tooltip content="大模å" effect="dark" placement="bottom"> |
| | | <div class="nav-btn" @click="handleRobot"> |
| | | <img src="@/assets/images/robot.png" alt="大模å" /> |
| | | <span>大模å</span> |
| | | </div> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ElMessageBox } from "element-plus" |
| | | import Breadcrumb from "@/components/Breadcrumb" |
| | | import TopNav from "@/components/TopNav" |
| | | import Hamburger from "@/components/Hamburger" |
| | | import Screenfull from "@/components/Screenfull" |
| | | import SizeSelect from "@/components/SizeSelect" |
| | | import HeaderSearch from "@/components/HeaderSearch" |
| | | import useAppStore from "@/store/modules/app" |
| | | import useUserStore from "@/store/modules/user" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | import { useRouter } from "vue-router" |
| | | |
| | | const appStore = useAppStore() |
| | | const userStore = useUserStore() |
| | | const settingsStore = useSettingsStore() |
| | | |
| | | function toggleTheme() { |
| | | if (settingsStore.sideTheme == "theme-dark") { |
| | | settingsStore.sideTheme = "theme-light" |
| | | document.querySelector("body").className = "themeLight" |
| | | } else { |
| | | settingsStore.sideTheme = "theme-dark" |
| | | document.querySelector("body").className = "themeDark" |
| | | } |
| | | } |
| | | const router = useRouter() |
| | | |
| | | function toggleSideBar() { |
| | | appStore.toggleSideBar() |
| | | } |
| | | |
| | | function handleCommand(command) { |
| | | switch (command) { |
| | | case "toggleTheme": |
| | | toggleTheme() |
| | | break |
| | | case "setLayout": |
| | | setLayout() |
| | | break |
| | | case "logout": |
| | | logout() |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | function handleAlarm() { |
| | | // è·³è½¬å°æ¥è¦ç®¡çé¡µé¢ |
| | | router.push('/alarmmanage/measuremen?modelCode=BJGL') |
| | | } |
| | | |
| | | function logout() { |
| | | ElMessageBox.confirm("ç¡®å®æ³¨éå¹¶éåºç³»ç»åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | userStore.logOut().then(() => { |
| | | location.href = "/index" |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | |
| | | const emits = defineEmits(["setLayout"]) |
| | | function setLayout() { |
| | | emits("setLayout") |
| | | function handleRobot() { |
| | | // è·³è½¬å°æºè½å©æé¡µé¢ |
| | | window.open('https://deepseek.tan-zhonghe.com/chat', '_blank') |
| | | } |
| | | </script> |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | .avatar-container { |
| | | margin-right: 40px; |
| | | |
| | | .avatar-wrapper { |
| | | margin-top: 5px; |
| | | position: relative; |
| | | |
| | | .user-avatar { |
| | | cursor: pointer; |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 10px; |
| | | .nav-btn-item { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 20px; |
| | | height: 70px; |
| | | |
| | | .nav-btn { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | color: #fff; |
| | | background-color: rgba(255, 255, 255, 0.1); |
| | | border-radius: 4px; |
| | | padding: 8px 16px; |
| | | |
| | | &:hover { |
| | | background-color: rgba(255, 255, 255, 0.2); |
| | | } |
| | | |
| | | i { |
| | | cursor: pointer; |
| | | position: absolute; |
| | | right: -20px; |
| | | top: 25px; |
| | | font-size: 12px; |
| | | |
| | | img { |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-right: 6px; |
| | | } |
| | | |
| | | span { |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | .avatar-container { |
| | | margin-right: 40px; |
| | | |
| | | .avatar-wrapper { |
| | | margin-top: 5px; |
| | | position: relative; |
| | | |
| | | .user-avatar { |
| | | cursor: pointer; |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 10px; |
| | | .nav-btn-item { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 20px; |
| | | height: 70px; |
| | | |
| | | .nav-btn { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | color: #333; |
| | | background-color: rgba(0, 0, 0, 0.05); |
| | | border-radius: 4px; |
| | | padding: 8px 16px; |
| | | |
| | | &:hover { |
| | | background-color: rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | i { |
| | | cursor: pointer; |
| | | position: absolute; |
| | | right: -20px; |
| | | top: 25px; |
| | | font-size: 12px; |
| | | |
| | | img { |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-right: 6px; |
| | | } |
| | | |
| | | span { |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="setting-drawer-block-checbox"> |
| | | <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')"> |
| | | <img src="@/assets/images/dark.svg" alt="dark" /> |
| | | <div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> |
| | | <div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block"> |
| | | <i aria-label="徿 : check" class="anticon anticon-check"> |
| | | <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class> |
| | | <path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" /> |
| | | <svg |
| | | viewBox="64 64 896 896" |
| | | data-icon="check" |
| | | width="1em" |
| | | height="1em" |
| | | :fill="theme" |
| | | aria-hidden="true" |
| | | focusable="false" |
| | | class |
| | | > |
| | | <path |
| | | d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" |
| | | /> |
| | | </svg> |
| | | </i> |
| | | </div> |
| | | </div> |
| | | <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')"> |
| | | <img src="@/assets/images/light.svg" alt="light" /> |
| | | <div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> |
| | | <div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block"> |
| | | <i aria-label="徿 : check" class="anticon anticon-check"> |
| | | <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class> |
| | | <path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" /> |
| | | <svg |
| | | viewBox="64 64 896 896" |
| | | data-icon="check" |
| | | width="1em" |
| | | height="1em" |
| | | :fill="theme" |
| | | aria-hidden="true" |
| | | focusable="false" |
| | | class |
| | | > |
| | | <path |
| | | d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" |
| | | /> |
| | | </svg> |
| | | </i> |
| | | </div> |
| | |
| | | <div class="drawer-item"> |
| | | <span>主é¢é¢è²</span> |
| | | <span class="comp-style"> |
| | | <el-color-picker v-model="theme" :predefine="predefineColors" @change="themeChange"/> |
| | | <el-color-picker v-model="theme" :predefine="predefineColors" @change="themeChange" /> |
| | | </span> |
| | | </div> |
| | | <el-divider /> |
| | |
| | | <el-button type="primary" plain icon="DocumentAdd" @click="saveSetting">ä¿åé
ç½®</el-button> |
| | | <el-button plain icon="Refresh" @click="resetSetting">éç½®é
ç½®</el-button> |
| | | </el-drawer> |
| | | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import variables from '@/assets/styles/variables.module.scss' |
| | | import axios from 'axios' |
| | | import { ElLoading, ElMessage } from 'element-plus' |
| | | import { useDynamicTitle } from '@/utils/dynamicTitle' |
| | | import useAppStore from '@/store/modules/app' |
| | | import useSettingsStore from '@/store/modules/settings' |
| | | import usePermissionStore from '@/store/modules/permission' |
| | | import { handleThemeStyle } from '@/utils/theme' |
| | | import variables from "@/assets/styles/variables.module.scss" |
| | | import axios from "axios" |
| | | import { ElLoading, ElMessage } from "element-plus" |
| | | import { useDynamicTitle } from "@/utils/dynamicTitle" |
| | | import useAppStore from "@/store/modules/app" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | import usePermissionStore from "@/store/modules/permission" |
| | | import { handleThemeStyle } from "@/utils/theme" |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const { proxy } = getCurrentInstance() |
| | | const appStore = useAppStore() |
| | | const settingsStore = useSettingsStore() |
| | | const permissionStore = usePermissionStore() |
| | | const showSettings = ref(false); |
| | | const theme = ref(settingsStore.theme); |
| | | const sideTheme = ref(settingsStore.sideTheme); |
| | | const storeSettings = computed(() => settingsStore); |
| | | const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]); |
| | | const showSettings = ref(false) |
| | | const theme = ref(settingsStore.theme) |
| | | const sideTheme = ref(settingsStore.sideTheme) |
| | | const storeSettings = computed(() => settingsStore) |
| | | const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]) |
| | | |
| | | /** æ¯å¦éè¦topnav */ |
| | | function topNavChange(val) { |
| | | if (!val) { |
| | | appStore.toggleSideBarHide(false); |
| | | permissionStore.setSidebarRouters(permissionStore.defaultRoutes); |
| | | appStore.toggleSideBarHide(false) |
| | | permissionStore.setSidebarRouters(permissionStore.defaultRoutes) |
| | | } |
| | | } |
| | | |
| | | function themeChange(val) { |
| | | settingsStore.theme = val; |
| | | handleThemeStyle(val); |
| | | settingsStore.theme = val |
| | | handleThemeStyle(val) |
| | | } |
| | | function handleTheme(val) { |
| | | settingsStore.sideTheme = val; |
| | | sideTheme.value = val; |
| | | settingsStore.sideTheme = val |
| | | sideTheme.value = val |
| | | // Update body class to match the theme |
| | | document.querySelector("body").className = val === 'theme-dark' ? "themeDark" : "themeLight" |
| | | } |
| | | function saveSetting() { |
| | | proxy.$modal.loading("æ£å¨ä¿åå°æ¬å°ï¼è¯·ç¨å..."); |
| | | proxy.$modal.loading("æ£å¨ä¿åå°æ¬å°ï¼è¯·ç¨å...") |
| | | let layoutSetting = { |
| | | "topNav": storeSettings.value.topNav, |
| | | "tagsView": storeSettings.value.tagsView, |
| | | "fixedHeader": storeSettings.value.fixedHeader, |
| | | "sidebarLogo": storeSettings.value.sidebarLogo, |
| | | "dynamicTitle": storeSettings.value.dynamicTitle, |
| | | "sideTheme": storeSettings.value.sideTheme, |
| | | "theme": storeSettings.value.theme |
| | | }; |
| | | localStorage.setItem("layout-setting", JSON.stringify(layoutSetting)); |
| | | topNav: storeSettings.value.topNav, |
| | | tagsView: storeSettings.value.tagsView, |
| | | fixedHeader: storeSettings.value.fixedHeader, |
| | | sidebarLogo: storeSettings.value.sidebarLogo, |
| | | dynamicTitle: storeSettings.value.dynamicTitle, |
| | | sideTheme: storeSettings.value.sideTheme, |
| | | theme: storeSettings.value.theme, |
| | | } |
| | | localStorage.setItem("layout-setting", JSON.stringify(layoutSetting)) |
| | | setTimeout(proxy.$modal.closeLoading(), 1000) |
| | | } |
| | | function resetSetting() { |
| | | proxy.$modal.loading("æ£å¨æ¸
é¤è®¾ç½®ç¼åå¹¶å·æ°ï¼è¯·ç¨å..."); |
| | | proxy.$modal.loading("æ£å¨æ¸
é¤è®¾ç½®ç¼åå¹¶å·æ°ï¼è¯·ç¨å...") |
| | | localStorage.removeItem("layout-setting") |
| | | setTimeout("window.location.reload()", 1000) |
| | | } |
| | | function openSetting() { |
| | | showSettings.value = true; |
| | | showSettings.value = true |
| | | } |
| | | |
| | | defineExpose({ |
| | |
| | | }) |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | <style lang="scss" scoped> |
| | | .setting-drawer-title { |
| | | margin-bottom: 12px; |
| | | color: rgba(0, 0, 0, 0.85); |
| | |
| | | margin: -3px 8px 0px 0px; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | </app-link> |
| | | </template> |
| | | |
| | | <el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported> |
| | | <el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported @click="handleSubMenuClick"> |
| | | <template v-if="item.meta" #title> |
| | | <svg-icon :icon-class="item.meta && item.meta.icon" /> |
| | | <span class="menu-title" :title="hasTitle(item.meta.title)">{{ item.meta.title }}</span> |
| | |
| | | import { isExternal } from '@/utils/validate' |
| | | import AppLink from './Link' |
| | | import { getNormalPath } from '@/utils/ruoyi' |
| | | import { useRouter } from 'vue-router' |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const props = defineProps({ |
| | | // route object |
| | |
| | | |
| | | const onlyOneChild = ref({}); |
| | | |
| | | /** |
| | | * æ¥æ¾ææ·±å±çåèåï¼å¶åèç¹ï¼ |
| | | * é彿¥æ¾ç¬¬ä¸ä¸ªæ²¡æchildrençåèå |
| | | */ |
| | | function findDeepestLeafMenu(route) { |
| | | if (!route) return null; |
| | | |
| | | // å¦ææ²¡æåèåæåèå为空ï¼åè¿åå½åè·¯ç± |
| | | if (!route.children || route.children.length === 0) { |
| | | return route; |
| | | } |
| | | |
| | | // æ¾å°ç¬¬ä¸ä¸ªééèçåèå |
| | | const firstVisibleChild = route.children.find(child => !child.hidden); |
| | | if (!firstVisibleChild) { |
| | | return route; // 妿ææåèå齿¯éèçï¼è¿åå½åè·¯ç± |
| | | } |
| | | |
| | | // é彿¥æ¾è¿ä¸ªåèåçææ·±å±åèå |
| | | return findDeepestLeafMenu(firstVisibleChild); |
| | | } |
| | | |
| | | // å¤çåèåç¹å» |
| | | function handleSubMenuClick(e) { |
| | | // 黿¢äºä»¶å泡 |
| | | e.stopPropagation(); |
| | | |
| | | // 妿ç¹å»çæ¯åèåæ é¢ï¼åèªå¨å¯¼èªå°ææ·±å±çåèå |
| | | if (e.target.closest('.el-sub-menu__title')) { |
| | | // æç
§æ£ç¡®çè·¯å¾æå»ºå±çº§ |
| | | let currentNode = props.item; |
| | | |
| | | console.log('å½åç¹å»çèå项:', JSON.stringify(currentNode, null, 2)); |
| | | console.log('basePath:', props.basePath); |
| | | |
| | | // è·å第ä¸ä¸ªå¯è§åèåï¼å¦ææ²¡æå¯è§åèåï¼ä¸è¿è¡è·³è½¬ |
| | | if (!currentNode.children || currentNode.children.length === 0) { |
| | | return; |
| | | } |
| | | |
| | | const firstVisibleChild = currentNode.children.find(child => !child.hidden); |
| | | if (!firstVisibleChild) { |
| | | return; |
| | | } |
| | | |
| | | console.log('第ä¸ä¸ªå¯è§åèå:', JSON.stringify(firstVisibleChild, null, 2)); |
| | | |
| | | // æ¥å¿ç®¡ççä¸çº§èåç¹æ®å¤ç |
| | | // æ£æ¥æ¯å¦æé¢å
åå
¥ç宿´è·¯å¾ï¼å¦ææåç´æ¥ä½¿ç¨ |
| | | if (firstVisibleChild.fullPath) { |
| | | console.log('使ç¨é¢å
设置ç宿´è·¯å¾:', firstVisibleChild.fullPath); |
| | | router.push({ path: firstVisibleChild.fullPath }); |
| | | return; |
| | | } |
| | | |
| | | // 夿æ¯å¦æ¯ç³»ç»/æ¥å¿ç®¡çç±»åçä¸çº§èåï¼ä¾å¦ï¼/system/log/operlogï¼ |
| | | // è¿ç§æ
åµä¸ï¼ç´æ¥è·³è½¬å°ç¬¬ä¸ä¸ªåèåç宿´è·¯å¾ |
| | | if (firstVisibleChild.component === 'ParentView' || |
| | | (typeof firstVisibleChild.component === 'object' && |
| | | firstVisibleChild.component.name === 'ParentView')) { |
| | | console.log('æ£æµå°ParentViewç»ä»¶ï¼å¤çä¸çº§èå'); |
| | | |
| | | // æ¯æä¸çº§èåçæ
åµ |
| | | if (firstVisibleChild.children && firstVisibleChild.children.length > 0) { |
| | | const grandChild = firstVisibleChild.children.find(child => !child.hidden); |
| | | if (grandChild) { |
| | | console.log('æ¾å°ç¬¬ä¸çº§èå:', JSON.stringify(grandChild, null, 2)); |
| | | |
| | | // 夿æ¯å¦åºè¯¥ä½¿ç¨parentPath |
| | | if (firstVisibleChild.parentPath && grandChild.path.startsWith('/')) { |
| | | console.log('使ç¨parentPath屿§:', firstVisibleChild.parentPath); |
| | | // 妿åè忝ç»å¯¹è·¯å¾ï¼ä½æparentPathï¼ååºè¯¥ä½¿ç¨parentPathä½ä¸ºåºç¡ |
| | | let fullPath = firstVisibleChild.parentPath; |
| | | if (!fullPath.startsWith('/')) { |
| | | fullPath = '/' + fullPath; |
| | | } |
| | | |
| | | // 第äºçº§è·¯å¾åºäºæ ¹è·¯å¾ |
| | | if (firstVisibleChild.path.startsWith('/')) { |
| | | // 第äºçº§å·²ç»æ¯ç»å¯¹è·¯å¾ï¼æªåæåé¨å |
| | | const pathParts = firstVisibleChild.path.split('/'); |
| | | const lastPart = pathParts[pathParts.length - 1]; |
| | | fullPath = fullPath + '/' + lastPart; |
| | | } else { |
| | | fullPath = buildFullPath(fullPath, firstVisibleChild.path); |
| | | } |
| | | console.log('äºçº§è·¯å¾:', fullPath); |
| | | |
| | | // 第ä¸çº§è·¯å¾åºäºäºçº§è·¯å¾ |
| | | if (grandChild.path.startsWith('/')) { |
| | | // 第ä¸çº§æ¯ç»å¯¹è·¯å¾ï¼æªåæåé¨å |
| | | const pathParts = grandChild.path.split('/'); |
| | | const lastPart = pathParts[pathParts.length - 1]; |
| | | fullPath = fullPath + '/' + lastPart; |
| | | } else { |
| | | fullPath = buildFullPath(fullPath, grandChild.path); |
| | | } |
| | | console.log('ä¸çº§è·¯å¾ (æç»):', fullPath); |
| | | |
| | | // 导èªå°ç¬¬ä¸çº§èå |
| | | if (grandChild.query) { |
| | | router.push({ path: fullPath, query: grandChild.query }); |
| | | } else { |
| | | router.push({ path: fullPath }); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // 常è§è·¯å¾æå»º |
| | | let fullPath; |
| | | |
| | | // 第ä¸çº§è·¯å¾å¿
é¡»æ¯å®æ´çï¼ä¾å¦/systemï¼ |
| | | if (currentNode.path.startsWith('/')) { |
| | | fullPath = currentNode.path; |
| | | } else { |
| | | fullPath = '/' + currentNode.path; |
| | | } |
| | | console.log('ä¸çº§è·¯å¾:', fullPath); |
| | | |
| | | // 第äºçº§è·¯å¾å¿
é¡»åºäºç¬¬ä¸çº§è·¯å¾ï¼ä¾å¦/system/logï¼ |
| | | fullPath = buildFullPath(fullPath, firstVisibleChild.path); |
| | | console.log('äºçº§è·¯å¾:', fullPath); |
| | | |
| | | // 第ä¸çº§è·¯å¾å¿
é¡»åºäºäºçº§è·¯å¾ï¼ä¾å¦/system/log/operlogï¼ |
| | | fullPath = buildFullPath(fullPath, grandChild.path); |
| | | console.log('ä¸çº§è·¯å¾ (æç»):', fullPath); |
| | | |
| | | // 导èªå°ç¬¬ä¸çº§èå |
| | | if (grandChild.query) { |
| | | console.log('跳转å°:', fullPath, '另忰:', grandChild.query); |
| | | router.push({ path: fullPath, query: grandChild.query }); |
| | | } else { |
| | | console.log('跳转å°:', fullPath); |
| | | router.push({ path: fullPath }); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | console.log('å¤çæ åäºçº§èå'); |
| | | |
| | | // æ£æ¥æ¯å¦éè¦ä½¿ç¨parentPath |
| | | if (firstVisibleChild.parentPath && firstVisibleChild.path.startsWith('/')) { |
| | | console.log('使ç¨parentPath屿§:', firstVisibleChild.parentPath); |
| | | // 妿åè忝ç»å¯¹è·¯å¾ï¼ä½æparentPathï¼ååºè¯¥ä½¿ç¨parentPathä½ä¸ºåºç¡ |
| | | let fullPath = firstVisibleChild.parentPath; |
| | | if (!fullPath.startsWith('/')) { |
| | | fullPath = '/' + fullPath; |
| | | } |
| | | |
| | | // æå»ºå®æ´è·¯å¾ |
| | | if (firstVisibleChild.path.startsWith('/')) { |
| | | // æªååè·¯å¾çæåé¨å |
| | | const pathParts = firstVisibleChild.path.split('/'); |
| | | const lastPart = pathParts[pathParts.length - 1]; |
| | | fullPath = fullPath + '/' + lastPart; |
| | | } else { |
| | | fullPath = buildFullPath(fullPath, firstVisibleChild.path); |
| | | } |
| | | console.log('æå»ºçæç»è·¯å¾:', fullPath); |
| | | |
| | | // 导èªå°ç®æ è·¯ç± |
| | | if (firstVisibleChild.query) { |
| | | router.push({ path: fullPath, query: firstVisibleChild.query }); |
| | | } else { |
| | | router.push({ path: fullPath }); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // æ åçäºçº§èåå¤ç |
| | | // æå»ºæ£ç¡®çè·¯å¾ |
| | | let fullPath; |
| | | |
| | | // å¤ç第ä¸çº§è·¯å¾ï¼ä¾å¦/systemï¼- å¿
é¡»æ¯å®æ´çè·¯å¾ |
| | | if (currentNode.path.startsWith('/')) { |
| | | fullPath = currentNode.path; |
| | | } else { |
| | | fullPath = '/' + currentNode.path; |
| | | } |
| | | console.log('ä¸çº§è·¯å¾:', fullPath); |
| | | |
| | | // å¤ç第äºçº§è·¯å¾ï¼ä¾å¦/system/userï¼- å¿
é¡»åºäºç¬¬ä¸çº§è·¯å¾ |
| | | fullPath = buildFullPath(fullPath, firstVisibleChild.path); |
| | | console.log('äºçº§è·¯å¾ (æç»):', fullPath); |
| | | |
| | | // 导èªå°ç®æ è·¯ç± |
| | | if (firstVisibleChild.query) { |
| | | console.log('跳转å°:', fullPath, '另忰:', firstVisibleChild.query); |
| | | router.push({ path: fullPath, query: firstVisibleChild.query }); |
| | | } else { |
| | | console.log('跳转å°:', fullPath); |
| | | router.push({ path: fullPath }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | function hasOneShowingChild(children = [], parent) { |
| | | if (!children) { |
| | | children = []; |
| | |
| | | }) |
| | | |
| | | // When there is only one child router, the child router is displayed by default |
| | | if (showingChildren.length === 1) { |
| | | if (showingChildren.length === 1 && !showingChildren[0].children) { |
| | | return true |
| | | } |
| | | |
| | | // If the single child also has children, don't treat it as a single showing child |
| | | if (showingChildren.length === 1 && showingChildren[0].children && showingChildren[0].children.length > 0) { |
| | | return false |
| | | } |
| | | |
| | | // Show parent if there are no child router to display |
| | |
| | | return props.basePath |
| | | } |
| | | if (routeQuery) { |
| | | let query = JSON.parse(routeQuery); |
| | | let query = routeQuery; |
| | | // 妿 routeQuery æ¯å符串ï¼åå°è¯è§£æå® |
| | | if (typeof routeQuery === 'string') { |
| | | try { |
| | | query = JSON.parse(routeQuery); |
| | | } catch (error) { |
| | | console.error('Error parsing query string:', routeQuery, error); |
| | | } |
| | | } |
| | | return { path: getNormalPath(props.basePath + '/' + routePath), query: query } |
| | | } |
| | | return getNormalPath(props.basePath + '/' + routePath) |
| | | } |
| | | |
| | | // æ£ç¡®æå»ºè·¯å¾ |
| | | function buildFullPath(base, segment) { |
| | | // 妿segmentæ¯ç»å¯¹è·¯å¾ï¼ç´æ¥è¿å |
| | | if (segment.startsWith('/')) { |
| | | return segment; |
| | | } |
| | | |
| | | // ç¡®ä¿baseææ£ç¡®çå¼å¤´ææ |
| | | const normalizedBase = base.startsWith('/') ? base : '/' + base; |
| | | |
| | | // æ¼æ¥è·¯å¾ï¼é¿å
åææ |
| | | return normalizedBase.endsWith('/') ? normalizedBase + segment : normalizedBase + '/' + segment; |
| | | } |
| | | |
| | | function hasTitle(title){ |
| | | if (title.length > 5) { |
| | | return title; |
| | |
| | | <div |
| | | :class="{ 'has-logo': showLogo }" |
| | | :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }" |
| | | class="sidebar-container-wrapper" |
| | | > |
| | | <logo v-if="showLogo" :collapse="isCollapse" /> |
| | | <el-scrollbar :class="sideTheme" wrap-class="scrollbar-wrapper"> |
| | | <el-scrollbar :class="sideTheme" wrap-class="scrollbar-wrapper" view-class="scrollbar-view"> |
| | | <!-- å§ç»æ¾ç¤ºèå项ï¼ä¸åæ ¹æ®è·¯å¾å¤æ --> |
| | | <el-menu |
| | | :default-active="activeMenu" |
| | | :collapse="isCollapse" |
| | | :background-color="sideTheme === 'theme-dark' ? '#232D70' : '#fff'" |
| | | :background-color="'transparent'" |
| | | :text-color="sideTheme === 'theme-dark' ? '#fff' : '#000'" |
| | | :unique-opened="true" |
| | | :active-text-color="theme" |
| | | :collapse-transition="false" |
| | | mode="vertical" |
| | | class="custom-menu" |
| | | > |
| | | <sidebar-item |
| | | v-for="(route, index) in sidebarRouters" |
| | | :key="route.path + index" |
| | | :item="route" |
| | | :base-path="route.path" |
| | | /> |
| | | <!-- å½åæ¯é¦é¡µçæ¿åè·¯ç±æ¶ï¼æ¸²æä¸ç¨è·¯ç± --> |
| | | <template v-if="isIndexSubRoute"> |
| | | <sidebar-item |
| | | v-for="(route, index) in indexPageRouters" |
| | | :key="route.path + index" |
| | | :item="route" |
| | | :base-path="route.path" |
| | | /> |
| | | </template> |
| | | <template v-else> |
| | | <sidebar-item |
| | | v-for="(route, index) in sidebarRouters" |
| | | :key="route.path + index" |
| | | :item="route" |
| | | :base-path="route.path" |
| | | /> |
| | | </template> |
| | | </el-menu> |
| | | </el-scrollbar> |
| | | |
| | | <!-- åºé¨ç¨æ·åºå --> |
| | | <div class="sidebar-footer" :class="{ 'collapsed': isCollapse, 'theme-light': sideTheme === 'theme-light' }"> |
| | | <div class="user-avatar-container"> |
| | | <img :src="userStore.avatar" class="user-avatar" /> |
| | | </div> |
| | | |
| | | <!-- å±å¼ç¶æä¸æ¾ç¤ºå®æ´å
容 --> |
| | | <div class="user-info" v-if="!isCollapse"> |
| | | <div class="username">{{ userStore.name || 'admin' }}</div> |
| | | |
| | | <div class="action-buttons"> |
| | | <div class="action-button" :class="{'theme-light': sideTheme === 'theme-light'}" @click="toUserProfile"> |
| | | <el-icon><User /></el-icon> |
| | | <span>个人ä¸å¿</span> |
| | | </div> |
| | | |
| | | <div class="action-button" :class="{'theme-light': sideTheme === 'theme-light'}" @click="toggleTheme"> |
| | | <el-icon><Brush /></el-icon> |
| | | <span>忢䏻é¢</span> |
| | | </div> |
| | | |
| | | <div class="action-button" :class="{'theme-light': sideTheme === 'theme-light'}" @click="handleLogout"> |
| | | <el-icon><SwitchButton /></el-icon> |
| | | <span>éåºç»å½</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æå ç¶æä¸åªæ¾ç¤ºå¾æ æé® --> |
| | | <div class="collapsed-actions" v-if="isCollapse"> |
| | | <div class="action-icon" :class="{'theme-light': sideTheme === 'theme-light'}" @click="toUserProfile" title="个人ä¸å¿"> |
| | | <el-icon><User /></el-icon> |
| | | </div> |
| | | |
| | | <div class="action-icon" :class="{'theme-light': sideTheme === 'theme-light'}" @click="toggleTheme" title="忢䏻é¢"> |
| | | <el-icon><Brush /></el-icon> |
| | | </div> |
| | | |
| | | <div class="action-icon" :class="{'theme-light': sideTheme === 'theme-light'}" @click="handleLogout" title="éåºç»å½"> |
| | | <el-icon><SwitchButton /></el-icon> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import Logo from "./Logo" |
| | | import SidebarItem from "./SidebarItem" |
| | | import variables from "@/assets/styles/variables.module.scss" |
| | | import useAppStore from "@/store/modules/app" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | import usePermissionStore from "@/store/modules/permission" |
| | | import useUserStore from "@/store/modules/user" |
| | | import { User, Brush, SwitchButton } from '@element-plus/icons-vue' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import { useRouter } from 'vue-router' |
| | | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const appStore = useAppStore() |
| | | const settingsStore = useSettingsStore() |
| | | const permissionStore = usePermissionStore() |
| | | const userStore = useUserStore() |
| | | |
| | | const sidebarRouters = computed(() => permissionStore.sidebarRouters) |
| | | |
| | | // 夿å½åæ¯å¦ä¸ºé¦é¡µåè·¯ç±(/index/index) |
| | | const isIndexSubRoute = computed(() => { |
| | | return route.path === '/index/index' |
| | | }) |
| | | |
| | | // 夿å½åæ¯å¦ä¸ºä¸»é¦é¡µè·¯ç±(/indexæ/) |
| | | const isMainIndexRoute = computed(() => { |
| | | return route.path === '/index' || route.path === '/' |
| | | }) |
| | | |
| | | // é¦é¡µä¸ç¨è·¯ç±ï¼é¦é¡µçæ¿ç¸å
³èå |
| | | const indexPageRouters = computed(() => { |
| | | // æ¥æ¾name为Indexçè·¯ç± |
| | | const indexRoute = sidebarRouters.value.find(route => route.name === 'Index') |
| | | return indexRoute ? [indexRoute] : [] |
| | | }) |
| | | |
| | | const showLogo = computed(() => settingsStore.sidebarLogo) |
| | | const sideTheme = computed(() => settingsStore.sideTheme) |
| | | const theme = computed(() => settingsStore.theme) |
| | |
| | | } |
| | | return path |
| | | }) |
| | | |
| | | function toUserProfile() { |
| | | router.push('/user/profile') |
| | | } |
| | | |
| | | function toggleTheme() { |
| | | if (settingsStore.sideTheme == "theme-dark") { |
| | | settingsStore.sideTheme = "theme-light" |
| | | document.querySelector("body").className = "themeLight" |
| | | } else { |
| | | settingsStore.sideTheme = "theme-dark" |
| | | document.querySelector("body").className = "themeDark" |
| | | } |
| | | } |
| | | |
| | | function handleLogout() { |
| | | ElMessageBox.confirm("ç¡®å®æ³¨éå¹¶éåºç³»ç»åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | userStore.logOut().then(() => { |
| | | location.href = "/index" |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped></style> |
| | | <style lang="scss" scoped> |
| | | .sidebar-container-wrapper { |
| | | position: relative; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | :deep(.scrollbar-wrapper) { |
| | | height: calc(100% - 220px) !important; |
| | | overflow-x: hidden !important; |
| | | } |
| | | |
| | | :deep(.scrollbar-view) { |
| | | height: 100%; |
| | | padding-bottom: 20px; |
| | | } |
| | | |
| | | :deep(.el-scrollbar__bar.is-vertical) { |
| | | right: 0; |
| | | width: 6px; |
| | | } |
| | | |
| | | :deep(.el-scrollbar__thumb) { |
| | | background-color: rgba(144, 147, 153, 0.3); |
| | | &:hover { |
| | | background-color: rgba(144, 147, 153, 0.5); |
| | | } |
| | | } |
| | | |
| | | .custom-menu { |
| | | width: 100%; |
| | | padding: 6px 0; |
| | | height: auto !important; // æ¹ä¸ºèªéåºé«åº¦ï¼é¿å
åºå®é«åº¦å¯¼è´å
å®¹æº¢åº |
| | | transition: all 0.3s ease; |
| | | |
| | | // Override Element Plus default menu styles |
| | | .el-menu-item { |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | border-radius: 4px; |
| | | margin: 4px 10px; |
| | | width: calc(100% - 20px); |
| | | transition: all 0.2s ease; |
| | | |
| | | &.is-active { |
| | | background-color: #3883FA !important; |
| | | color: #fff !important; |
| | | font-weight: bold; |
| | | position: relative; |
| | | box-shadow: 0 2px 8px rgba(56, 131, 250, 0.5); |
| | | |
| | | // 左侧æç¤ºæ¡ |
| | | |
| | | } |
| | | |
| | | &:hover { |
| | | background-color: rgba(56, 131, 250, 0.1) !important; |
| | | } |
| | | } |
| | | |
| | | .el-sub-menu { |
| | | .el-sub-menu__title { |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | border-radius: 4px; |
| | | margin: 4px 10px; |
| | | width: calc(100% - 20px); |
| | | transition: all 0.2s ease; |
| | | |
| | | &:hover { |
| | | background-color: rgba(56, 131, 250, 0.1) !important; |
| | | } |
| | | } |
| | | |
| | | &.is-active { |
| | | > .el-sub-menu__title { |
| | | color: #3883FA !important; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .el-menu-item { |
| | | padding-left: 45px !important; |
| | | min-width: auto !important; |
| | | |
| | | &.is-active { |
| | | padding-left: 45px !important; |
| | | } |
| | | } |
| | | |
| | | // For nested submenus |
| | | .el-menu { |
| | | .el-menu-item, |
| | | .el-sub-menu__title { |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | } |
| | | |
| | | // Add styling for deeply nested submenus (level 3+) |
| | | .el-sub-menu { |
| | | .el-menu-item { |
| | | padding-left: 65px !important; |
| | | |
| | | &.is-active { |
| | | padding-left: 65px !important; |
| | | } |
| | | } |
| | | |
| | | // Level 4 |
| | | .el-menu { |
| | | .el-menu-item { |
| | | padding-left: 85px !important; |
| | | |
| | | &.is-active { |
| | | padding-left: 85px !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // é¦é¡µç©ºç½èååºåæ ·å¼ |
| | | .home-empty-menu { |
| | | height: auto; |
| | | min-height: 100px; |
| | | } |
| | | |
| | | // åºé¨ç¨æ·åºåæ ·å¼ |
| | | .sidebar-footer { |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | border-top: 1px solid rgba(255, 255, 255, 0.1); |
| | | padding: 16px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | |
| | | &.collapsed { |
| | | padding: 10px; |
| | | |
| | | .user-avatar-container { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | |
| | | &.theme-light { |
| | | background-color: rgba(255, 255, 255, 0.6); |
| | | border-top: 1px solid rgba(0, 0, 0, 0.1); |
| | | |
| | | .user-avatar-container { |
| | | border-color: rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .user-info { |
| | | .username { |
| | | color: #333; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .user-avatar-container { |
| | | margin-bottom: 10px; |
| | | border: 2px dashed rgba(255, 255, 255, 0.3); |
| | | border-radius: 4px; |
| | | width: 54px; |
| | | height: 54px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | |
| | | .user-avatar { |
| | | width: 38px; |
| | | height: 38px; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | |
| | | .user-info { |
| | | width: 100%; |
| | | text-align: center; |
| | | |
| | | .username { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | font-weight: 500; |
| | | margin-bottom: 16px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .action-buttons { |
| | | .action-button { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: rgba(56, 131, 250, 0.11); |
| | | border-radius: 9px; |
| | | border: 1px solid rgba(255, 255, 255, 0.3); |
| | | color: #fff; |
| | | padding: 10px; |
| | | margin-bottom: 10px; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | transition: background-color 0.3s; |
| | | |
| | | &:hover { |
| | | background: rgba(56, 131, 250, 0.2); |
| | | } |
| | | |
| | | .el-icon { |
| | | margin-right: 8px; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | span { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | &.theme-light { |
| | | background-color: rgba(56, 131, 250, 1); |
| | | color: #fff; |
| | | border: 1px solid rgba(56, 131, 250, 0.8); |
| | | |
| | | &:hover { |
| | | background-color: rgba(56, 131, 250, 0.9); |
| | | } |
| | | |
| | | .el-icon { |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .collapsed-actions { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | width: 100%; |
| | | |
| | | .action-icon { |
| | | width: 40px; |
| | | height: 40px; |
| | | margin-bottom: 8px; |
| | | background: rgba(56, 131, 250, 0.11); |
| | | border: 1px solid rgba(255, 255, 255, 0.3); |
| | | border-radius: 4px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | |
| | | &:hover { |
| | | background: rgba(56, 131, 250, 0.2); |
| | | } |
| | | |
| | | .el-icon { |
| | | font-size: 20px; |
| | | color: #fff; |
| | | } |
| | | |
| | | &.theme-light { |
| | | background: rgba(56, 131, 250, 1); |
| | | border: 1px solid rgba(56, 131, 250, 0.8); |
| | | |
| | | &:hover { |
| | | background: rgba(56, 131, 250, 0.9); |
| | | } |
| | | |
| | | .el-icon { |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .theme-light { |
| | | :deep(.custom-menu) { |
| | | // Override Element Plus menu styles for light theme |
| | | .el-menu-item { |
| | | &.is-active { |
| | | background-color: #3883FA !important; |
| | | color: #fff !important; |
| | | } |
| | | |
| | | &:hover { |
| | | background-color: rgba(56, 131, 250, 0.1) !important; |
| | | } |
| | | } |
| | | |
| | | .el-sub-menu { |
| | | .el-sub-menu__title { |
| | | &:hover { |
| | | background-color: rgba(56, 131, 250, 0.1) !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ·»å æ·±è²æ¨¡å¼ä¸ç¨æ ·å¼ |
| | | .theme-dark { |
| | | :deep(.custom-menu) { |
| | | // Override Element Plus menu styles for dark theme |
| | | .el-menu-item { |
| | | &.is-active { |
| | | background-color: #4e77f8 !important; |
| | | color: #ffffff !important; |
| | | font-weight: bold; |
| | | box-shadow: 0 2px 10px rgba(78, 119, 248, 0.6); |
| | | position: relative; |
| | | |
| | | // 左侧æç¤ºæ¡ |
| | | |
| | | } |
| | | |
| | | &:hover { |
| | | background-color: rgba(78, 119, 248, 0.2) !important; |
| | | } |
| | | } |
| | | |
| | | .el-sub-menu { |
| | | &.is-active { |
| | | > .el-sub-menu__title { |
| | | color: #4e77f8 !important; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .el-sub-menu__title { |
| | | &:hover { |
| | | background-color: rgba(78, 119, 248, 0.2) !important; |
| | | } |
| | | } |
| | | |
| | | // åµå¥åèåæ ·å¼ |
| | | .el-menu { |
| | | .el-menu-item { |
| | | &.is-active { |
| | | background-color: #4e77f8 !important; |
| | | color: #ffffff !important; |
| | | } |
| | | } |
| | | |
| | | .el-sub-menu { |
| | | &.is-active { |
| | | > .el-sub-menu__title { |
| | | color: #4e77f8 !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Add global style to override Element Plus defaults |
| | | :global(.el-menu--vertical .el-menu-item), |
| | | :global(.el-menu--vertical .el-sub-menu__title) { |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | } |
| | | |
| | | // Add styles for collapsed menu items |
| | | :deep(.custom-menu.el-menu--collapse) { |
| | | width: 54px !important; |
| | | |
| | | .el-menu-item, .el-sub-menu__title { |
| | | width: 36px !important; |
| | | min-width: 36px !important; |
| | | margin: 4px 9px !important; /* 9pxæ¯ä¸ºäºç¡®ä¿å±
ä¸ï¼(54px宽 - 36pxèå项) / 2 = 9px */ |
| | | padding: 0 !important; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 4px; |
| | | |
| | | &.is-active { |
| | | background-color: #3883FA !important; |
| | | color: #fff !important; |
| | | box-shadow: 0 2px 6px rgba(56, 131, 250, 0.4); |
| | | transform: scale(0.95); |
| | | transition: all 0.2s ease; |
| | | } |
| | | |
| | | .el-icon, .svg-icon { |
| | | margin: 0 !important; |
| | | font-size: 18px !important; |
| | | |
| | | svg { |
| | | width: 1.2em; |
| | | height: 1.2em; |
| | | } |
| | | } |
| | | |
| | | // ç¡®ä¿æå æ¶åèåçæ é¢ä¹å±
ä¸å¯¹é½ |
| | | .el-sub-menu__icon-arrow { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | // ç¡®ä¿æå æ¶å¼¹åºçåèåææ£ç¡®æ ·å¼ |
| | | .el-tooltip__trigger:focus:not(.focusing) { |
| | | outline: none; |
| | | } |
| | | } |
| | | |
| | | // æ·±è²æ¨¡å¼ä¸æå èåçæ ·å¼ |
| | | .theme-dark { |
| | | :deep(.custom-menu.el-menu--collapse) { |
| | | .el-menu-item, .el-sub-menu__title { |
| | | &.is-active { |
| | | background-color: #4e77f8 !important; |
| | | color: #ffffff !important; |
| | | box-shadow: 0 2px 8px rgba(78, 119, 248, 0.6); |
| | | } |
| | | |
| | | &:hover { |
| | | background-color: rgba(78, 119, 248, 0.2) !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | bottom: 0px; |
| | | } |
| | | :deep(.el-scrollbar__wrap) { |
| | | height: 39px; |
| | | height: 34px !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div id="tags-view-container" class="tags-view-container"> |
| | | <div id="tags-view-container" class="tags-view-container" :class="{'theme-dark': sideTheme === 'theme-dark', 'theme-light': sideTheme === 'theme-light'}"> |
| | | <scroll-pane ref="scrollPaneRef" class="tags-view-wrapper" @scroll="handleScroll"> |
| | | <router-link |
| | | v-for="tag in visitedViews" |
| | |
| | | const visitedViews = computed(() => useTagsViewStore().visitedViews) |
| | | const routes = computed(() => usePermissionStore().routes) |
| | | const theme = computed(() => useSettingsStore().theme) |
| | | const sideTheme = computed(() => useSettingsStore().sideTheme) |
| | | |
| | | watch(route, () => { |
| | | addTags() |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .themeDark { |
| | | .tags-view-container { |
| | | height: 52px; |
| | | width: 100%; |
| | | background: #1a235d; |
| | | // border-bottom: 1px solid #d8dce5; |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | | position: relative; |
| | | cursor: pointer; |
| | | height: 32px; |
| | | line-height: 30px; |
| | | border: 1px solid #5278f5; |
| | | color: #fff; |
| | | // background: #3271eb; |
| | | padding: 0 12px; |
| | | font-size: 14px; |
| | | margin-left: 6px; |
| | | margin-top: 10px; |
| | | border-radius: 4px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | &:first-of-type { |
| | | margin-left: 16px; |
| | | } |
| | | &:last-of-type { |
| | | margin-right: 15px; |
| | | } |
| | | &.active { |
| | | background-color: #4e77f8 !important; |
| | | color: #fff; |
| | | border-color: #4e77f8 !important; |
| | | &::before { |
| | | content: ""; |
| | | background: #fff; |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | position: relative; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | .tags-view-container { |
| | | height: 34px; |
| | | width: calc(100% - 42px); |
| | | margin-top: 10px; |
| | | margin-left: 14px; |
| | | box-sizing: border-box; |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); |
| | | |
| | | &.theme-dark { |
| | | background: #0A3465; |
| | | .tags-view-item { |
| | | color: #fff; |
| | | border: 1px solid #0c4685; |
| | | background: rgba(10, 52, 101, .48); |
| | | border-radius: 5px; |
| | | |
| | | &.active { |
| | | background-color: var(--el-color-primary) !important; |
| | | color: #fff !important; |
| | | } |
| | | } |
| | | .contextmenu { |
| | | margin: 0; |
| | | } |
| | | |
| | | &.theme-light { |
| | | background: #fff; |
| | | .tags-view-item { |
| | | color: #495060; |
| | | background: #fff; |
| | | z-index: 3000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | border: 1px solid #d8dce5; |
| | | |
| | | &.active { |
| | | background-color: var(--el-color-primary) !important; |
| | | color: #fff !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | | position: relative; |
| | | cursor: pointer; |
| | | height: 26px; |
| | | line-height: 26px; |
| | | border-radius: 3px; |
| | | padding: 0 10px; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3); |
| | | li { |
| | | margin: 0; |
| | | padding: 7px 16px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | margin-left: 5px; |
| | | margin-top: 4px; |
| | | &:first-of-type { |
| | | margin-left: 5px; |
| | | } |
| | | &:last-of-type { |
| | | margin-right: 5px; |
| | | } |
| | | &.active { |
| | | background-color: #42b983; |
| | | color: #fff; |
| | | border-color: #42b983; |
| | | &::before { |
| | | content: ""; |
| | | background: #fff; |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | position: relative; |
| | | margin-right: 2px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .themeLight { |
| | | .tags-view-container { |
| | | height: 52px; |
| | | width: 100%; |
| | | .contextmenu { |
| | | margin: 0; |
| | | background: #fff; |
| | | // border-bottom: 1px solid #d8dce5; |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | | position: relative; |
| | | cursor: pointer; |
| | | height: 32px; |
| | | line-height: 30px; |
| | | border: 1px solid #d8dce5; |
| | | color: #495060; |
| | | background: #fff; |
| | | padding: 0 12px; |
| | | font-size: 14px; |
| | | margin-left: 6px; |
| | | margin-top: 10px; |
| | | border-radius: 4px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | &:first-of-type { |
| | | margin-left: 16px; |
| | | } |
| | | &:last-of-type { |
| | | margin-right: 15px; |
| | | } |
| | | &.active { |
| | | background-color: #42b983; |
| | | color: #fff; |
| | | border-color: #42b983; |
| | | &::before { |
| | | content: ""; |
| | | background: #fff; |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | position: relative; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .contextmenu { |
| | | z-index: 3000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3); |
| | | li { |
| | | margin: 0; |
| | | background: #fff; |
| | | z-index: 3000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3); |
| | | li { |
| | | margin: 0; |
| | | padding: 7px 16px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | } |
| | | padding: 7px 16px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | .scroll-container .el-scrollbar__wrap { |
| | | height: 50px !important; |
| | | height: 34px !important; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }"> |
| | | <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> |
| | | <sidebar v-if="!sidebar.hide" class="sidebar-container" /> |
| | | <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container"> |
| | | <div :class="{ 'fixed-header': fixedHeader }"> |
| | | <navbar @setLayout="setLayout" v-if="!sidebar.hide"/> |
| | | <tags-view v-if="needTagsView" v-show="!sidebar.hide"/> |
| | | <div class="navbar-container"> |
| | | <div class="navbar"> |
| | | <div class="left"> |
| | | <div class="sidebar-logo-container" :class="{ collapse: !sidebar.opened }"> |
| | | <div class="logo" v-if="systemInfo && systemInfo.leftLogo"> |
| | | <img v-if="sideTheme === 'theme-dark'" :src="systemInfo.leftLogo" class="sidebar-logo" /> |
| | | <img v-else :src="systemInfo.leftLogo" class="sidebar-logo" /> |
| | | </div> |
| | | <div class="name" v-if="sidebar.opened" :style="{ color: sideTheme === 'theme-dark' ? '#fff' : '#333' }"> |
| | | {{ title }} |
| | | </div> |
| | | </div> |
| | | <hamburger |
| | | id="hamburger-container" |
| | | :is-active="appStore.sidebar.opened" |
| | | class="hamburger-container" |
| | | @toggleClick="toggleSideBar" |
| | | /> |
| | | </div> |
| | | <top-nav /> |
| | | <div class="right"> |
| | | <!-- æ¥è¦å大模åæé® --> |
| | | <div class="right-menu"> |
| | | <!-- æ¥è¦æé® --> |
| | | <div class="right-menu-item alarm-btn" @click="goToAlarm"> |
| | | <el-badge :value="alarmCount" :max="99" class="alarm-badge"> |
| | | <svg-icon icon-class="bell" class="right-menu-icon" /> |
| | | </el-badge> |
| | | <span class="right-menu-text">æ¥è¦</span> |
| | | </div> |
| | | |
| | | <!-- 大模åæé® --> |
| | | <div class="right-menu-item ai-btn" @click="openAIModel"> |
| | | <svg-icon icon-class="ai" class="right-menu-icon" /> |
| | | <span class="right-menu-text">æºè½å©æ</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <app-main /> |
| | | <settings ref="settingRef" /> |
| | | </div> |
| | | <div class="content-container"> |
| | | <sidebar v-if="!sidebar.hide" class="sidebar-container" /> |
| | | <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container"> |
| | | <div :class="{ 'fixed-header': fixedHeader }"> |
| | | <tags-view v-if="needTagsView" v-show="!sidebar.hide"/> |
| | | </div> |
| | | <app-main /> |
| | | <settings ref="settingRef" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watchEffect, onMounted } from 'vue' |
| | | import { useWindowSize } from '@vueuse/core' |
| | | import { useRoute, useRouter } from 'vue-router' |
| | | import Sidebar from './components/Sidebar/index.vue' |
| | | import { AppMain, Navbar, Settings, TagsView } from './components' |
| | | import { AppMain, Settings, TagsView } from './components' |
| | | import TopNav from '@/components/TopNav' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import defaultSettings from '@/settings' |
| | | import Cookies from "js-cookie" |
| | | |
| | | import useAppStore from '@/store/modules/app' |
| | | import useSettingsStore from '@/store/modules/settings' |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | | const appStore = useAppStore() |
| | | const settingsStore = useSettingsStore() |
| | | const theme = computed(() => settingsStore.theme); |
| | | const sideTheme = computed(() => settingsStore.sideTheme); |
| | | const sidebar = computed(() => useAppStore().sidebar); |
| | | const device = computed(() => useAppStore().device); |
| | | const sidebar = computed(() => appStore.sidebar); |
| | | const device = computed(() => appStore.device); |
| | | const needTagsView = computed(() => settingsStore.tagsView); |
| | | const fixedHeader = computed(() => settingsStore.fixedHeader); |
| | | const systemInfo = JSON.parse(Cookies.get("SystemInfo") || '{"systemName":"æºæ±è½æºç®¡çç³»ç»","leftLogo":""}') |
| | | const title = systemInfo.systemName || import.meta.env.VITE_APP_TITLE |
| | | |
| | | // æ¥è¦æ°éï¼å¯ä»¥ä»æ¥å£è·å |
| | | const alarmCount = ref(5) |
| | | |
| | | // è·³è½¬å°æ¥è¦é¡µé¢ |
| | | function goToAlarm() { |
| | | router.push('/alarmmanage/measuremen?modelCode=BJGL') |
| | | } |
| | | |
| | | // æå¼AI大模åå¯¹è¯æ¡ |
| | | function openAIModel() { |
| | | // è·³è½¬å°æå®çURL |
| | | window.open('https://deepseek.tan-zhonghe.com/chat', '_blank') |
| | | } |
| | | |
| | | const classObj = computed(() => ({ |
| | | hideSidebar: !sidebar.value.opened, |
| | |
| | | })) |
| | | |
| | | const { width, height } = useWindowSize(); |
| | | const WIDTH = 992; // refer to Bootstrap's responsive design |
| | | const WIDTH = 992; |
| | | |
| | | watchEffect(() => { |
| | | if (device.value === 'mobile' && sidebar.value.opened) { |
| | | useAppStore().closeSideBar({ withoutAnimation: false }) |
| | | appStore.closeSideBar({ withoutAnimation: false }) |
| | | } |
| | | if (width.value - 1 < WIDTH) { |
| | | useAppStore().toggleDevice('mobile') |
| | | useAppStore().closeSideBar({ withoutAnimation: true }) |
| | | appStore.toggleDevice('mobile') |
| | | appStore.closeSideBar({ withoutAnimation: true }) |
| | | } else { |
| | | useAppStore().toggleDevice('desktop') |
| | | appStore.toggleDevice('desktop') |
| | | } |
| | | }) |
| | | |
| | | // çå¬è·¯ç±ååï¼å¤çé¦é¡µçä¾§è¾¹æ æ¾ç¤º |
| | | watchEffect(() => { |
| | | // æ£æ¥æ¯å¦æ¯é¦é¡µè·¯ç±ï¼ä½æé¤/index/indexåè·¯ç± |
| | | if ((route.path === '/index' || route.path === '/') && route.path !== '/index/index') { |
| | | // é¦é¡µè·¯ç±ï¼ç¡®ä¿ä¾§è¾¹æ ä¸éèï¼ä½ç¶ææ¯æå ç |
| | | appStore.toggleSideBarHide(false) // æ¹ä¸ºä¸éèä¾§è¾¹æ |
| | | } else if (route.meta && route.meta.showSidebar === false) { |
| | | // å¦æè·¯ç±æç¡®æå®éèä¾§è¾¹æ |
| | | appStore.toggleSideBarHide(true) |
| | | } else { |
| | | // å
¶ä»è·¯ç±ï¼ç¡®ä¿ä¾§è¾¹æ å¯è§ |
| | | appStore.toggleSideBarHide(false) |
| | | } |
| | | }) |
| | | |
| | | // ç»ä»¶æè½½æ¶ï¼ç¡®ä¿é¦é¡µä¾§è¾¹æ ç¶ææ£ç¡® |
| | | onMounted(() => { |
| | | // 妿å½åæ¯é¦é¡µå页é¢ï¼åªç¡®ä¿ä¾§è¾¹æ ä¸è¢«éèï¼ä½ä¿ææå /å±å¼ç¶æä¸å |
| | | if (route.path === '/index/index') { |
| | | // åªè®¾ç½®ä¸éèä¾§è¾¹æ ï¼ä½ä¸æ¹åå
¶å±å¼/æå ç¶æ |
| | | appStore.toggleSideBarHide(false) |
| | | // ä¸å强å¶è®¾ç½®opened为trueï¼ä¿æç¨æ·ä¹åç设置 |
| | | } |
| | | }) |
| | | |
| | | function handleClickOutside() { |
| | | useAppStore().closeSideBar({ withoutAnimation: false }) |
| | | appStore.closeSideBar({ withoutAnimation: false }) |
| | | } |
| | | |
| | | function toggleSideBar() { |
| | | appStore.toggleSideBar() |
| | | } |
| | | |
| | | const settingRef = ref(null); |
| | |
| | | .app-wrapper { |
| | | @include clearfix; |
| | | position: relative; |
| | | height: 100%; |
| | | width: 100%; |
| | | height: 100vh; |
| | | width: 100vw; |
| | | display: flex; |
| | | flex-direction: column; |
| | | overflow-x: hidden; |
| | | |
| | | &.mobile.openSidebar { |
| | | position: fixed; |
| | |
| | | z-index: 999; |
| | | } |
| | | |
| | | .fixed-header { |
| | | .navbar-container { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | height: 60px; |
| | | z-index: 1000; |
| | | width: 100%; |
| | | } |
| | | |
| | | .navbar { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | background-color: var(--current-color); |
| | | height: 60px; |
| | | width: 100%; |
| | | padding: 0; |
| | | |
| | | .left { |
| | | display: flex; |
| | | align-items: center; |
| | | padding-left: 16px; |
| | | |
| | | .sidebar-logo-container { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 60px; |
| | | padding: 0 15px; |
| | | min-width: 220px; |
| | | |
| | | .logo { |
| | | width: 40px; |
| | | height: 40px; |
| | | margin-right: 10px; |
| | | flex-shrink: 0; |
| | | |
| | | .sidebar-logo { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | } |
| | | |
| | | .name { |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: bold; |
| | | font-size: 20px; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | &.collapse { |
| | | min-width: 70px; |
| | | |
| | | .name { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .right { |
| | | display: flex; |
| | | align-items: center; |
| | | padding-right: 20px; |
| | | |
| | | .right-menu { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .right-menu-item { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 20px; |
| | | cursor: pointer; |
| | | color: #fff; |
| | | font-size: 14px; |
| | | transition: all 0.3s; |
| | | |
| | | &:hover { |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | .right-menu-icon { |
| | | font-size: 18px; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .right-menu-text { |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | |
| | | .alarm-badge { |
| | | :deep(.el-badge__content) { |
| | | background-color: #f56c6c; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .content-container { |
| | | display: flex; |
| | | position: relative; |
| | | margin-top: 60px; |
| | | height: calc(100vh - 60px); |
| | | width: 100%; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .sidebar-container { |
| | | position: relative; |
| | | height: 100%; |
| | | z-index: 900; |
| | | flex-shrink: 0; |
| | | width: $base-sidebar-width; |
| | | |
| | | } |
| | | |
| | | .fixed-header { |
| | | position: fixed; |
| | | top: 60px; |
| | | right: 0; |
| | | z-index: 9; |
| | | width: calc(100% - #{$base-sidebar-width}); |
| | | transition: width 0.28s; |
| | | display: flex; |
| | | flex-direction: column; |
| | | box-sizing: border-box; |
| | | padding: 0; |
| | | } |
| | | |
| | | .hideSidebar .fixed-header { |
| | |
| | | .mobile .fixed-header { |
| | | width: 100%; |
| | | } |
| | | |
| | | .main-container { |
| | | flex: 1; |
| | | position: relative; |
| | | height: 100%; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | transition: margin-left 0.28s; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .hideSidebar .main-container { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .sidebarHide .main-container { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .mobile .main-container { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .hideSidebar .sidebar-container { |
| | | width: 54px; |
| | | } |
| | | |
| | | .sidebarHide .sidebar-container { |
| | | display: none; |
| | | } |
| | | |
| | | .themeDark { |
| | | .navbar { |
| | | background: #002866 !important; |
| | | } |
| | | |
| | | .sidebar-container { |
| | | background-color: #002866 !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import useUserStore from '@/store/modules/user' |
| | | import useSettingsStore from '@/store/modules/settings' |
| | | import usePermissionStore from '@/store/modules/permission' |
| | | import useTagsViewStore from '@/store/modules/tagsView' |
| | | |
| | | NProgress.configure({ showSpinner: false }); |
| | | |
| | | const whiteList = ['/login', '/register', '/energy','/social-callback'] |
| | | |
| | | /** |
| | | * æ¥æ¾ææ·±å±çåèåå¹¶æå»ºå®æ´è·¯å¾ |
| | | */ |
| | | function findDeepestPath(route) { |
| | | if (!route) return { path: null, query: null }; |
| | | |
| | | // é¦å
æ·»å å½åèç¹çè·¯å¾ |
| | | let currentNode = route; |
| | | let pathSegments = []; |
| | | |
| | | if (currentNode.path) { |
| | | pathSegments.push(currentNode.path); |
| | | } |
| | | |
| | | // é屿·»å åè·¯å¾ |
| | | while (currentNode.children && currentNode.children.length > 0) { |
| | | const firstChild = currentNode.children.find(child => !child.hidden); |
| | | if (!firstChild) break; |
| | | |
| | | // è·³è¿ParentViewç±»åçä¸é´èç¹ |
| | | if (firstChild.component === 'ParentView' || |
| | | (typeof firstChild.component === 'object' && |
| | | firstChild.component.name === 'ParentView')) { |
| | | currentNode = firstChild; |
| | | // å¦æè·¯å¾ä¸æ¯ä»¥/å¼å¤´ï¼åæ·»å å°è·¯å¾çæ®µä¸ |
| | | if (!firstChild.path.startsWith('/')) { |
| | | pathSegments.push(firstChild.path); |
| | | } else { |
| | | // 妿æ¯ç»å¯¹è·¯å¾ï¼åæ¿æ¢ä¹åææè·¯å¾ |
| | | pathSegments = [firstChild.path]; |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // æ®éèç¹å¤ç |
| | | currentNode = firstChild; |
| | | // å¦æè·¯å¾ä¸æ¯ä»¥/å¼å¤´ï¼åæ·»å å°è·¯å¾çæ®µä¸ |
| | | if (!firstChild.path.startsWith('/')) { |
| | | pathSegments.push(firstChild.path); |
| | | } else { |
| | | // 妿æ¯ç»å¯¹è·¯å¾ï¼åæ¿æ¢ä¹åææè·¯å¾ |
| | | pathSegments = [firstChild.path]; |
| | | } |
| | | |
| | | // 妿å°è¾¾å¶åèç¹ï¼åç»ææ¥æ¾ |
| | | if (!firstChild.children || firstChild.children.length === 0) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // æå»ºæç»è·¯å¾ |
| | | let targetPath = ''; |
| | | if (pathSegments.length > 0) { |
| | | // å¦æç¬¬ä¸æ®µä¸æ¯ä»¥/å¼å¤´ï¼æ·»å / |
| | | if (!pathSegments[0].startsWith('/')) { |
| | | pathSegments[0] = '/' + pathSegments[0]; |
| | | } |
| | | |
| | | // ç»åè·¯å¾ |
| | | targetPath = pathSegments.reduce((fullPath, segment, index) => { |
| | | if (segment.startsWith('/')) { |
| | | return segment; |
| | | } else if (index === 0) { |
| | | return segment; |
| | | } else { |
| | | // ç¡®ä¿è·¯å¾ä¹é´ä¸ä¼åºç°éå¤çææ |
| | | const base = fullPath.endsWith('/') ? fullPath.slice(0, -1) : fullPath; |
| | | const part = segment.startsWith('/') ? segment : '/' + segment; |
| | | return `${base}${part}`; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return { |
| | | path: targetPath, |
| | | query: currentNode.query |
| | | }; |
| | | } |
| | | |
| | | router.beforeEach((to, from, next) => { |
| | | NProgress.start() |
| | |
| | | router.addRoute(route) // å¨ææ·»å å¯è®¿é®è·¯ç±è¡¨ |
| | | } |
| | | }) |
| | | |
| | | // 妿æ¯é¦é¡µï¼èªå¨éå®åå°ç¬¬ä¸ä¸ªèå |
| | | if (to.path === '/' || to.path === '/index') { |
| | | const permissionStore = usePermissionStore() |
| | | const topMenus = permissionStore.topbarRouters.filter(menu => !menu.hidden) |
| | | if (topMenus.length > 0) { |
| | | // 跳转å°ç¬¬ä¸ä¸ªèå |
| | | const firstMenu = topMenus[0] |
| | | |
| | | // æ¥æ¾ææ·±å±çåèåå¹¶æå»ºè·¯å¾ |
| | | const { path, query } = findDeepestPath(firstMenu); |
| | | |
| | | if (path) { |
| | | // æææ·±å±åèåï¼è·³è½¬å°è¯¥èå |
| | | if (query) { |
| | | next({ path, query, replace: true }); |
| | | } else { |
| | | next({ path, replace: true }); |
| | | } |
| | | return; |
| | | } else if (firstMenu.children && firstMenu.children.length > 0) { |
| | | // 使ç¨åæé»è¾ |
| | | const firstChild = firstMenu.children[0] |
| | | const childPath = firstMenu.path.endsWith('/') ? firstMenu.path + firstChild.path : `${firstMenu.path}/${firstChild.path}` |
| | | next({ path: childPath, replace: true }) |
| | | return |
| | | } else { |
| | | // 没æåèåï¼ç´æ¥è·³è½¬ |
| | | next({ path: firstMenu.path, replace: true }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | next({ ...to, replace: true }) // hackæ¹æ³ ç¡®ä¿addRoutes已宿 |
| | | }) |
| | | }).catch(err => { |
| | |
| | | }) |
| | | }) |
| | | } else { |
| | | // 妿æ¯é¦é¡µï¼èªå¨éå®åå°ç¬¬ä¸ä¸ªèå |
| | | if (to.path === '/' || to.path === '/index') { |
| | | const permissionStore = usePermissionStore() |
| | | const topMenus = permissionStore.topbarRouters.filter(menu => !menu.hidden) |
| | | if (topMenus.length > 0) { |
| | | // 跳转å°ç¬¬ä¸ä¸ªèå |
| | | const firstMenu = topMenus[0] |
| | | |
| | | // æ¥æ¾ææ·±å±çåèåå¹¶æå»ºè·¯å¾ |
| | | const { path, query } = findDeepestPath(firstMenu); |
| | | |
| | | if (path) { |
| | | // æææ·±å±åèåï¼è·³è½¬å°è¯¥èå |
| | | if (query) { |
| | | next({ path, query, replace: true }); |
| | | } else { |
| | | next({ path, replace: true }); |
| | | } |
| | | return; |
| | | } else if (firstMenu.children && firstMenu.children.length > 0) { |
| | | // 使ç¨åæé»è¾ |
| | | const firstChild = firstMenu.children[0] |
| | | const childPath = firstMenu.path.endsWith('/') ? firstMenu.path + firstChild.path : `${firstMenu.path}/${firstChild.path}` |
| | | next({ path: childPath, replace: true }) |
| | | return |
| | | } else { |
| | | // 没æåèåï¼ç´æ¥è·³è½¬ |
| | | next({ path: firstMenu.path, replace: true }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | // èªå¨å¤ç带æéå®åçè·¯ç± |
| | | if (to.matched.length > 0 && to.matched[0].path === to.path) { |
| | | const currentRouteConfig = router.getRoutes().find(r => r.path === to.path); |
| | | |
| | | if (currentRouteConfig && currentRouteConfig.children && currentRouteConfig.children.length > 0) { |
| | | // æåè·¯ç±ï¼èªå¨å¯¼èªå°ææ·±å±åèå |
| | | const { path, query } = findDeepestPath(currentRouteConfig); |
| | | |
| | | if (path && path !== to.path) { |
| | | if (query) { |
| | | next({ path, query, replace: true }); |
| | | } else { |
| | | next({ path, replace: true }); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | next() |
| | | } |
| | | } |
| | |
| | | |
| | | router.afterEach(() => { |
| | | NProgress.done() |
| | | |
| | | // ç§»é¤ææå¯è½çé¦é¡µæ ç¾ |
| | | const tagsViewStore = useTagsViewStore(); |
| | | if (tagsViewStore && tagsViewStore.visitedViews) { |
| | | tagsViewStore.visitedViews = tagsViewStore.visitedViews.filter( |
| | | tag => tag.path !== '/index' && tag.path !== '/' && tag.name !== 'Index' |
| | | ); |
| | | } |
| | | }) |
| | |
| | | import { createWebHistory, createRouter } from 'vue-router' |
| | | /* Layout */ |
| | | import Layout from '@/layout' |
| | | import useAppStore from '@/store/modules/app' |
| | | |
| | | /** |
| | | * Note: è·¯ç±é
置项 |
| | |
| | | path: '/index', |
| | | component: () => import('@/views/index'), |
| | | name: 'Index', |
| | | meta: { title: 'é¦é¡µ', icon: 'dashboard', affix: true } |
| | | meta: { title: 'é¦é¡µ', icon: 'dashboard', affix: true, showSidebar: true, breadcrumb: false } |
| | | } |
| | | ] |
| | | }, |
| | |
| | | sidebar: { |
| | | opened: sessionStorage.getItem('sidebarStatus') ? !!+sessionStorage.getItem('sidebarStatus') : true, |
| | | withoutAnimation: false, |
| | | hide: false |
| | | hide: sessionStorage.getItem('sidebarHide') ? JSON.parse(sessionStorage.getItem('sidebarHide')) : false |
| | | }, |
| | | device: 'desktop', |
| | | size: sessionStorage.getItem('size') || 'default' |
| | |
| | | }, |
| | | toggleSideBarHide(status) { |
| | | this.sidebar.hide = status |
| | | sessionStorage.setItem('sidebarHide', status) |
| | | }, |
| | | openMenu() { |
| | | this.sidebar.hide = false |
| | | this.sidebar.opened = true |
| | | sessionStorage.setItem('sidebarHide', 'false') |
| | | sessionStorage.setItem('sidebarStatus', 1) |
| | | }, |
| | | showCollapsedSidebar() { |
| | | this.sidebar.hide = false |
| | | this.sidebar.opened = false |
| | | this.sidebar.withoutAnimation = false |
| | | sessionStorage.setItem('sidebarHide', 'false') |
| | | sessionStorage.setItem('sidebarStatus', 0) |
| | | } |
| | | } |
| | | }) |
| | |
| | | }) |
| | | |
| | | // éååå°ä¼ æ¥çè·¯ç±å符串ï¼è½¬æ¢ä¸ºç»ä»¶å¯¹è±¡ |
| | | function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { |
| | | function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false, parentRoute = null) { |
| | | return asyncRouterMap.filter(route => { |
| | | // ä¸åè¿æ»¤æé¦é¡µçæ¿ç¸å
³è·¯ç± |
| | | /* |
| | | // è¿æ»¤æé¦é¡µçæ¿ç¸å
³è·¯ç± |
| | | if (route.name === 'Index' && route.meta && route.meta.title === 'é¦é¡µçæ¿') { |
| | | return false; |
| | | } |
| | | |
| | | // 妿æ¯é¦é¡µçæ¿çåèåï¼ä¹è¿æ»¤æ |
| | | if (route.path === '/index' || route.path === 'index' || |
| | | (route.meta && route.meta.title === 'é¦é¡µçæ¿')) { |
| | | return false; |
| | | } |
| | | */ |
| | | |
| | | // 设置ç¶è·¯ç±å¼ç¨ |
| | | if (parentRoute) { |
| | | route.parent = parentRoute; |
| | | } |
| | | |
| | | if (type && route.children) { |
| | | route.children = filterChildren(route.children) |
| | | } |
| | |
| | | route.component = loadView(route.component) |
| | | } |
| | | } |
| | | // å¤ç query åæ°ï¼å°å符串转æ¢ä¸ºå¯¹è±¡ |
| | | if (route.query && typeof route.query === 'string') { |
| | | try { |
| | | route.query = JSON.parse(route.query); |
| | | } catch (error) { |
| | | console.error('Error parsing query string:', route.query, error); |
| | | } |
| | | } |
| | | if (route.children != null && route.children && route.children.length) { |
| | | route.children = filterAsyncRouter(route.children, route, type) |
| | | // å°å½åè·¯ç±ä½ä¸ºç¶è·¯ç±ä¼ éç»åè·¯ç± |
| | | route.children = filterAsyncRouter(route.children, route, type, route) |
| | | } else { |
| | | delete route['children'] |
| | | delete route['redirect'] |
| | |
| | | if (el.children && el.children.length) { |
| | | if (el.component === 'ParentView' && !lastRouter) { |
| | | el.children.forEach(c => { |
| | | c.path = el.path + '/' + c.path |
| | | // 设置ç¶è·¯ç±å¼ç¨ |
| | | c.parent = el; |
| | | |
| | | // ç¡®ä¿è·¯å¾æ ¼å¼æ£ç¡®æ¼æ¥ |
| | | if (el.path) { |
| | | if (c.path.startsWith('/')) { |
| | | // ç»å¯¹è·¯å¾ä¿æä¸å |
| | | // ä½ä¹è®¾ç½®åå§ç¶è·¯å¾ç¨äºèåå¯¼èª |
| | | c.parentPath = el.path; |
| | | } else { |
| | | // ç¸å¯¹è·¯å¾éè¦æ¼æ¥ |
| | | c.path = el.path.endsWith('/') ? el.path + c.path : el.path + '/' + c.path; |
| | | } |
| | | } |
| | | |
| | | if (c.children && c.children.length) { |
| | | children = children.concat(filterChildren(c.children, c)) |
| | | return |
| | |
| | | } |
| | | } |
| | | if (lastRouter) { |
| | | el.path = lastRouter.path + '/' + el.path |
| | | // 设置ç¶è·¯ç±å¼ç¨ |
| | | el.parent = lastRouter; |
| | | |
| | | // ç¡®ä¿è·¯å¾æ ¼å¼æ£ç¡®æ¼æ¥ |
| | | if (lastRouter.path) { |
| | | if (el.path.startsWith('/')) { |
| | | // ç»å¯¹è·¯å¾ä¿æä¸å |
| | | // ä½ä¹è®¾ç½®åå§ç¶è·¯å¾ç¨äºèåå¯¼èª |
| | | el.parentPath = lastRouter.path; |
| | | } else { |
| | | // ç¸å¯¹è·¯å¾éè¦æ¼æ¥ |
| | | el.path = lastRouter.path.endsWith('/') ? lastRouter.path + el.path : lastRouter.path + '/' + el.path; |
| | | } |
| | | } |
| | | |
| | | if (el.children && el.children.length) { |
| | | children = children.concat(filterChildren(el.children, el)) |
| | | return |
| | |
| | | // ä¿®æ¹å¸å±è®¾ç½® |
| | | changeSetting(data) { |
| | | const { key, value } = data |
| | | if (this.hasOwnProperty(key)) { |
| | | if (key in this.$state) { |
| | | this[key] = value |
| | | } |
| | | }, |
| | |
| | | ) |
| | | }, |
| | | addVisitedView(view) { |
| | | // è¿æ»¤é¦é¡µæ ç¾ |
| | | if (view.path === '/index' || view.path === '/' || view.name === 'Index') { |
| | | return; |
| | | } |
| | | |
| | | if (this.visitedViews.some(v => v.path === view.path)) return |
| | | this.visitedViews.push( |
| | | Object.assign({}, view, { |
| | |
| | | }, |
| | | delAllVisitedViews(view) { |
| | | return new Promise(resolve => { |
| | | const affixTags = this.visitedViews.filter(tag => tag.meta.affix) |
| | | // è¿æ»¤æé¦é¡µæ ç¾ï¼åªä¿çå
¶ä»åºå®æ ç¾ |
| | | const affixTags = this.visitedViews.filter(tag => tag.meta.affix && tag.path !== '/index' && tag.path !== '/' && tag.name !== 'Index') |
| | | this.visitedViews = affixTags |
| | | this.iframeViews = [] |
| | | resolve([...this.visitedViews]) |
| | |
| | | show-overflow-tooltip |
| | | :formatter="(row, column) => formatterLabel(energyTypeList, row.energyId)" |
| | | /> |
| | | <el-table-column label="é¢è®¾å¼" prop="energyType" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="é¢è®¾å¼" prop="limitingValue" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="æ¥è¦å¼" prop="alarmValue" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="æ¥è¦æ¶é´" prop="alarmBeginTime" align="center" show-overflow-tooltip /> |
| | | </el-table> |
| | |
| | | timeType: null, |
| | | dataTime: null, |
| | | nodeId: null, |
| | | modelCode: '' |
| | | }) |
| | | |
| | | import { getByNodeId, getCountInfo } from "@/api/alarmManage/alarmManage" |
| | | import { el } from "element-plus/es/locales.mjs" |
| | | import { useRoute } from "vue-router" |
| | | const route = useRoute() |
| | | let form = ref({}) |
| | | let currentNode = ref() |
| | | |
| | |
| | | handleTimeType(period.value[0].value) |
| | | |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | |
| | | function getByNodeIdFun() { |
| | |
| | | // getByNodeIdFun() |
| | | function handleQuery() { |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | function resetQuery() { |
| | | handleTimeType("YEAR") |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | let dataArray = ref({ |
| | | indexCount: 0, |
| | |
| | | monthCount: 0, |
| | | }) |
| | | function getCountInfoFun() { |
| | | getCountInfo(queryParams.value).then((res) => { |
| | | getCountInfo({ |
| | | ...queryParams.value, |
| | | modelCode: route.query.modelCode, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | dataArray.value = res.data |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getCountInfoFun() |
| | | function pieChart(Id, data, name) { |
| | | console.log(data) |
| | | let total = 0 |
| | |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true, |
| | | length: 5, |
| | | }, |
| | | // axisTick: { |
| | | // show: false, |
| | | // alignWithLabel: true, |
| | | // length: 5, |
| | | // }, |
| | | // åæ è½´å»åº¦çº¿æ ·å¼ |
| | | axisTick: { |
| | | show: false, |
| | |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | // åæ è½´å»åº¦ |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true, |
| | | length: 5, |
| | | }, |
| | | // axisTick: { |
| | | // show: false, |
| | | // alignWithLabel: true, |
| | | // length: 5, |
| | | // }, |
| | | // åæ è½´å»åº¦çº¿æ ·å¼ |
| | | axisTick: { |
| | | show: false, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="page-container"> |
| | | <div class="page-container-left"> |
| | | <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" /> |
| | | </div> |
| | | <div class="page-container-right"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true"> |
| | | <el-form-item label="æé´" prop="timeType"> |
| | | <el-select |
| | | v-model="queryParams.timeType" |
| | | placeholder="æé´" |
| | | clearable |
| | | style="width: 120px" |
| | | @change="handleTimeType" |
| | | > |
| | | <el-option v-for="dict in period" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | :type="queryParams.timeType == 'YEAR' ? 'year' : queryParams.timeType == 'MONTH' ? 'month' : 'date'" |
| | | :format=" |
| | | queryParams.timeType == 'YEAR' ? 'YYYY' : queryParams.timeType == 'MONTH' ? 'YYYY-MM' : 'YYYY-MM-DD' |
| | | " |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="æ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è½æºç±»å" style="width: 120px"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | @click="handleEnergyType(item)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery"> æç´¢ </el-button> |
| | | <!-- <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> --> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | style="height: calc(100vh - 220px) !important; max-height: calc(100vh - 220px) !important; overflow-y: auto" |
| | | v-loading="loading" |
| | | > |
| | | <BaseCard :title="queryParams.nodeName + '-æ¯è·¯ç¨è½åæ'"> |
| | | <div class=""> |
| | | <!-- <div id="Chart1" /> --> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" :chartType="'bar'" /> |
| | | </div> |
| | | </BaseCard> |
| | | <BaseCard :title="queryParams.nodeName + '-æ¯è·¯ç¨è½è¯¦æ
-' + queryParams.enername"> |
| | | <div class="table-box"> |
| | | <!-- show-summary --> |
| | | <el-table :data="departmentList"> |
| | | <el-table-column label="èç¹" align="center" key="nodeName" prop="nodeName" fixed="left" /> |
| | | <el-table-column label="å计" align="center" key="total" prop="total" width="100" fixed="left" /> |
| | | <template v-if="queryParams.timeType == 'DAY'"> |
| | | <el-table-column |
| | | v-for="index in 24" |
| | | :key="index" |
| | | :label="index - 1 + 'æ¶'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | <template v-if="queryParams.timeType == 'MONTH'"> |
| | | <el-table-column |
| | | v-for="index in 31" |
| | | :key="index" |
| | | :label="index + 'æ¥'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | <template v-if="queryParams.timeType == 'YEAR'"> |
| | | <el-table-column |
| | | v-for="index in 12" |
| | | :key="index" |
| | | :label="index + 'æ'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table> |
| | | </div> |
| | | </BaseCard> |
| | | <!-- </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="branchanalysis"> |
| | | import buildApi from "@/api/buildingConsumption/api" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import LineChart from "@/components/Echarts/LineChart.vue" |
| | | const { proxy } = getCurrentInstance() |
| | | const { period } = proxy.useDict("period") |
| | | import { useRoute } from "vue-router" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | getList() |
| | | } |
| | | ) |
| | | const energyTypeList = ref(undefined) |
| | | const departmentList = ref([]) |
| | | const loading = ref(false) |
| | | const data = reactive({ |
| | | queryParams: { |
| | | nodeId: null, |
| | | timeType: null, |
| | | dataTime: null, |
| | | energyType: null, |
| | | }, |
| | | query: { |
| | | modelCode: null, |
| | | }, |
| | | }) |
| | | const { queryParams, query } = toRefs(data) |
| | | const itemBuildData = ref({}) |
| | | const LineChartRef = ref() |
| | | const lineChartData = ref({}) |
| | | /** èç¹åå»äºä»¶ */ |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id |
| | | queryParams.value.nodeName = data.label |
| | | handleTimeType(period.value[0].value) |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | | queryParams.value.enername = energyTypeList.value[0].enername |
| | | queryParams.value.muid = energyTypeList.value[0].muid |
| | | handleQuery() |
| | | }) |
| | | } |
| | | function handleTimeType(e) { |
| | | queryParams.value.timeType = e |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | handleQuery() |
| | | } |
| | | function handleEnergyType(item) { |
| | | queryParams.value.enername = item.enername |
| | | queryParams.value.muid = item.muid |
| | | handleQuery() |
| | | } |
| | | function getList() { |
| | | loading.value = true |
| | | buildApi |
| | | .branchanalysis( |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }) |
| | | ) |
| | | .then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | | loading.value = false |
| | | let yData = [] |
| | | let xData = [] |
| | | if (!!res.data) { |
| | | departmentList.value = [res.data] || [] |
| | | } |
| | | let dataList = res.data || {} |
| | | if (queryParams.value.timeType == "DAY") { |
| | | for (let i = 0; i < 24; i++) { |
| | | xData.push(i + "æ¶") |
| | | yData.push(dataList[`value${i}`]) |
| | | } |
| | | } else if (queryParams.value.timeType == "MONTH") { |
| | | for (let i = 0; i < 31; i++) { |
| | | xData.push(i + 1 + "æ¥") |
| | | yData.push(dataList[`value${i}`]) |
| | | } |
| | | } else { |
| | | for (let i = 0; i < 12; i++) { |
| | | xData.push(i + 1 + "æ") |
| | | yData.push(dataList[`value${i}`]) |
| | | } |
| | | } |
| | | |
| | | lineChartData.value = { |
| | | title: queryParams.value.muid, |
| | | xAxis: xData, |
| | | series: [ |
| | | { |
| | | name: queryParams.value.enername, |
| | | data: yData, |
| | | }, |
| | | ], |
| | | } |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | loading.value = false |
| | | }) |
| | | } |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-æç´¢ |
| | | function handleQuery() { |
| | | getList() |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-éç½® |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef") |
| | | handleTimeType(period.value[0].value) |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | | queryParams.value.enername = energyTypeList.value[0].enername |
| | | queryParams.value.muid = energyTypeList.value[0].muid |
| | | queryParams.value.analysisType = "YOY" |
| | | handleQuery() |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-å¯¼åº |
| | | function handleExport() { |
| | | proxy.download( |
| | | "consumptionanalysis/energyExport", |
| | | { |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }, |
| | | `${queryParams.value.nodeName}-ååºè½èåæ_${new Date().getTime()}.xlsx` |
| | | ) |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/styles/page.scss"; |
| | | .el-tabs { |
| | | padding: 0 12px; |
| | | margin-top: 12px; |
| | | :deep(.el-tabs__header) { |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | .themeDark { |
| | | .build-sum { |
| | | border: 1px solid #8c8b8b; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | color: #fff; |
| | | .build-sum-item { |
| | | width: 25%; |
| | | text-align: center; |
| | | padding: 12px 0; |
| | | .count { |
| | | font-size: 24px; |
| | | font-weight: 600; |
| | | margin-top: 8px; |
| | | color: #409eff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .themeLight { |
| | | .build-sum { |
| | | border: 1px solid #eaeaea; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | color: #333; |
| | | .build-sum-item { |
| | | width: 25%; |
| | | text-align: center; |
| | | padding: 12px 0; |
| | | .count { |
| | | font-size: 24px; |
| | | font-weight: 600; |
| | | margin-top: 8px; |
| | | color: #409eff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="page-container"> |
| | | <div class="page-container-left"> |
| | | <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" /> |
| | | </div> |
| | | <div class="page-container-right"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true"> |
| | | <el-form-item label="æé´" prop="timeType"> |
| | | <el-select |
| | | v-model="queryParams.timeType" |
| | | placeholder="æé´" |
| | | clearable |
| | | style="width: 120px" |
| | | @change="handleTimeType" |
| | | > |
| | | <el-option v-for="dict in period" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | :type="queryParams.timeType == 'YEAR' ? 'year' : queryParams.timeType == 'MONTH' ? 'month' : 'date'" |
| | | :format=" |
| | | queryParams.timeType == 'YEAR' ? 'YYYY' : queryParams.timeType == 'MONTH' ? 'YYYY-MM' : 'YYYY-MM-DD' |
| | | " |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="æ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è½æºç±»å" style="width: 120px"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | @click="handleEnergyType(item)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery"> æç´¢ </el-button> |
| | | <!-- <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> --> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | style="height: calc(100vh - 220px) !important; max-height: calc(100vh - 220px) !important; overflow-y: auto" |
| | | v-loading="loading" |
| | | > |
| | | <BaseCard :title="queryParams.nodeName + '-å项ç¨è½åæ'"> |
| | | <div class="build-sum"> |
| | | <div class="build-sum-item"> |
| | | <div>æ»ç¨é/{{ queryParams.muid }}</div> |
| | | <div class="count">{{ itemBuildData.total || 0 }}</div> |
| | | </div> |
| | | <div class="build-sum-item"> |
| | | <div>æå¤§ç¨é/{{ queryParams.muid }}</div> |
| | | <div class="count">{{ itemBuildData.max || 0 }}</div> |
| | | </div> |
| | | <div class="build-sum-item"> |
| | | <div>æå°ç¨é/{{ queryParams.muid }}</div> |
| | | <div class="count">{{ itemBuildData.min || 0 }}</div> |
| | | </div> |
| | | <div class="build-sum-item"> |
| | | <div>å¹³åç¨é/{{ queryParams.muid }}</div> |
| | | <div class="count">{{ itemBuildData.avg || 0 }}</div> |
| | | </div> |
| | | </div> |
| | | <div class=""> |
| | | <!-- <div id="Chart1" /> --> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </BaseCard> |
| | | <BaseCard :title="queryParams.nodeName + '-å项ç¨è½è¯¦æ
-' + queryParams.enername"> |
| | | <div class="table-box"> |
| | | <!-- show-summary --> |
| | | <el-table :data="departmentList"> |
| | | <el-table-column label="èç¹" align="center" key="nodeName" prop="nodeName" fixed="left" /> |
| | | <el-table-column label="å计" align="center" key="total" prop="total" width="100" fixed="left" /> |
| | | <template v-if="queryParams.timeType == 'DAY'"> |
| | | <el-table-column |
| | | v-for="index in 24" |
| | | :key="index" |
| | | :label="index - 1 + 'æ¶'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | <template v-if="queryParams.timeType == 'MONTH'"> |
| | | <el-table-column |
| | | v-for="index in 31" |
| | | :key="index" |
| | | :label="index + 'æ¥'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | <template v-if="queryParams.timeType == 'YEAR'"> |
| | | <el-table-column |
| | | v-for="index in 12" |
| | | :key="index" |
| | | :label="index + 'æ'" |
| | | align="center" |
| | | min-width="130" |
| | | > |
| | | <template #default="scope">{{ scope.row[`value${index - 1}`] }}</template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table> |
| | | </div> |
| | | </BaseCard> |
| | | <!-- </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="itemBuild"> |
| | | import buildApi from "@/api/buildingConsumption/api" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import LineChart from "@/components/Echarts/LineChart.vue" |
| | | const { proxy } = getCurrentInstance() |
| | | const { period } = proxy.useDict("period") |
| | | import { useRoute } from "vue-router" |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | getList() |
| | | } |
| | | ) |
| | | const energyTypeList = ref(undefined) |
| | | const departmentList = ref([]) |
| | | const loading = ref(false) |
| | | const data = reactive({ |
| | | queryParams: { |
| | | nodeId: null, |
| | | timeType: null, |
| | | dataTime: null, |
| | | energyType: null, |
| | | }, |
| | | query: { |
| | | modelCode: null, |
| | | }, |
| | | }) |
| | | const { queryParams, query } = toRefs(data) |
| | | const itemBuildData = ref({}) |
| | | const LineChartRef = ref() |
| | | const lineChartData = ref({}) |
| | | /** èç¹åå»äºä»¶ */ |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id |
| | | queryParams.value.nodeName = data.label |
| | | handleTimeType(period.value[0].value) |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | | queryParams.value.enername = energyTypeList.value[0].enername |
| | | queryParams.value.muid = energyTypeList.value[0].muid |
| | | handleQuery() |
| | | }) |
| | | } |
| | | function handleTimeType(e) { |
| | | queryParams.value.timeType = e |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | handleQuery() |
| | | } |
| | | function handleEnergyType(item) { |
| | | queryParams.value.enername = item.enername |
| | | queryParams.value.muid = item.muid |
| | | handleQuery() |
| | | } |
| | | function getList() { |
| | | loading.value = true |
| | | buildApi |
| | | .itemizedEnergyAnalysis( |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }) |
| | | ) |
| | | .then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | | loading.value = false |
| | | itemBuildData.value = res.data |
| | | let yData = [] |
| | | let xData = [] |
| | | let title = [] |
| | | if (!!res.data.dataList) { |
| | | departmentList.value = res.data.dataList || [] |
| | | } |
| | | let dataList = res.data.dataList || [] |
| | | if (queryParams.value.timeType == "DAY") { |
| | | for (let i = 0; i < 24; i++) { |
| | | xData.push(i + "æ¶") |
| | | yData.push(dataList[0][`value${i}`]) |
| | | } |
| | | } else if (queryParams.value.timeType == "MONTH") { |
| | | for (let i = 0; i < 31; i++) { |
| | | xData.push(i + 1 + "æ¥") |
| | | yData.push(dataList[0][`value${i}`]) |
| | | } |
| | | } else { |
| | | for (let i = 0; i < 12; i++) { |
| | | xData.push(i + 1 + "æ") |
| | | yData.push(dataList[0][`value${i}`]) |
| | | } |
| | | } |
| | | |
| | | lineChartData.value = { |
| | | title: queryParams.value.muid, |
| | | xAxis: xData, |
| | | series: [ |
| | | { |
| | | name: queryParams.value.enername, |
| | | data: yData, |
| | | }, |
| | | ], |
| | | } |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | loading.value = false |
| | | }) |
| | | } |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-æç´¢ |
| | | function handleQuery() { |
| | | getList() |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-éç½® |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef") |
| | | handleTimeType(period.value[0].value) |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | | queryParams.value.enername = energyTypeList.value[0].enername |
| | | queryParams.value.muid = energyTypeList.value[0].muid |
| | | queryParams.value.analysisType = "YOY" |
| | | handleQuery() |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-å¯¼åº |
| | | function handleExport() { |
| | | proxy.download( |
| | | "consumptionanalysis/energyExport", |
| | | { |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }, |
| | | `${queryParams.value.nodeName}-ååºè½èåæ_${new Date().getTime()}.xlsx` |
| | | ) |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/styles/page.scss"; |
| | | .el-tabs { |
| | | padding: 0 12px; |
| | | margin-top: 12px; |
| | | :deep(.el-tabs__header) { |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | .themeDark { |
| | | .build-sum { |
| | | border: 1px solid #8c8b8b; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | color: #fff; |
| | | .build-sum-item { |
| | | width: 25%; |
| | | text-align: center; |
| | | padding: 12px 0; |
| | | .count { |
| | | font-size: 24px; |
| | | font-weight: 600; |
| | | margin-top: 8px; |
| | | color: #409eff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .themeLight { |
| | | .build-sum { |
| | | border: 1px solid #eaeaea; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | color: #333; |
| | | .build-sum-item { |
| | | width: 25%; |
| | | text-align: center; |
| | | padding: 12px 0; |
| | | .count { |
| | | font-size: 24px; |
| | | font-weight: 600; |
| | | margin-top: 8px; |
| | | color: #409eff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="page-title"> |
| | | <div class="title-bar"> |
| | | <span class="title-text">ç½å
³ç¶æçæµ</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="table-box"> |
| | | <div class="border"> |
| | | <div class="table" v-for="(item, index) in dataList" :key="index"> |
| | |
| | | ]) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .page { |
| | | background: #08234F; |
| | | min-height: calc(100vh - 145px) |
| | | } |
| | | |
| | | .page-title { |
| | | position: relative; |
| | | |
| | | .title-bar { |
| | | position: relative; |
| | | padding: 14px 0; |
| | | padding-left: 16px; |
| | | |
| | | .title-text { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | position: relative; |
| | | padding-left: 22px; |
| | | color: #fff; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 5px; |
| | | height: 18px; |
| | | background-color: #3883FA; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | bottom: -4px; |
| | | opacity: 0.12; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 1px; |
| | | background-color: #E6E6E6; |
| | | } |
| | | } |
| | | |
| | | .themeDark { |
| | | .border { |
| | | border: 1px solid #fff; |
| | | color: #fff; |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .table-box { |
| | | margin: 20px 25px; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .table-box { |
| | | margin: 10px 25px; |
| | | } |
| | | } |
| | | |
| | | .page { |
| | | .table-box { |
| | | // ... ä¿æç°ææ ·å¼ |
| | | } |
| | | } |
| | | </style> |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="yyyy-MM" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px" height="380"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100px"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | getDataList({ |
| | | ...queryParams.value, |
| | | }).then((response) => { |
| | | console.log("1111111111", response) |
| | | energyList.value = response.data.tabledata |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .page { |
| | | background-color: #08234F; |
| | | } |
| | | |
| | | .themeDark { |
| | | .card-list { |
| | | width: 100%; |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶é´éæ©" prop="dataTime"> |
| | | <el-date-picker v-if="form.timeType == 'YEAR'" v-model="form.dataTime" type="year" /> |
| | | <el-date-picker v-if="form.timeType == 'YEAR'" v-model="form.dataTime" type="year" :clearable="false" /> |
| | | <el-date-picker |
| | | v-else-if="form.timeType == 'MONTH'" |
| | | v-model="form.dataTime" |
| | | type="month" |
| | | format="YYYY-MM" |
| | | value-format="YYYY-MM" |
| | | :clearable="false" |
| | | /> |
| | | <el-date-picker v-else v-model="form.dataTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> |
| | | <el-date-picker |
| | | v-else |
| | | v-model="form.dataTime" |
| | | :clearable="false" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | |
| | | getFlowCharts({ |
| | | energyType: form.value.energyType, |
| | | nodeId: "", |
| | | queryTime: form.value.dataTime, |
| | | queryTime: proxy.dayjs(new Date(form.value.dataTime)).format("YYYY-MM-DD"), |
| | | dataTime: proxy.dayjs(new Date(form.value.dataTime)).format("YYYY-MM-DD"), |
| | | timeType: form.value.timeType, |
| | | modelCode: proxy.$route.query.modelCode, |
| | | }).then((res) => { |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding-top: 12px; |
| | | padding: 12px 14px 0; |
| | | |
| | | .card-list-item { |
| | | width: 24%; |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding-top: 12px; |
| | | padding: 12px 14px 0; |
| | | |
| | | .card-list-item { |
| | | width: 24%; |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <HeaderCard :title="'æé¦è½æºæ°æ®ç»¼ååæ'" /> |
| | | <HeaderCard :title="'è½æºæ°æ®ç»¼ååæ'" /> |
| | | <div class="content-box"> |
| | | <div class="left-box"> |
| | | <BaseCardBaseCard title="彿¥è½è"> |
| | |
| | | </template> |
| | | |
| | | <script setup name="equipment"> |
| | | import { listRegion, listDepartment } from "@/api/energyAnalysis/energyAnalysis" |
| | | import { listDepartment } from "@/api/energyAnalysis/energyAnalysis" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import * as echarts from "echarts" |
| | | import request from "@/utils/request" |
| | | const { proxy } = getCurrentInstance() |
| | | const { period } = proxy.useDict("period") |
| | | import { useRoute } from "vue-router" |
| | |
| | | // } |
| | | const myChart1 = echarts.init(document.getElementById("Chart1")) |
| | | // const myChart2 = echarts.init(document.getElementById("Chart2")); |
| | | listRegion( |
| | | proxy.addDateRange({ |
| | | |
| | | // ä¿®æ¹ä¸ºç´æ¥è°ç¨consumptionanalysis/getByAreaæ¥å£ |
| | | request({ |
| | | url: "/consumptionanalysis/getByArea", |
| | | method: "get", |
| | | params: proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }) |
| | | ).then((res) => { |
| | | }).then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | | loading.value = false |
| | | let xdata = [] |
| | |
| | | // è½è对æ¯åæ-设å¤è½èåæ-å¯¼åº |
| | | function handleExport() { |
| | | proxy.download( |
| | | "consumptionanalysis/energyExport", |
| | | "consumptionanalysis/getByArea/export", |
| | | { |
| | | ...queryParams.value, |
| | | ...query.value, |
| | |
| | | <template> |
| | | <div class="page" style="padding-left: 8px; padding-top: 8px"> |
| | | <CardHeader :showBtn="true" :active="'0'" :period="period" @handleClick="handleTimeType"> |
| | | <span> |
| | | <span class="card-header-title"> |
| | | å
¨åè½èç»è®¡ |
| | | <el-button @click="dialogVisible = true" v-if="list.length > 1"> æ¥çæ´å¤ </el-button> |
| | | <el-button @click="dialogVisible = true" v-if="list.length > 1" type="primary" size="small" class="header-more-btn"> æ¥çæ´å¤ </el-button> |
| | | </span> |
| | | </CardHeader> |
| | | <template v-for="(row, rowIndex) in list" :key="rowIndex" v-loading="loading02"> |
| | | <div class="card-list" v-if="settingsStore.sideTheme == 'theme-dark' && rowIndex == 0"> |
| | | <template v-for="(item, index) in row" :key="index"> |
| | | <div |
| | | class="card-list-item" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].bg + ')', |
| | | }" |
| | | > |
| | | <div class="item-top"> |
| | | <div class="top-icon" :style="{ backgroundImage: 'url(' + bgList[index].icon + ')' }" /> |
| | | <div class="card-list-item"> |
| | | <div class="item-left"> |
| | | <div class="top-icon" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].icon + ')', |
| | | backgroundColor: bgList[index].iconBg, |
| | | width: '73px', |
| | | height: '73px', |
| | | backgroundSize: '40px' |
| | | }" |
| | | /> |
| | | </div> |
| | | <div class="item-right"> |
| | | <div class="top-right"> |
| | | <div class="right-name"> |
| | | {{ item.energyName }} |
| | | <span v-if="item.energyUnit" class="unit">({{ item.energyUnit }})</span> |
| | | </div> |
| | | <div class="right-value"> |
| | | <span> {{ item.count }}</span> |
| | | <!-- <span class="unit">{{ item.energyUnit }}</span> --> |
| | | <span>{{ item.count }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi) }} |
| | | <el-icon :color="item.tongbi > 0 ? 'green' : item.tongbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span |
| | | >ç¯æ¯: {{ Math.abs(item.huanbi) }} |
| | | <el-icon :color="item.huanbi > 0 ? 'green' : item.huanbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi).toFixed(1) }} |
| | | <el-icon :color="item.tongbi > 0 ? '#4CAF50' : item.tongbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span> |
| | | ç¯æ¯: {{ Math.abs(item.huanbi).toFixed(1) }} |
| | | <el-icon :color="item.huanbi > 0 ? '#4CAF50' : item.huanbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="card-list" v-if="settingsStore.sideTheme != 'theme-dark' && rowIndex == 0"> |
| | | <template v-for="(item, index) in row" :key="index" v-show="rowIndex == 0"> |
| | | <div class="card-list-item"> |
| | | <div class="item-top"> |
| | | <div class="top-icon" :style="{ backgroundImage: 'url(' + bgList[index].icon2 + ')' }" /> |
| | | <div class="item-left"> |
| | | <div class="top-icon" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].icon2 + ')', |
| | | backgroundColor: bgList[index].iconBg, |
| | | width: '73px', |
| | | height: '73px', |
| | | backgroundSize: '40px' |
| | | }" |
| | | /> |
| | | </div> |
| | | <div class="item-right"> |
| | | <div class="top-right"> |
| | | <div class="right-name"> |
| | | {{ item.energyName }} |
| | | <span v-if="item.energyUnit" class="unit">({{ item.energyUnit }})</span> |
| | | </div> |
| | | <div class="right-value"> |
| | | <span>{{ item.count }}</span> |
| | | <span class="unit">{{ item.energyUnit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi) }} |
| | | <el-icon :color="item.tongbi > 0 ? 'green' : item.tongbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span |
| | | >ç¯æ¯: {{ Math.abs(item.huanbi) }} |
| | | <el-icon :color="item.huanbi > 0 ? 'green' : item.huanbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi).toFixed(1) }} |
| | | <el-icon :color="item.tongbi > 0 ? '#4CAF50' : item.tongbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span> |
| | | ç¯æ¯: {{ Math.abs(item.huanbi).toFixed(1) }} |
| | | <el-icon :color="item.huanbi > 0 ? '#4CAF50' : item.huanbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-dialog v-model="dialogVisible" title="æ¥çå
¨åè½èç»è®¡" width="80%" v-if="dialogVisible"> |
| | | <el-dialog v-model="dialogVisible" title="æ¥çå
¨åè½èç»è®¡" width="90%" v-if="dialogVisible"> |
| | | <template v-for="(row, rowIndex) in list" :key="rowIndex"> |
| | | <div class="card-list" v-if="settingsStore.sideTheme == 'theme-dark'"> |
| | | <template v-for="(item, index) in row" :key="index"> |
| | | <div |
| | | class="card-list-item" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].bg + ')', |
| | | }" |
| | | > |
| | | <div class="item-top"> |
| | | <div |
| | | class="top-icon" |
| | | <div class="card-list-item"> |
| | | <div class="item-left"> |
| | | <div class="top-icon" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].icon + ')', |
| | | backgroundColor: bgList[index].iconBg, |
| | | width: '73px', |
| | | height: '73px', |
| | | backgroundSize: '40px' |
| | | }" |
| | | /> |
| | | </div> |
| | | <div class="item-right"> |
| | | <div class="top-right"> |
| | | <div class="right-name"> |
| | | {{ item.energyName }} |
| | | <span v-if="item.energyUnit" class="unit">({{ item.energyUnit }})</span> |
| | | </div> |
| | | <div class="right-value"> |
| | | <span> {{ item.count }}</span> |
| | | <span class="unit">{{ item.energyUnit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi) }} |
| | | <el-icon :color="item.tongbi > 0 ? 'green' : item.tongbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span |
| | | >ç¯æ¯: {{ Math.abs(item.huanbi) }} |
| | | <el-icon :color="item.huanbi > 0 ? 'green' : item.huanbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi).toFixed(1) }} |
| | | <el-icon :color="item.tongbi > 0 ? '#4CAF50' : item.tongbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span> |
| | | ç¯æ¯: {{ Math.abs(item.huanbi).toFixed(1) }} |
| | | <el-icon :color="item.huanbi > 0 ? '#4CAF50' : item.huanbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | <div class="card-list" v-if="settingsStore.sideTheme != 'theme-dark'"> |
| | | <template v-for="(item, index) in row" :key="index" v-show="rowIndex == 0"> |
| | | <template v-for="(item, index) in row" :key="index"> |
| | | <div class="card-list-item"> |
| | | <div class="item-top"> |
| | | <div |
| | | class="top-icon" |
| | | <div class="item-left"> |
| | | <div class="top-icon" |
| | | :style="{ |
| | | backgroundImage: 'url(' + bgList[index].icon2 + ')', |
| | | backgroundColor: bgList[index].iconBg, |
| | | width: '73px', |
| | | height: '73px', |
| | | backgroundSize: '40px' |
| | | }" |
| | | /> |
| | | </div> |
| | | <div class="item-right"> |
| | | <div class="top-right"> |
| | | <div class="right-name"> |
| | | {{ item.energyName }} |
| | |
| | | <span class="unit">{{ item.energyUnit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi) }} |
| | | <el-icon :color="item.tongbi > 0 ? 'green' : item.tongbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span |
| | | >ç¯æ¯: {{ Math.abs(item.huanbi) }} |
| | | <el-icon :color="item.huanbi > 0 ? 'green' : item.huanbi < 0 ? 'red' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | <div class="item-bottom"> |
| | | <div class="bottom-left"> |
| | | <span> |
| | | 忝: {{ Math.abs(item.tongbi).toFixed(1) }} |
| | | <el-icon :color="item.tongbi > 0 ? '#4CAF50' : item.tongbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.tongbi > 0" /> |
| | | <Bottom v-if="item.tongbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | <div class="bottom-right"> |
| | | <span> |
| | | ç¯æ¯: {{ Math.abs(item.huanbi).toFixed(1) }} |
| | | <el-icon :color="item.huanbi > 0 ? '#4CAF50' : item.huanbi < 0 ? '#F44336' : ''"> |
| | | <Top v-if="item.huanbi > 0" /> |
| | | <Bottom v-if="item.huanbi < 0" /> |
| | | </el-icon> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="line"></div> |
| | | </template> |
| | | </div> |
| | | </template> |
| | |
| | | import index_card_3 from "@/assets/images/home/index-card-3.png" |
| | | import index_card_4 from "@/assets/images/home/index-card-4.png" |
| | | import index_card_5 from "@/assets/images/home/index-card-5.png" |
| | | import card_icon_1 from "@/assets/images/home/card-icon-1.png" |
| | | import card_icon_2 from "@/assets/images/home/card-icon-2.png" |
| | | import card_icon_3 from "@/assets/images/home/card-icon-3.png" |
| | | import card_icon_4 from "@/assets/images/home/card-icon-4.png" |
| | | import card_icon_5 from "@/assets/images/home/card-icon-5.png" |
| | | import card_icon2_1 from "@/assets/images/home/card-icon2-1.png" |
| | | import card_icon2_2 from "@/assets/images/home/card-icon2-2.png" |
| | | import card_icon2_3 from "@/assets/images/home/card-icon2-3.png" |
| | | import card_icon2_4 from "@/assets/images/home/card-icon2-4.png" |
| | | import card_icon2_5 from "@/assets/images/home/card-icon2-5.png" |
| | | import card_icon_1 from "@/assets/images/2.png" |
| | | import card_icon_2 from "@/assets/images/3.png" |
| | | import card_icon_3 from "@/assets/images/5.png" |
| | | import card_icon_4 from "@/assets/images/6.png" |
| | | import card_icon_5 from "@/assets/images/7.png" |
| | | import card_icon2_1 from "@/assets/images/2.png" |
| | | import card_icon2_2 from "@/assets/images/3.png" |
| | | import card_icon2_3 from "@/assets/images/5.png" |
| | | import card_icon2_4 from "@/assets/images/6.png" |
| | | import card_icon2_5 from "@/assets/images/7.png" |
| | | import { fa } from "element-plus/es/locales.mjs" |
| | | const bgList = ref([ |
| | | { |
| | | bg: index_card_1, |
| | | icon: card_icon_1, |
| | | icon2: card_icon2_1, |
| | | iconBg: "#3F7EE8" |
| | | }, |
| | | { |
| | | bg: index_card_2, |
| | | icon: card_icon_2, |
| | | icon2: card_icon2_2, |
| | | iconBg: "#FFA024" |
| | | }, |
| | | { |
| | | bg: index_card_3, |
| | | icon: card_icon_3, |
| | | icon2: card_icon2_3, |
| | | iconBg: "#FFCC00" |
| | | }, |
| | | { |
| | | bg: index_card_4, |
| | | icon: card_icon_4, |
| | | icon2: card_icon2_4, |
| | | iconBg: "#3CC8D9" |
| | | }, |
| | | { |
| | | bg: index_card_5, |
| | | icon: card_icon_5, |
| | | icon2: card_icon2_5, |
| | | iconBg: "#8833FF" |
| | | }, |
| | | ]) |
| | | const list = ref([[{}, {}, {}, {}, {}]]) |
| | |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .card-header-title { |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .header-more-btn { |
| | | margin-left: 12px; |
| | | padding: 4px 10px; |
| | | font-size: 12px; |
| | | height: 28px; |
| | | } |
| | | } |
| | | |
| | | .themeDark { |
| | | .page { |
| | | padding: 20px; |
| | | background: #120f2e; |
| | | background: #05234A; |
| | | |
| | | .card-title { |
| | | width: 132px; |
| | |
| | | .card-list { |
| | | margin-top: 14px; |
| | | display: flex; |
| | | // justify-content: space-between; |
| | | width: 100%; |
| | | flex-wrap: wrap; |
| | | |
| | | flex-wrap: nowrap; |
| | | justify-content: space-between; |
| | | gap: 15px; |
| | | |
| | | &:after { |
| | | content: ""; |
| | | flex: 0 0 0; |
| | | } |
| | | |
| | | .card-list-item { |
| | | width: 19%; |
| | | margin-right: 1%; |
| | | height: 157px; |
| | | background-size: 100% 100%; |
| | | width: 0; |
| | | flex: 1 1 320px; |
| | | max-width: 320px; |
| | | height: 135px; |
| | | background: rgba(242, 246, 250, 0.1); |
| | | box-sizing: border-box; |
| | | padding: 25px 18px 12px 16px; |
| | | padding: 16px; |
| | | color: #fff; |
| | | |
| | | .item-top { |
| | | display: flex; |
| | | |
| | | border-radius: 9px; |
| | | box-shadow: none; |
| | | border: none; |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | |
| | | &:hover { |
| | | background: rgba(242, 246, 250, 0.15); |
| | | } |
| | | |
| | | .item-left { |
| | | margin-right: 20px; |
| | | |
| | | .top-icon { |
| | | width: 50px; |
| | | height: 50px; |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .top-right { |
| | | margin-left: 12px; |
| | | |
| | | .right-name { |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | font-family: OPPOSans-Bold; |
| | | .unit { |
| | | margin-left: 2px; |
| | | font-size: 16px; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | |
| | | .right-value { |
| | | font-weight: 800; |
| | | font-size: 25px; |
| | | margin-top: 10px; |
| | | font-family: OPPOSans-Medium; |
| | | |
| | | .unit { |
| | | margin-left: 5px; |
| | | font-size: 16px; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | width: 73px; |
| | | height: 73px; |
| | | background-size: 40px; |
| | | background-repeat: no-repeat; |
| | | background-position: center; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | |
| | | .item-bottom { |
| | | |
| | | .item-right { |
| | | flex: 1; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 18px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | flex-direction: column; |
| | | |
| | | .top-right { |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .right-name { |
| | | font-weight: 400; |
| | | font-size: 14px; |
| | | font-family: OPPOSans-Regular; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | letter-spacing: 0.5px; |
| | | margin-bottom: 4px; |
| | | |
| | | .unit { |
| | | color: rgba(255, 255, 255, 0.65); |
| | | margin-left: 4px; |
| | | font-size: 12px; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | |
| | | .right-value { |
| | | font-weight: 500; |
| | | font-size: 26px; |
| | | margin-top: 6px; |
| | | font-family: OPPOSans-Medium; |
| | | color: #fff; |
| | | line-height: 1.2; |
| | | letter-spacing: 0.5px; |
| | | } |
| | | } |
| | | |
| | | .item-bottom { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 18px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: normal; |
| | | font-size: 12px; |
| | | color: rgba(255, 255, 255, 0.5); |
| | | line-height: 1.2; |
| | | |
| | | .bottom-left, .bottom-right { |
| | | display: flex; |
| | | align-items: center; |
| | | letter-spacing: 0.3px; |
| | | |
| | | :deep(.el-icon) { |
| | | margin-left: 6px; |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .page-main { |
| | | margin-top: 23px; |
| | | margin-top: 20px; |
| | | |
| | | .el-card { |
| | | background-color: #0E2E5E; |
| | | border: none; |
| | | border-radius: 6px; |
| | | |
| | | :deep(.el-card__body) { |
| | | padding: 12px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .top-header { |
| | | margin-top: 12px; |
| | | height: 32px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | | color: rgba(255, 255, 255, 0.8); |
| | | border-bottom: 1px solid rgba(255, 255, 255, 0.2); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 10px; |
| | | |
| | | .header-left { |
| | | display: flex; |
| | | |
| | | .name { |
| | | margin-left: 7px; |
| | | margin-right: 7px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .top-header { |
| | | margin-top: 15px; |
| | | height: 23px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | | color: rgba(196, 213, 255, 0.6); |
| | | border-bottom: 1px solid rgba(196, 213, 255, 0.6); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .header-left { |
| | | display: flex; |
| | | |
| | | .name { |
| | | margin-left: 7px; |
| | | margin-right: 7px; |
| | | } |
| | | :deep(.el-button--primary) { |
| | | background-color: #1976D2; |
| | | border-color: #1976D2; |
| | | } |
| | | |
| | | :deep(.el-card__header) { |
| | | padding: 10px 15px; |
| | | border-bottom: 1px solid rgba(255, 255, 255, 0.1); |
| | | } |
| | | |
| | | :deep(.el-tabs--card > .el-tabs__header .el-tabs__item) { |
| | | border-color: rgba(255, 255, 255, 0.1); |
| | | background-color: transparent; |
| | | color: #fff; |
| | | |
| | | &.is-active { |
| | | background-color: #1976D2; |
| | | border-color: #1976D2; |
| | | } |
| | | } |
| | | |
| | | :deep(.el-tabs--card > .el-tabs__header) { |
| | | border-color: rgba(255, 255, 255, 0.1); |
| | | } |
| | | } |
| | | |
| | | .themeLight { |
| | | .page { |
| | | padding: 20px; |
| | | background: #f7f8fa; |
| | | background: #fff; |
| | | |
| | | .card-title { |
| | | width: 132px; |
| | | height: 29px; |
| | | font-weight: bold; |
| | | font-size: 22px; |
| | | color: #ffffff; |
| | | color: #333; |
| | | } |
| | | |
| | | .card-list { |
| | | width: 100%; |
| | | margin-top: 14px; |
| | | display: flex; |
| | | // justify-content: space-between; |
| | | align-items: center; |
| | | background-image: url("@/assets/images/home/index-card-bg2.png"); |
| | | background-size: 100% 100%; |
| | | flex-wrap: wrap; |
| | | border-radius: 20px; |
| | | |
| | | width: 100%; |
| | | flex-wrap: nowrap; |
| | | justify-content: space-between; |
| | | gap: 15px; |
| | | |
| | | &:after { |
| | | content: ""; |
| | | flex: 0 0 0; |
| | | } |
| | | |
| | | .card-list-item { |
| | | width: 19%; |
| | | margin-right: 0.5%; |
| | | height: 157px; |
| | | background-size: 100% 100%; |
| | | width: 0; |
| | | flex: 1 1 320px; |
| | | max-width: 320px; |
| | | height: 135px; |
| | | background: #fff; |
| | | box-sizing: border-box; |
| | | padding: 25px 18px 12px 16px; |
| | | color: #fff; |
| | | |
| | | .item-top { |
| | | display: flex; |
| | | |
| | | padding: 16px; |
| | | color: #333; |
| | | border-radius: 9px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | |
| | | .item-left { |
| | | margin-right: 20px; |
| | | |
| | | .top-icon { |
| | | width: 69px; |
| | | height: 69px; |
| | | background-size: 100% 100%; |
| | | width: 73px; |
| | | height: 73px; |
| | | background-size: 40px; |
| | | background-repeat: no-repeat; |
| | | background-position: center; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | } |
| | | |
| | | .item-right { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .top-right { |
| | | margin-left: 16px; |
| | | |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .right-name { |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | font-family: OPPOSans-Bold; |
| | | } |
| | | |
| | | .right-value { |
| | | font-weight: 800; |
| | | font-size: 30px; |
| | | margin-top: 10px; |
| | | font-family: OPPOSans-Medium; |
| | | |
| | | font-weight: 400; |
| | | font-size: 14px; |
| | | font-family: OPPOSans-Regular; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | letter-spacing: 0.5px; |
| | | margin-bottom: 4px; |
| | | |
| | | .unit { |
| | | margin-left: 5px; |
| | | font-size: 16px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | margin-left: 4px; |
| | | font-size: 12px; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | |
| | | .right-value { |
| | | font-weight: 500; |
| | | font-size: 26px; |
| | | margin-top: 6px; |
| | | font-family: OPPOSans-Medium; |
| | | color: #333; |
| | | line-height: 1.2; |
| | | letter-spacing: 0.5px; |
| | | } |
| | | } |
| | | |
| | | .item-bottom { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 18px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: normal; |
| | | font-size: 12px; |
| | | color: rgba(0, 0, 0, 0.5); |
| | | line-height: 1.2; |
| | | |
| | | .bottom-left, .bottom-right { |
| | | display: flex; |
| | | align-items: center; |
| | | letter-spacing: 0.3px; |
| | | |
| | | :deep(.el-icon) { |
| | | margin-left: 6px; |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .item-bottom { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 18px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | |
| | | .line { |
| | | width: 1px; |
| | | height: 64px; |
| | | background-image: url("@/assets/images/home/line@2x.png"); |
| | | background-size: 100% 100%; |
| | | } |
| | | } |
| | | |
| | | .page-main { |
| | | margin-top: 23px; |
| | | margin-top: 20px; |
| | | |
| | | .el-card { |
| | | background-color: #fff; |
| | | border: none; |
| | | border-radius: 6px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); |
| | | |
| | | :deep(.el-card__body) { |
| | | padding: 12px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .top-header { |
| | | margin-top: 12px; |
| | | height: 32px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | | color: rgba(0, 0, 0, 0.6); |
| | | border-bottom: 1px solid rgba(0, 0, 0, 0.1); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 10px; |
| | | |
| | | .header-left { |
| | | display: flex; |
| | | |
| | | .name { |
| | | margin-left: 7px; |
| | | margin-right: 7px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .top-header { |
| | | margin-top: 15px; |
| | | height: 23px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | | color: rgba(29, 29, 29, 0.6); |
| | | border-bottom: 1px solid rgba(196, 213, 255, 0.6); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .header-left { |
| | | display: flex; |
| | | |
| | | .name { |
| | | margin-left: 7px; |
| | | margin-right: 7px; |
| | | } |
| | | :deep(.el-button--primary) { |
| | | background-color: #1976D2; |
| | | border-color: #1976D2; |
| | | } |
| | | |
| | | :deep(.el-card__header) { |
| | | padding: 10px 15px; |
| | | border-bottom: 1px solid rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | :deep(.el-tabs--card > .el-tabs__header .el-tabs__item) { |
| | | border-color: rgba(0, 0, 0, 0.1); |
| | | |
| | | &.is-active { |
| | | background-color: #1976D2; |
| | | border-color: #1976D2; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | :deep(.el-tabs--card > .el-tabs__header) { |
| | | border-color: rgba(0, 0, 0, 0.1); |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chart-box"> |
| | | <div id="ChartDom" style="width: 100%; height: 100%"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import * as echarts from "echarts" |
| | | const { proxy } = getCurrentInstance() |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | const emit = defineEmits() |
| | | const props = defineProps({ |
| | | chartData: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }) |
| | | |
| | | watch( |
| | | () => props.chartData, |
| | | (val) => { |
| | | console.log("watch", val) |
| | | initChart() |
| | | } |
| | | ) |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | initChart() |
| | | } |
| | | ) |
| | | |
| | | onMounted(() => { |
| | | initChart() |
| | | }) |
| | | |
| | | function initChart(value) { |
| | | const chartDom = document.getElementById("ChartDom") |
| | | if (echarts.getInstanceByDom(chartDom)) { |
| | | echarts.dispose(chartDom) |
| | | } |
| | | const myChart = echarts.init(chartDom) |
| | | let option = { |
| | | title: { |
| | | text: props.chartData.title, |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | | }, |
| | | }, |
| | | color: ["#40c2ff", "#2979ff", "#ff9900", "#fa3534"], |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "60", |
| | | left: "50", |
| | | right: "40", |
| | | bottom: "20", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: "category", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [5, 0, 0, 0], |
| | | // formatter: '{value} ml' |
| | | }, |
| | | data: props.chartData.xData, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | nameTextStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: props.chartData.title, |
| | | type: "bar", |
| | | barWidth: "16", |
| | | // tooltip: { |
| | | // valueFormatter: function (value) { |
| | | // return value + "tce" |
| | | // }, |
| | | // }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: props.chartData.yData, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | setTimeout(() => { |
| | | myChart.setOption(option) |
| | | }, 200) |
| | | |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chart-box { |
| | | width: 100%; |
| | | height: 400px; |
| | | border: 1px solid #eaeaea; |
| | | margin-top: 20px; |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <!-- <el-form-item label="éç¹è®¾å¤" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©éç¹è®¾å¤"> |
| | | <el-option :label="item.name" :value="item.id" v-for="item in facilityList" :key="item.id" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" |
| | | style="width: 100%" |
| | | :clearable="false" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 24" :key="index" :label="index - 1 + 'æ¶'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index - 1}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const facilityList = ref([]) |
| | | function getEquip() { |
| | | keyEquipmentApi.getPointFacility().then((res) => { |
| | | facilityList.value = res.data |
| | | }) |
| | | } |
| | | getEquip() |
| | | |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .dailyList({ |
| | | ...queryParams.value, |
| | | timeType: "HOUR", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | queryParams.value.timeType = "HOUR" |
| | | keyEquipmentApi.dailyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¶") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month + "-" + date |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/monthlyComprehensive/monthlyComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | timeType: "DAY", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .monthlyList({ |
| | | ...queryParams.value, |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | keyEquipmentApi.monthlyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¥") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "DAY", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="year" |
| | | :clearable="false" |
| | | value-format="YYYY" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 12" :key="index" :label="index + 'æ'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/yearComprehensive/yearComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "2025-01-0", |
| | | timeType: "MONTH", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .yearList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | keyEquipmentApi |
| | | .yearChart({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "" |
| | | } |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "MONTH", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | |
| | | getTime() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
| | |
| | | .login { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 100%; |
| | | background-image: url("@/assets/images/login-background.jpg"); |
| | | height: 100vh; |
| | | background-image: url("@/assets/images/login-background.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | flex-direction: column; |
| | | position: relative; |
| | | min-width: 700px; |
| | | min-height: 700px; |
| | | background-color:#001146 |
| | | } |
| | | |
| | | .middle-view { |
| | |
| | | <div class="page-box"> |
| | | <div class="form-card"> |
| | | <el-form :model="form" ref="queryRef" :inline="true" label-width="70px"> |
| | | <el-form-item label="ç¼ç " prop="indexCategory"> |
| | | <el-form-item label="ææ åç±»" prop="indexCategory"> |
| | | <el-select v-model="form.indexCategory" placeholder="è¯·éæ©ææ åç±»" style="width: 200px"> |
| | | <el-option v-for="dict in sys_index_category" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id |
| | | queryParams.value.nodeName = data.label |
| | | handleTimeType(period.value[1].value) |
| | | handleTimeType("MONTH") |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | |
| | | function handleTimeType(e) { |
| | | queryParams.value.timeType = e |
| | | if (e == "MONTH") { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } else if (e == "YEAR") { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } else { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } |
| | | } |
| | | function handleEnergyType(item) { |
| | |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | timeCode: queryParams.value.dataTime, |
| | | }) |
| | | ).then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id |
| | | queryParams.value.nodeName = data.label |
| | | handleTimeType(period.value[1].value) |
| | | handleTimeType("MONTH") |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | |
| | | function handleTimeType(e) { |
| | | queryParams.value.timeType = e |
| | | if (e == "MONTH") { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } else if (e == "YEAR") { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } else { |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | queryParams.value.dataTime = proxy.dayjs(new Date()).format("YYYY-MM-DD") |
| | | } |
| | | } |
| | | function handleEnergyType(item) { |
| | |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | timeCode: queryParams.value.dataTime, |
| | | }) |
| | | ).then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | |
| | | // è½è对æ¯åæ-éç½® |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef") |
| | | handleTimeType(period.value[1].value) |
| | | queryParams.value.energyType = energyTypeList.value[0].enersno |
| | | queryParams.value.enername = energyTypeList.value[0].enername |
| | | queryParams.value.muid = energyTypeList.value[0].muid |
| | | queryParams.value.analysisType = "MOM" |
| | | handleTimeType(period.value[1].value) |
| | | handleQuery() |
| | | } |
| | | // è½è对æ¯åæ-å¯¼åº |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chart-box"> |
| | | <div id="ChartDom" style="width: 100%; height: 100%"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import * as echarts from "echarts" |
| | | const { proxy } = getCurrentInstance() |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | const emit = defineEmits() |
| | | const props = defineProps({ |
| | | chartData: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }) |
| | | |
| | | watch( |
| | | () => props.chartData, |
| | | (val) => { |
| | | console.log("watch", val) |
| | | initChart() |
| | | } |
| | | ) |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | initChart() |
| | | } |
| | | ) |
| | | |
| | | onMounted(() => { |
| | | initChart() |
| | | }) |
| | | |
| | | function initChart(value) { |
| | | const chartDom = document.getElementById("ChartDom") |
| | | if (echarts.getInstanceByDom(chartDom)) { |
| | | echarts.dispose(chartDom) |
| | | } |
| | | const myChart = echarts.init(chartDom) |
| | | let option = { |
| | | title: { |
| | | text: props.chartData.title, |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | | }, |
| | | }, |
| | | color: ["#40c2ff", "#2979ff", "#ff9900", "#fa3534"], |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "60", |
| | | left: "50", |
| | | right: "40", |
| | | bottom: "20", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: "category", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [5, 0, 0, 0], |
| | | // formatter: '{value} ml' |
| | | }, |
| | | data: props.chartData.xData, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | nameTextStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: props.chartData.title, |
| | | type: "bar", |
| | | barWidth: "16", |
| | | // tooltip: { |
| | | // valueFormatter: function (value) { |
| | | // return value + "tce" |
| | | // }, |
| | | // }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: props.chartData.yData, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | setTimeout(() => { |
| | | myChart.setOption(option) |
| | | }, 200) |
| | | |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chart-box { |
| | | width: 100%; |
| | | height: 400px; |
| | | border: 1px solid #eaeaea; |
| | | margin-top: 20px; |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" |
| | | style="width: 100%" |
| | | :clearable="false" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 24" :key="index" :label="index - 1 + 'æ¶'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index - 1}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .dailyList({ |
| | | ...queryParams.value, |
| | | timeType: "HOUR", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | queryParams.value.timeType = "HOUR" |
| | | processApi.dailyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¶") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month + "-" + date |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/monthlyComprehensive/monthlyComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | timeType: "DAY", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .monthlyList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .monthlyChart({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¥") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month |
| | | console.log(queryParams.value.dataTime) |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "DAY", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="year" |
| | | :clearable="false" |
| | | value-format="YYYY" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName || "--" }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 12" :key="index" :label="index + 'æ'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/yearComprehensive/yearComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "2025-01-01", |
| | | timeType: "MONTH", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .yearList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .yearChart({ |
| | | ...queryParams.value, |
| | | // dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "" |
| | | } |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "MONTH", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | |
| | | getTime() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <!-- æ·»å æ 颿 --> |
| | | <div class="page-title"> |
| | | <div class="title-bar"> |
| | | <span class="title-text">ç½å
³ç¶æçæµ</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="table-box"> |
| | | <div class="border"> |
| | | <div class="table" v-for="(item, index) in dataList" :key="index"> |
| | | <div class="num"> |
| | | <div class="li name">{{ item.name }}</div> |
| | | <div class="firstLi"> |
| | | <div :class="item.list.length < 16 ? 'li hasRightLine' : 'li'" v-for="(i, inde) in item.list" :key="inde"> |
| | | <div class="title_num" v-if="i.title_num">{{ i.title_num }}</div> |
| | | <div class="dot" v-if="i.dot && i.dot.length > 0"> |
| | | <div class="dot_li" v-for="(j, ind) in 3" :key="ind"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | let dataList = ref([ |
| | | { |
| | | name: "ç½å
³", |
| | | list: [ |
| | | { |
| | | id: 1, |
| | | title_num: "æ°æ®åº", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 2, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 3, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 4, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 5, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 6, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 7, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 8, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 9, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 10, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 11, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 12, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 13, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 14, |
| | | title_num: "200461", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 15, |
| | | title_num: "200475", |
| | | dot: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: "计ç®å¨å
·", |
| | | list: [ |
| | | { |
| | | id: 1, |
| | | title_num: "", |
| | | dot: [ |
| | | { |
| | | id: "001", |
| | | dot_li: "", |
| | | }, |
| | | { |
| | | id: "002", |
| | | dot_li: "", |
| | | }, |
| | | { |
| | | id: "003", |
| | | dot_li: "", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 2, |
| | | title_num: "", |
| | | dot: [ |
| | | { |
| | | id: "001", |
| | | dot_li: "", |
| | | }, |
| | | { |
| | | id: "002", |
| | | dot_li: "", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 3, |
| | | title_num: "", |
| | | dot: [ |
| | | { |
| | | id: "001", |
| | | dot_li: "", |
| | | }, |
| | | { |
| | | id: "002", |
| | | dot_li: "", |
| | | }, |
| | | { |
| | | id: "003", |
| | | dot_li: "", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: "ç½å
³", |
| | | list: [ |
| | | { |
| | | id: 1, |
| | | title_num: "æ°æ®åº", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 2, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 3, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | { |
| | | id: 4, |
| | | title_num: "200311", |
| | | dot: [], |
| | | }, |
| | | ], |
| | | } |
| | | ]) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .page { |
| | | background: #08234F; |
| | | } |
| | | |
| | | // æ 颿 ·å¼ |
| | | .page-title { |
| | | margin: 0 16px 16px; |
| | | position: relative; |
| | | |
| | | .title-bar { |
| | | position: relative; |
| | | padding: 14px 0; |
| | | padding-left: 16px; |
| | | |
| | | .title-text { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | position: relative; |
| | | padding-left: 12px; |
| | | color: #fff; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 5px; |
| | | height: 18px; |
| | | background-color: #3883FA; |
| | | border-radius: 2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | &::after { |
| | | content: ''; |
| | | position: absolute; |
| | | bottom: -10px; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 1px; |
| | | background-color: #E6E6E6; |
| | | } |
| | | } |
| | | |
| | | .themeDark { |
| | | .table-box { |
| | | margin: 10px 25px; |
| | | .border { |
| | | border: 1px solid #22408c; |
| | | border-radius: 8px; |
| | | background: #1a235d; |
| | | padding: 10px 0; |
| | | .table { |
| | | margin: 15px; |
| | | // border: 1px solid #22408c; |
| | | .num { |
| | | height: 56px; |
| | | display: flex; |
| | | } |
| | | .li { |
| | | height: 56px; |
| | | padding: 0 10px; |
| | | min-width: 60px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-evenly; |
| | | align-items: center; |
| | | border-top: 1px solid #22408c; |
| | | border-left: 1px solid #22408c; |
| | | border-bottom: 1px solid #22408c; |
| | | position: relative; |
| | | } |
| | | .hasRightLine { |
| | | border-right: 1px solid #22408c; |
| | | } |
| | | .name { |
| | | width: 80px; |
| | | background: #1a235d; |
| | | color: rgba(255, 255, 255, 0.8); |
| | | text-align: center; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | } |
| | | .title_num { |
| | | color: #eeeeee; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | } |
| | | .dot { |
| | | display: flex; |
| | | flex-direction: column; |
| | | // justify-content: space-evenly; |
| | | height: 30px; |
| | | width: 12px; |
| | | align-items: center; |
| | | } |
| | | .dot_li { |
| | | height: 8px; |
| | | width: 8px; |
| | | margin: 2px 0; |
| | | background: red; |
| | | border-radius: 50%; |
| | | } |
| | | .firstLi { |
| | | display: flex; |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .themeLight { |
| | | .table-box { |
| | | margin: 10px 25px; |
| | | .border { |
| | | border: 1px solid #ebebeb; |
| | | border-radius: 8px; |
| | | background: #fff; |
| | | padding: 10px 0; |
| | | .table { |
| | | margin: 15px; |
| | | // border: 1px solid #22408c; |
| | | .num { |
| | | height: 56px; |
| | | display: flex; |
| | | } |
| | | .li { |
| | | height: 56px; |
| | | padding: 0 10px; |
| | | min-width: 60px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-evenly; |
| | | align-items: center; |
| | | border-top: 1px solid #ebebeb; |
| | | border-left: 1px solid #ebebeb; |
| | | border-bottom: 1px solid #ebebeb; |
| | | position: relative; |
| | | } |
| | | .hasRightLine { |
| | | border-right: 1px solid #ebebeb; |
| | | } |
| | | .name { |
| | | width: 80px; |
| | | background: #fff; |
| | | color: #0d0d0d; |
| | | text-align: center; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | } |
| | | .title_num { |
| | | color: #0d0d0d; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | } |
| | | .dot { |
| | | display: flex; |
| | | flex-direction: column; |
| | | // justify-content: space-evenly; |
| | | height: 30px; |
| | | width: 12px; |
| | | align-items: center; |
| | | } |
| | | .dot_li { |
| | | height: 8px; |
| | | width: 8px; |
| | | margin: 2px 0; |
| | | background: red; |
| | | border-radius: 50%; |
| | | } |
| | | .firstLi { |
| | | display: flex; |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <div class="page"> |
| | | <div class="page-container"> |
| | | <div class="page-container-left"> |
| | | <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" /> |
| | | <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" ParentModelCode="YSCJMX" /> |
| | | </div> |
| | | <div class="page-container-right"> |
| | | <div class="form-card"> |
| | |
| | | text-align: left; |
| | | font-weight: bold; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | |
| | | font-size: 14px; |
| | | font-style: normal; |
| | | text-transform: none; |
| | | } |
| | |
| | | .title { |
| | | color: rgba(255, 255, 255, 0.8); |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | |
| | | font-size: 14px; |
| | | line-height: 19px; |
| | | text-align: left; |
| | | font-style: normal; |
| | |
| | | } |
| | | |
| | | .num { |
| | | font-size: 24px; |
| | | font-size: 26px; |
| | | color: #36d3ff; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 800; |
| | |
| | | text-align: center; |
| | | margin: 5px 8px; |
| | | border-radius: 8px; |
| | | padding: 7px 10px; |
| | | padding: 2px 6px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | |
| | | } |
| | | |
| | | .num { |
| | | font-size: 24px; |
| | | font-size: 26px; |
| | | color: #3271eb; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 800; |
| | |
| | | text-align: center; |
| | | margin: 5px 8px; |
| | | border-radius: 8px; |
| | | padding: 7px 3px; |
| | | padding: 2px 6px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | |
| | | text-align: center; |
| | | margin: 2px 6px; |
| | | border-radius: 8px; |
| | | padding: 5px 10px; |
| | | padding: 2px 6px; |
| | | font-family: OPPOSans, OPPOSans; |
| | | font-weight: 500; |
| | | font-size: 14px; |
| | |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; |
| | | background-image: url("../assets/images/login-background.jpg"); |
| | | background-image: url("../assets/images/login-background.png"); |
| | | background-size: cover; |
| | | } |
| | | .title { |
| | |
| | | <template> |
| | | <div class="app-container page"> |
| | | <div class="form-card"> |
| | | <el-form :model="form" label-width="80px"> |
| | | <el-row class="mb20 mt20"> |
| | | <el-col :offset="1" :span="18"> |
| | | <div class="app-container page name-settings-page"> |
| | | <div class="name-settings-card"> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-row class="form-row"> |
| | | <el-col :span="18"> |
| | | <el-form-item label="ç³»ç»åç§°" prop="systemName"> |
| | | <el-input v-model="form.systemName" placeholder="请è¾å
¥ç³»ç»åç§°" maxlength="64" show-word-limit /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="mb20 mt20"> |
| | | <el-col :offset="1" :span="18"> |
| | | <el-row class="form-row"> |
| | | <el-col :span="18"> |
| | | <el-form-item label="ç»å½logo" prop="homeLogo"> |
| | | <ImageUpload v-model="form.homeLogo" :fileType="['png']" :limit="1" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="mb20 mt20"> |
| | | <el-col :offset="1" :span="18"> |
| | | <el-row class="form-row"> |
| | | <el-col :span="18"> |
| | | <el-form-item label="åå°logo" prop="leftLogo"> |
| | | <ImageUpload v-model="form.leftLogo" :fileType="['png']" :limit="1" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="mb20 mt20"> |
| | | <el-col :offset="1" :span="18"> |
| | | <el-row class="form-row"> |
| | | <el-col :span="18"> |
| | | <el-form-item label="copyRight" prop="copyRight"> |
| | | <el-input |
| | | v-model="form.copyRight" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="mb20 mt20" style="padding-bottom: 20px"> |
| | | <el-col :offset="2" :span="18"> |
| | | <el-button type="primary" @click="handleSave">ä¿å</el-button> |
| | | <el-row class="form-row form-footer"> |
| | | <el-col :span="18"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleSave">ä¿å</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | |
| | | } |
| | | getSystemName() |
| | | function handleSave() { |
| | | if (!form.value.leftLogo || !form.value.homeLogo) { |
| | | proxy.$modal.msgError("请ä¸ä¼ logo") |
| | | return |
| | | } |
| | | |
| | | if (!form.value.leftLogo.includes(baseUrl)) { |
| | | form.value.leftLogo = baseUrl + form.value.leftLogo |
| | | } |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | :deep .avatar-uploader .el-upload { |
| | | |
| | | .name-settings-page { |
| | | height: 100%; |
| | | min-height: calc(100vh - 60px); |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .name-settings-card { |
| | | |
| | | border-radius: 4px; |
| | | margin: 16px; |
| | | padding: 24px; |
| | | flex: 1; |
| | | height: calc(100vh - 100px); |
| | | overflow-y: auto; |
| | | |
| | | .el-form { |
| | | width: 100%; |
| | | |
| | | .form-row { |
| | | margin-bottom: 24px; |
| | | |
| | | &.form-footer { |
| | | margin-top: 40px; |
| | | } |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | |
| | | .el-form-item__label { |
| | | color: var(--el-text-color-primary, #fff); |
| | | } |
| | | |
| | | .el-form-item__content { |
| | | .el-button { |
| | | padding: 10px 24px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | :deep(.avatar-uploader .el-upload) { |
| | | border: 1px dashed var(--el-border-color); |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | |
| | | transition: var(--el-transition-duration-fast); |
| | | } |
| | | |
| | | :deep .avatar-uploader .el-upload:hover { |
| | | :deep(.avatar-uploader .el-upload:hover) { |
| | | border-color: var(--el-color-primary); |
| | | } |
| | | |
| | | :deep .el-icon.avatar-uploader-icon { |
| | | :deep(.el-icon.avatar-uploader-icon) { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 178px; |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="app-container user-profile-container"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6" :xs="24"> |
| | | <el-card class="box-card"> |
| | |
| | | "/dev-api": { |
| | | target: "http://localhost:8080", |
| | | changeOrigin: true, |
| | | rewrite: (p) => p.replace(/^\/dev-api/, ""), |
| | | rewrite: (p) => p.replace(/^\/dev-api/, "/"), |
| | | }, |
| | | "/prod-api": { |
| | | target: "http://localhost:8080", |
| | | changeOrigin: true, |
| | | secure: true, |
| | | }, |
| | | }, |
| | | }, |