Merge branch 'develop1.0' into develop_alioo
已添加18个文件
已删除1个文件
已修改15个文件
| | |
| | | |
| | | ###################################################################### |
| | | # IDE |
| | | .DS_Store |
| | | /.DS_Store |
| | | zhitan-admin/.DS_Store |
| | | zhitan-admin/src/.DS_Store |
| | | zhitan-system/.DS_Store |
| | | zhitan-system/src/.DS_Store |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | |
| | | !*/build/*.html |
| | | !*/build/*.xml |
| | | |
| | | */.DS_Store |
| | | |
| | | uploadPath |
| | |
| | | The MIT License (MIT) |
| | | Apache License |
| | | Version 2.0, January 2004 |
| | | http://www.apache.org/licenses/ |
| | | |
| | | Copyright (c) 2018 admin |
| | | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy of |
| | | this software and associated documentation files (the "Software"), to deal in |
| | | the Software without restriction, including without limitation the rights to |
| | | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| | | the Software, and to permit persons to whom the Software is furnished to do so, |
| | | subject to the following conditions: |
| | | 1. Definitions. |
| | | |
| | | The above copyright notice and this permission notice shall be included in all |
| | | copies or substantial portions of the Software. |
| | | "License" shall mean the terms and conditions for use, reproduction, |
| | | and distribution as defined by Sections 1 through 9 of this document. |
| | | |
| | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | | "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. |
| | | |
| | | 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 |
| | | |
| | | (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 |
| | | |
| | | (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. |
| | | |
| | | 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. |
| | | |
| | | 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. |
| | | |
| | | 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. |
| | | |
| | | END OF TERMS AND CONDITIONS |
| | | |
| | | APPENDIX: How to apply the Apache License to your work. |
| | | |
| | | 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. |
| | | |
| | | 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. |
| | |
| | | <div align="center"> |
| | | <img src="readme/logo-chinese.png" alt="è¾å
¥å¾ç说æ" height="150" width="150"> |
| | | </div> |
| | | <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">æºç¢³è½æºç®¡çç³»ç»</h1> |
| | | <h4 align="center">åºäºSpringBootåè¥ä¾æ¡æ¶å¼å</h4> |
| | | <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/y_project/RuoYi/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a> |
| | | </p> |
| | | |
| | | ## ä»ç» |
| | | éè¿ç©èç½ææ¯ï¼ééä¼ä¸æ°´ãçµãæ°ãççè½èæ°æ®ï¼å¸®ä¼ä¸å»ºç«è½æºç®¡çä½ç³»ï¼æ¾å°è·åæ»´æ¼ï¼ä»è为ä¼ä¸èè½æä¾ä¾æ®ã |
| | | è¿ä¸æ¥ä¸ºä¼ä¸å®ç°ç¢³è·è¸ªãç¢³çæ¥ã碳交æãè°æ±æ¥çå
¨çå½è¿ç¨ã 为ä¸å½ç¢³è¾¾å³°-碳ä¸åååºè´¡ç®ã |
| | | è½æºç®¡çç³»ç»ï¼ééä¼ä¸æ°´ãçµãæ°ãççè½èæ°æ®ï¼å¸®ä¼ä¸å»ºç«è½æºç®¡çä½ç³»ï¼æ¾å°è·åæ»´æ¼ï¼ä»è为ä¼ä¸èè½æä¾ä¾æ®ã |
| | | è¿ä¸æ¥ä¸ºä¼ä¸å®ç°ç¢³è·è¸ªãç¢³çæ¥ã碳交æãç¢³æ±æ¥çå
¨çå½è¿ç¨ã 为ä¸å½ç¢³è¾¾å³°-碳ä¸åååºè´¡ç®ã |
| | | |
| | | é对客æ·åºæ¯ï¼æ¿åºãååºãä¼ä¸ãå·¥ç¿ãå
Œ
±å»ºççã |
| | | |
| | | |
| | | å¢å
ä»åºå°åï¼ç äºï¼ï¼https://gitee.com/ustcyc/zhitan-ems |
| | | |
| | | |
| | | å·²åæ¥æ´æ°å°githubä»åºï¼https://github.com/Andy-Yin/zhitan-ems |
| | | |
| | | |
| | | ## å¨çº¿ä½éª |
| | | |
| | | - guestUser/guest@123456 |
| | | |
| | | æ¼ç¤ºå°åï¼https://demo-ems.zhitancloud.com/ |
| | | |
| | | |
| | | ## æ¡æ¶ï¼ |
| | | |
| | | åºäºSpringBootçè¥ä¾æ¡æ¶ æè¯»ææãçé¢ç®æ´ç¾è§ã |
| | | å
³ç³»æ°æ®åºï¼mysql æè
postgredb |
| | | åºäºSpringBootçè¥ä¾æ¡æ¶ æè¯»ææãçé¢ç®æ´ç¾è§ãæ¯ææ·±è²&æµ
è²ä¸¤ç§é£æ ¼åæ¢ï¼æ¼ç¤ºç³»ç»å³ä¸è§ï¼ |
| | | å
³ç³»æ°æ®åºï¼postgresqlï¼mysqléèªè¡éé
ï¼mysqlæ§è½å¤ªå·®äºï¼ |
| | | æ¶åºæ°æ®åºï¼influxdb 2.7+ |
| | | ä¸é´ä»¶ï¼redisï¼mq |
| | | VUEçæ¬ï¼VUE 3 |
| | | |
| | | ## æ°æ®é©±å¨çè®¡ç®æ¨¡ååä¸å¡æ¨¡åé
ç½® |
| | | æ¯æå¨æç¹ä½é
ç½®ãæ°æ®æ¨¡åãä¸å¡æ¨¡åçã |
| | | ## ç¹è²ï¼æ°æ®é©±å¨çè®¡ç®æ¨¡ååä¸å¡æ¨¡åé
ç½® |
| | | 1. æ¯æå¨æç¹ä½é
ç½®ã |
| | |  |
| | | 2. æ¯æè®¡ç®å
¬å¼ã |
| | |  |
| | | 3. æ¯ææ¨¡åé
ç½®ãå
æ¬æ°æ®æ¨¡åãä¸å¡æ¨¡åã |
| | |  |
| | | 4. 夿项ç®åºå±ä»£ç &æ°æ®ç»æå®å
¨ä¸éè¦ååï¼å¯å¿«é交ä»å®æ½ã |
| | | 5. 已宿æ ååçç½å
³&çµè¡¨çéé设å¤å¯¹æ¥ï¼å¿«é为客æ·è½¯ç¡¬ä»¶ä¸ä½å交ä»ã |
| | | |
| | | ## å¨çº¿ä½éª |
| | | |
| | | - guestUser/guestUser |
| | | |
| | | æ¼ç¤ºå°åï¼https://demo-ems.zhitancloud.com/ |
| | | |
| | | ## 亮ç¹åè½ |
| | |  |
| | |
| | | 2. 宿¶æ°æ®çæµ |
| | | 2.1. 宿¶æ°æ®æ¥ç |
| | | 2.2. ç»æå¾åæï¼svg å¾ç»å®ï¼ |
| | | 3. å岿°æ®åæ |
| | | 3. åå²ç¹ä½åæ |
| | | 4. ç»¼åææ åæ |
| | | 4.1. ç»¼åææ åæï¼æ¥ï¼ |
| | | 4.2. ç»¼åææ åæï¼æï¼ |
| | |
| | | 8. è½è对æ¯åæï¼åè½æºåç§ï¼ |
| | | 8.1. çµåç¯æ¯åæ |
| | | 8.2. æ°´åç¯æ¯åæ |
| | | 8.3. å
¶ä»è½æºåç§åæ |
| | | 9. æºè½æ¥è¦ |
| | | 9.1. æ¥è¦åæ |
| | | 9.2. æ¥è¦é
ç½® |
| | |
| | |  |
| | |  |
| | | |
| | | ## æ²éäº¤æµ |
| | | |
| | | æ«ç æ·»å 微信交æµï¼å å¾®ä¿¡è¯·å¤æ³¨ï¼emsã |
| | | |
| | | <p align="center"> |
| | | <img src="readme/img/image.png" width=50% height=50%> |
| | | </p> |
| | | |
| | | |
| | | ## åä¸è´¡ç® |
| | | |
| | | 1. Fork æ¬ä»åº |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "zhitan-ems", |
| | | "lockfileVersion": 3, |
| | | "requires": true, |
| | | "packages": {} |
| | | } |
| | |
| | | package com.zhitan.web.controller.statisticalAnalysis; |
| | | |
| | | import com.zhitan.common.annotation.Log; |
| | | import com.zhitan.common.constant.CommonConst; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.dataitem.service.IDataItemService; |
| | | import com.zhitan.statisticalAnalysis.domain.dto.FlowChartsDTO; |
| | | import com.zhitan.statisticalAnalysis.domain.vo.QueryCompareRequest; |
| | | import com.zhitan.statisticalAnalysis.service.IEnergyConsumeDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IDataItemService dataItemService; |
| | | |
| | | @Autowired |
| | | private IEnergyConsumeDataService energyConsumeDataService; |
| | | |
| | | /** |
| | | * è·åè½æµå¾å½¢åæ |
| | | * |
| | |
| | | public AjaxResult getFlowCharts(@Validated FlowChartsDTO dto) { |
| | | return AjaxResult.success(dataItemService.getFlowCharts(dto)); |
| | | } |
| | | |
| | | @Log(title = "è½èç»è®¡åæ-è·å忝åæåè¡¨æ°æ®") |
| | | @ApiOperation(value = "è½èç»è®¡åæ-è·å忝åæåè¡¨æ°æ®", notes = "è½èç»è®¡åæ-è·å忝åæåè¡¨æ°æ®") |
| | | @GetMapping(value = "/querySameCompareList") |
| | | public AjaxResult querySameCompareList(@Validated QueryCompareRequest queryCompareRequest) { |
| | | return AjaxResult.success(energyConsumeDataService.listEnergyTypeYoyInfo(queryCompareRequest, CommonConst.ENERGY_COMPARISON_YOY)); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¯æ¯åææ°æ® |
| | | * <p> |
| | | * éè¿èªå·±çæå¡è®¿é®å°åï¼http://localhost:7005/fengniao/energyDataItem/queryLoopCompare?timeType=1 |
| | | * éè¿ç½å
³è®¿é®å°åï¼http://localhost:9999/jeecg-fengniao/fengniao/energyDataItem/queryLoopCompare?timeType=1 |
| | | * |
| | | * @param queryCompareRequest |
| | | * @return |
| | | */ |
| | | @Log(title = "è½èç»è®¡åæ-è·åç¯æ¯åæåè¡¨æ°æ®") |
| | | @ApiOperation(value = "è½èç»è®¡åæ-è·åç¯æ¯åæåè¡¨æ°æ®", notes = "è½èç»è®¡åæ-è·åç¯æ¯åæåè¡¨æ°æ®") |
| | | @GetMapping(value = "/queryLoopCompareList") |
| | | public AjaxResult queryLoopCompareList(@Validated QueryCompareRequest queryCompareRequest) { |
| | | |
| | | return AjaxResult.success(energyConsumeDataService.listEnergyTypeYoyInfo(queryCompareRequest, CommonConst.ENERGY_COMPARISON_MOM)); |
| | | } |
| | | } |
| | |
| | | // ç¨ApiInfoBuilderè¿è¡å®å¶ |
| | | return new ApiInfoBuilder() |
| | | // 设置æ é¢ |
| | | .title("æ é¢:åå°ç®¡çç³»ç»_æ¥å£ææ¡£") |
| | | .title("æºç¢³_è½æºç®¡çç³»ç»_æ¥å£ææ¡£") |
| | | // æè¿° |
| | | .description("æè¿°:æ¥å£ææ¡£") |
| | | .description("ééä¼ä¸æ°´ãçµãæ°ãççè½èæ°æ®ï¼å¸®å©ä¼ä¸å»ºç«è½æºç®¡çä½ç³»ï¼æ¾å°è·åæ»´æ¼ï¼ä¸ºä¼ä¸èè½æä¾æ°æ®æ¯æï¼ä¸ºä¼ä¸å®ç°ç¢³è·è¸ªãç¢³çæ¥ã碳交æãç¢³æ±æ¥çå
¨çå½è¿ç¨ï¼ä¸ºä¸å½ç¢³è¾¾å³°-碳ä¸åååºè´¡ç®ï¼") |
| | | // ä½è
ä¿¡æ¯ |
| | | .contact(new Contact(baseConfig.getName(), null, null)) |
| | | .contact(new Contact(baseConfig.getName(), "https://www.zhitancloud.com", "yin.cun@qq.com")) |
| | | // çæ¬ |
| | | .version("çæ¬å·:" + baseConfig.getVersion()) |
| | | .build(); |
| | |
| | | |
| | | /** |
| | | * 读å项ç®ç¸å
³é
ç½® |
| | | * |
| | | * |
| | | * @author zhitan |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "base") |
| | | public class BaseConfig |
| | | { |
| | | /** 项ç®åç§° */ |
| | | public class BaseConfig { |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** çæ¬ */ |
| | | /** |
| | | * çæ¬ |
| | | */ |
| | | private String version; |
| | | |
| | | /** çæå¹´ä»½ */ |
| | | /** |
| | | * çæå¹´ä»½ |
| | | */ |
| | | private String copyrightYear; |
| | | |
| | | /** ä¸ä¼ è·¯å¾ */ |
| | | /** |
| | | * ä¸ä¼ è·¯å¾ |
| | | */ |
| | | private static String profile; |
| | | |
| | | /** è·åå°åå¼å
³ */ |
| | | /** |
| | | * è·åå°åå¼å
³ |
| | | */ |
| | | private static boolean addressEnabled; |
| | | |
| | | /** éªè¯ç ç±»å */ |
| | | /** |
| | | * éªè¯ç ç±»å |
| | | */ |
| | | private static String captchaType; |
| | | |
| | | /** |
| | |
| | | private String domainName; |
| | | |
| | | |
| | | public String getName() |
| | | { |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) |
| | | { |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getVersion() |
| | | { |
| | | public String getVersion() { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) |
| | | { |
| | | public void setVersion(String version) { |
| | | this.version = version; |
| | | } |
| | | |
| | | public String getCopyrightYear() |
| | | { |
| | | public String getCopyrightYear() { |
| | | return copyrightYear; |
| | | } |
| | | |
| | | public void setCopyrightYear(String copyrightYear) |
| | | { |
| | | public void setCopyrightYear(String copyrightYear) { |
| | | this.copyrightYear = copyrightYear; |
| | | } |
| | | |
| | | public static String getProfile() |
| | | { |
| | | public static String getProfile() { |
| | | return profile; |
| | | } |
| | | |
| | | public void setProfile(String profile) |
| | | { |
| | | public void setProfile(String profile) { |
| | | BaseConfig.profile = profile; |
| | | } |
| | | |
| | | public static boolean isAddressEnabled() |
| | | { |
| | | public static boolean isAddressEnabled() { |
| | | return addressEnabled; |
| | | } |
| | | |
| | | public void setAddressEnabled(boolean addressEnabled) |
| | | { |
| | | public void setAddressEnabled(boolean addressEnabled) { |
| | | BaseConfig.addressEnabled = addressEnabled; |
| | | } |
| | | |
| | |
| | | /** |
| | | * è·å导å
¥ä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getImportPath() |
| | | { |
| | | public static String getImportPath() { |
| | | return getProfile() + "/import"; |
| | | } |
| | | |
| | | /** |
| | | * è·å头åä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getAvatarPath() |
| | | { |
| | | public static String getAvatarPath() { |
| | | return getProfile() + "/avatar"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸è½½è·¯å¾ |
| | | */ |
| | | public static String getDownloadPath() |
| | | { |
| | | public static String getDownloadPath() { |
| | | return getProfile() + "/download/"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getUploadPath() |
| | | { |
| | | public static String getUploadPath() { |
| | | return getProfile() + "/upload"; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 读å代ç çæç¸å
³é
ç½® |
| | | * |
| | | * |
| | | * @author zhitan |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "gen") |
| | | @PropertySource(value = { "classpath:generator.yml" }) |
| | | public class GenConfig |
| | | { |
| | | /** ä½è
*/ |
| | | @PropertySource(value = {"classpath:generator.yml"}) |
| | | public class GenConfig { |
| | | /** |
| | | * ä½è
|
| | | */ |
| | | public static String author; |
| | | |
| | | /** çæå
è·¯å¾ */ |
| | | /** |
| | | * çæå
è·¯å¾ |
| | | */ |
| | | public static String packageName; |
| | | |
| | | /** èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯false */ |
| | | /** |
| | | * èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯false |
| | | */ |
| | | public static boolean autoRemovePre; |
| | | |
| | | /** 表åç¼(ç±»åä¸ä¼å
å«è¡¨åç¼) */ |
| | | /** |
| | | * 表åç¼(ç±»åä¸ä¼å
å«è¡¨åç¼) |
| | | */ |
| | | public static String tablePrefix; |
| | | |
| | | public static String getAuthor() |
| | | { |
| | | public static String getAuthor() { |
| | | return author; |
| | | } |
| | | |
| | | @Value("${author}") |
| | | public void setAuthor(String author) |
| | | { |
| | | public void setAuthor(String author) { |
| | | GenConfig.author = author; |
| | | } |
| | | |
| | | public static String getPackageName() |
| | | { |
| | | public static String getPackageName() { |
| | | return packageName; |
| | | } |
| | | |
| | | @Value("${packageName}") |
| | | public void setPackageName(String packageName) |
| | | { |
| | | public void setPackageName(String packageName) { |
| | | GenConfig.packageName = packageName; |
| | | } |
| | | |
| | | public static boolean getAutoRemovePre() |
| | | { |
| | | public static boolean getAutoRemovePre() { |
| | | return autoRemovePre; |
| | | } |
| | | |
| | | @Value("${autoRemovePre}") |
| | | public void setAutoRemovePre(boolean autoRemovePre) |
| | | { |
| | | public void setAutoRemovePre(boolean autoRemovePre) { |
| | | GenConfig.autoRemovePre = autoRemovePre; |
| | | } |
| | | |
| | | public static String getTablePrefix() |
| | | { |
| | | public static String getTablePrefix() { |
| | | return tablePrefix; |
| | | } |
| | | |
| | | @Value("${tablePrefix}") |
| | | public void setTablePrefix(String tablePrefix) |
| | | { |
| | | public void setTablePrefix(String tablePrefix) { |
| | | GenConfig.tablePrefix = tablePrefix; |
| | | } |
| | | } |
| | |
| | | package com.zhitan.quartz.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.zhitan.quartz.domain.SysJob; |
| | | import com.zhitan.quartz.service.ISysJobService; |
| | | import com.zhitan.quartz.util.CronUtils; |
| | | import com.zhitan.quartz.util.ScheduleUtils; |
| | | import org.quartz.SchedulerException; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.zhitan.common.annotation.Log; |
| | | import com.zhitan.common.constant.Constants; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | |
| | | import com.zhitan.common.exception.job.TaskException; |
| | | import com.zhitan.common.utils.StringUtils; |
| | | import com.zhitan.common.utils.poi.ExcelUtil; |
| | | import com.zhitan.quartz.domain.SysJob; |
| | | import com.zhitan.quartz.service.ISysJobService; |
| | | import com.zhitan.quartz.util.CronUtils; |
| | | import com.zhitan.quartz.util.ScheduleUtils; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è°åº¦ä»»å¡ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * |
| | | * @author zhitan |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/job") |
| | | public class SysJobController extends BaseController |
| | | { |
| | | public class SysJobController extends BaseController { |
| | | @Resource |
| | | private ISysJobService jobService; |
| | | |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysJob sysJob) |
| | | { |
| | | public TableDataInfo list(SysJob sysJob) { |
| | | startPage(); |
| | | List<SysJob> list = jobService.selectJobList(sysJob); |
| | | return getDataTable(list); |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysJob sysJob) |
| | | { |
| | | public void export(HttpServletResponse response, SysJob sysJob) { |
| | | List<SysJob> list = jobService.selectJobList(sysJob); |
| | | ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class); |
| | | util.exportExcel(response, list, "宿¶ä»»å¡"); |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')") |
| | | @GetMapping(value = "/{jobId}") |
| | | public AjaxResult getInfo(@PathVariable("jobId") Long jobId) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("jobId") Long jobId) { |
| | | return success(jobService.selectJobById(jobId)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:add')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | | { |
| | | if (!CronUtils.isValid(job.getCronExpression())) |
| | | { |
| | | public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException { |
| | | if (!CronUtils.isValid(job.getCronExpression())) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®"); |
| | | } |
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) |
| | | { |
| | | } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§"); |
| | | } |
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) |
| | | { |
| | | } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) { |
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
"); |
| | | } |
| | | job.setCreateBy(getUsername()); |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:edit')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | | { |
| | | if (!CronUtils.isValid(job.getCronExpression())) |
| | | { |
| | | public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException { |
| | | if (!CronUtils.isValid(job.getCronExpression())) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®"); |
| | | } |
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) |
| | | { |
| | | } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) |
| | | { |
| | | } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§"); |
| | | } |
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) |
| | | { |
| | | } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) { |
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
"); |
| | | } |
| | | job.setUpdateBy(getUsername()); |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException { |
| | | SysJob newJob = jobService.selectJobById(job.getJobId()); |
| | | newJob.setStatus(job.getStatus()); |
| | | return toAjax(jobService.changeStatus(newJob)); |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/run") |
| | | public AjaxResult run(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | public AjaxResult run(@RequestBody SysJob job) throws SchedulerException { |
| | | boolean result = jobService.run(job); |
| | | return result ? success() : error("ä»»å¡ä¸åå¨æå·²è¿æï¼"); |
| | | } |
| | |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{jobIds}") |
| | | public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException |
| | | { |
| | | public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException { |
| | | jobService.deleteJobByIds(jobIds); |
| | | return success(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.statisticalAnalysis.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * åè½æºç±»åå¼åæ¯ãç¯æ¯VO |
| | | * |
| | | * @Author: Zhujw |
| | | * @Date: 2023/2/8 |
| | | */ |
| | | @Data |
| | | public class EnergyTypeValueContrastedVO { |
| | | |
| | | /** |
| | | * ç¨è½åå
åç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç¨è½åå
åç§°") |
| | | private String energyUnitName; |
| | | |
| | | /** |
| | | * è½æºç±»å |
| | | */ |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | |
| | | /** |
| | | * æ¬ææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ¬ææ¶é´") |
| | | private String currentTime; |
| | | |
| | | /** |
| | | * æ¬æå¼ |
| | | */ |
| | | @ApiModelProperty(value = "æ¬æå¼") |
| | | private BigDecimal currentValue; |
| | | |
| | | /** |
| | | * å¯¹æ¯æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å¯¹æ¯æ¶é´") |
| | | private String compareTime; |
| | | |
| | | /** |
| | | * 对æ¯å¼ |
| | | */ |
| | | @ApiModelProperty(value = "对æ¯å¼") |
| | | private BigDecimal contrastValues; |
| | | |
| | | /** |
| | | * åæ¯å¼ |
| | | * 忝å¢é¿ç=ï¼æ¬æå¼-å»å¹´åæå¼ï¼/å»å¹´åæå¼Ã100% |
| | | * ç¯æ¯å¼ |
| | | * ç¯æ¯å¢é¿ç=ï¼æ¬æå¼-䏿å¼ï¼/䏿å¼Ã100% |
| | | */ |
| | | @ApiModelProperty(value = "忝å¢é¿ç/ç¯æ¯å¢é¿ç") |
| | | private BigDecimal ratio; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.statisticalAnalysis.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * @Description: æ°æ®æ¥è¯¢æ¡ä»¶å®ä½ |
| | | * @author: yxw |
| | | * @date: 2022å¹´01æ28æ¥ 14:49 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="QueryCompareRequest", description="è·åæ°æ®çåæ°å®ä½") |
| | | public class QueryCompareRequest { |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¶é´ç±»å,对åºå¸¸éç±»ï¼TimeTypeConst |
| | | */ |
| | | @NotBlank(message = "æ¶é´ç±»åä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "æ¥è¯¢æ¶é´ç±»å,对åºå¸¸éï¼DAY/MONTH/SEASON/YEARï¼é»è®¤MONTH") |
| | | private String timeType; |
| | | |
| | | /** |
| | | * æ¥æå¼ï¼æä»½(202201-202212)ã年份(2022-~) |
| | | */ |
| | | @NotBlank(message = "æ¶é´ç¼ç ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "æ¥æå¼ï¼æä»½(202201-202212)ã年份(2022-~)") |
| | | private String timeCode; |
| | | |
| | | /** |
| | | * èç¹Id |
| | | */ |
| | | @NotBlank(message = "èç¹Id") |
| | | @ApiModelProperty(value = "èç¹Id") |
| | | private String nodeId; |
| | | |
| | | /** |
| | | * è½æºç±»åï¼éè¿/éå¼,water/gas |
| | | */ |
| | | @ApiModelProperty(value = "è½æºç±»åï¼éè¿/éå¼,water/gas") |
| | | private String energyType; |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<EnergyConsumeTrendDetailItem> listEnergyCostTrendDetail(String timeCode, String timeType, String modelCode, String energyType); |
| | | |
| | | /** |
| | | * åæ¯ç¯æ¯åæ |
| | | * |
| | | * @param req 请æ±åæ° |
| | | * @param comparisonType 对æ¯ç±»å |
| | | * @return |
| | | */ |
| | | public List<EnergyTypeValueContrastedVO> listEnergyTypeYoyInfo(QueryCompareRequest req, String comparisonType); |
| | | } |
| | |
| | | package com.zhitan.statisticalAnalysis.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateField; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.zhitan.basicdata.domain.SysEnergy; |
| | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import com.zhitan.statisticalAnalysis.domain.vo.*; |
| | | import com.zhitan.statisticalAnalysis.service.IEnergyConsumeDataService; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | costValueList.add(totalCost); |
| | | accumulationValueList.add(totalAccumulation); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç¯æ¯åæ |
| | | * |
| | | * @param req 请æ±åæ° |
| | | * @param comparisonType 对æ¯ç±»å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EnergyTypeValueContrastedVO> listEnergyTypeYoyInfo(QueryCompareRequest req, String comparisonType) { |
| | | String energyType = req.getEnergyType(); |
| | | String timeType = req.getTimeType(); |
| | | String timeCode = req.getTimeCode(); |
| | | String nodeId = req.getNodeId(); |
| | | //è½æºç±»åä¿¡æ¯ |
| | | SysEnergy sysEnergy = new SysEnergy(); |
| | | sysEnergy.setEnersno(energyType); |
| | | List<SysEnergy> sysEnergies = sysEnergyMapper.selectSysEnergyList(sysEnergy); |
| | | if (sysEnergies.isEmpty()) { |
| | | throw new RuntimeException("æªæ¥è¯¢å°è½æºä¿¡æ¯"); |
| | | } |
| | | SysEnergy sysEnergyInfo = sysEnergies.get(0); |
| | | |
| | | // è½èä¿¡æ¯ |
| | | Date startTime = DateTimeUtil.getTime(timeType, timeCode); |
| | | Date endTime = DateTimeUtil.getEndTimeByType(timeType, startTime); |
| | | //æ¯å¦åæ¯ |
| | | boolean isYoy = comparisonType.equals(CommonConst.ENERGY_COMPARISON_YOY); |
| | | // 计ç®ä¸ä¸å¹´çåææ¶é´ |
| | | Date lastBeginTime = DateUtil.offset(startTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); |
| | | Date lastEndTime = DateUtil.offset(endTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); |
| | | if (!isYoy) { |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | lastBeginTime = DateUtil.offsetDay(startTime, CommonConst.DIGIT_MINUS_1); |
| | | lastEndTime = DateUtil.offsetDay(endTime, CommonConst.DIGIT_MINUS_1); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | lastBeginTime = DateUtil.offsetMonth(startTime, CommonConst.DIGIT_MINUS_1); |
| | | lastEndTime = DateUtil.offsetMonth(endTime, CommonConst.DIGIT_MINUS_1); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //çµï¼åªæHOURæ°æ®ææï¼å
¶ä»è½æºç±»åï¼HOURãDAYææ°æ® |
| | | String queryTimeType = TimeTypeConst.TIME_TYPE_HOUR; |
| | | List<EnergyConsumeVO> energyConsumeVOList = new ArrayList<>(); |
| | | switch (sysEnergyInfo.getEnersno()) { |
| | | case "electric": |
| | | List<ElectricityDataItem> electricityDataItems = peakValleyMapper.getCostTrends(startTime, endTime, queryTimeType, nodeId, sysEnergyInfo.getEnersno()); |
| | | List<ElectricityDataItem> lastDataItemList = peakValleyMapper.getCostTrends(lastBeginTime, lastEndTime, queryTimeType, nodeId, sysEnergyInfo.getEnersno()); |
| | | if (!lastDataItemList.isEmpty()) { |
| | | electricityDataItems.addAll(lastDataItemList); |
| | | } |
| | | if (!electricityDataItems.isEmpty()) { |
| | | electricityDataItems.forEach(electricityDataItem -> { |
| | | EnergyConsumeVO temp = new EnergyConsumeVO(); |
| | | temp.setDataTime(electricityDataItem.getDataTime()); |
| | | temp.setAccumulationValue(electricityDataItem.getElectricity()); |
| | | energyConsumeVOList.add(temp); |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | if (timeType.equals(TimeTypeConst.TIME_TYPE_MONTH) || timeType.equals(TimeTypeConst.TIME_TYPE_YEAR)) { |
| | | queryTimeType = TimeTypeConst.TIME_TYPE_DAY; |
| | | } |
| | | List<CarbonEmission> dataItems = dataItemMapper.getMiddleCarbonEmission(startTime, endTime, queryTimeType, nodeId, sysEnergyInfo.getEnersno()); |
| | | List<CarbonEmission> lastDataItems = dataItemMapper.getMiddleCarbonEmission(lastBeginTime, lastEndTime, queryTimeType, nodeId, sysEnergyInfo.getEnersno()); |
| | | if (!lastDataItems.isEmpty()) { |
| | | dataItems.addAll(lastDataItems); |
| | | } |
| | | dataItems.addAll(lastDataItems); |
| | | if (!dataItems.isEmpty()) { |
| | | dataItems.forEach(dataItem -> { |
| | | EnergyConsumeVO temp = new EnergyConsumeVO(); |
| | | temp.setDataTime(dataItem.getDataTime()); |
| | | temp.setAccumulationValue(new BigDecimal(dataItem.getValue())); |
| | | energyConsumeVOList.add(temp); |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | // ç»è£
ç»è®¡å¾ä¿¡æ¯ |
| | | return getEnergyTypeValueContrastedVOList(startTime, timeType, energyConsumeVOList, sysEnergyInfo.getEnersno(), isYoy); |
| | | } |
| | | |
| | | /** |
| | | * ç»è£
ææ¬è¶å¿åæ-ç»è®¡å¾ä¿¡æ¯ |
| | | * |
| | | * @param bsTime æ¶é´ |
| | | * @param timeType æ¶é´ç±»å |
| | | * @param dataItems è½è |
| | | * @param energyType è½æºç±»å |
| | | * @param isYoy æ¯å¦åæ¯ |
| | | */ |
| | | private List<EnergyTypeValueContrastedVO> getEnergyTypeValueContrastedVOList(Date bsTime, String timeType, |
| | | List<EnergyConsumeVO> dataItems, String energyType, boolean isYoy) { |
| | | Map<String, List<EnergyConsumeVO>> energyConsumeVOMap; |
| | | Map<String, List<EnergyConsumeVO>> lastEnergyConsumeVOMap; |
| | | List<EnergyTypeValueContrastedVO> itemList = new ArrayList<>(); |
| | | //ææ¶é´ç±»åç»ç»è¿åæ°æ® |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | energyConsumeVOMap = dataItems.stream().collect(Collectors.groupingBy(li -> DateUtil.formatDateTime(li.getDataTime()))); |
| | | for (int i = 0; i < CommonConst.DIGIT_24; i++) { |
| | | Date currentTime = DateUtil.offsetHour(bsTime, i); |
| | | Date compareTime = isYoy ? DateUtil.offset(currentTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1) : DateUtil.offsetDay(currentTime, CommonConst.DIGIT_MINUS_1); |
| | | String keyCurrentTime = DateUtil.formatDateTime(currentTime); |
| | | String keyCompareTime = DateUtil.formatDateTime(compareTime); |
| | | EnergyTypeValueContrastedVO item = getEnergyTypeValueContrastedVO(energyType, energyConsumeVOMap, keyCurrentTime, keyCompareTime, currentTime, compareTime); |
| | | itemList.add(item); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | energyConsumeVOMap = dataItems.stream().collect(Collectors.groupingBy(li -> DateUtil.formatDate(li.getDataTime()))); |
| | | Date endTime = DateTimeUtil.getEndTimeByType(timeType, bsTime); |
| | | while (bsTime.before(endTime)) { |
| | | Date currentTime = bsTime; |
| | | Date compareTime = isYoy ? DateUtil.offset(currentTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1) : DateUtil.offsetMonth(currentTime, CommonConst.DIGIT_MINUS_1); |
| | | String keyCurrentTime = DateUtil.formatDate(currentTime); |
| | | String keyCompareTime = DateUtil.formatDate(compareTime); |
| | | EnergyTypeValueContrastedVO item = getEnergyTypeValueContrastedVO(energyType, energyConsumeVOMap, keyCurrentTime, keyCompareTime, currentTime, compareTime); |
| | | itemList.add(item); |
| | | bsTime = DateUtil.offsetDay(bsTime, CommonConst.DIGIT_1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | SimpleDateFormat formatter = new SimpleDateFormat(DateTimeUtil.COMMON_PATTERN_TO_MONTH_ZH); |
| | | energyConsumeVOMap = dataItems.stream().collect(Collectors.groupingBy(li -> formatter.format(li.getDataTime()))); |
| | | for (int i = 0; i < CommonConst.DIGIT_12; i++) { |
| | | Date currentTime = DateUtil.offsetMonth(bsTime, i); |
| | | Date compareTime = DateUtil.offset(currentTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); |
| | | String keyCurrentTime = formatter.format(currentTime); |
| | | String keyCompareTime = formatter.format(compareTime); |
| | | EnergyTypeValueContrastedVO item = getEnergyTypeValueContrastedVO(energyType, energyConsumeVOMap, keyCurrentTime, keyCompareTime, currentTime, compareTime); |
| | | itemList.add(item); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return itemList; |
| | | } |
| | | |
| | | private @NotNull EnergyTypeValueContrastedVO getEnergyTypeValueContrastedVO(String energyType, Map<String, List<EnergyConsumeVO>> energyConsumeVOMap, |
| | | String keyCurrentTime, String keyCompareTime, Date currentTime, Date compareTime) { |
| | | List<EnergyConsumeVO> energyConsumeList = Optional.ofNullable(energyConsumeVOMap.get(keyCurrentTime)) |
| | | .orElse(Collections.emptyList()); |
| | | BigDecimal currentValue = calculateSum(energyConsumeList); |
| | | List<EnergyConsumeVO> lastEnergyConsumeList = Optional.ofNullable(energyConsumeVOMap.get(keyCompareTime)) |
| | | .orElse(Collections.emptyList()); |
| | | BigDecimal contrastValues = calculateSum(lastEnergyConsumeList); |
| | | BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); |
| | | BigDecimal ratio = calculateRatio(currentValue, contrastValues, multiple); |
| | | EnergyTypeValueContrastedVO item = new EnergyTypeValueContrastedVO(); |
| | | item.setEnergyType(energyType); |
| | | item.setCurrentTime(DateUtil.formatDateTime(currentTime)); |
| | | item.setCompareTime(DateUtil.formatDateTime(compareTime)); |
| | | item.setCurrentValue(currentValue); |
| | | item.setContrastValues(contrastValues); |
| | | item.setRatio(ratio); |
| | | return item; |
| | | } |
| | | |
| | | private BigDecimal calculateSum(List<EnergyConsumeVO> dataItemList) { |
| | | return dataItemList.stream() |
| | | .map(EnergyConsumeVO::getAccumulationValue) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | private BigDecimal calculateRatio(BigDecimal currentSum, BigDecimal lastSum, BigDecimal multiple) { |
| | | if (lastSum.compareTo(BigDecimal.ZERO) == 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | return currentSum.subtract(lastSum) |
| | | .divide(lastSum, CommonConst.DIGIT_2, RoundingMode.HALF_UP) |
| | | .multiply(multiple) |
| | | .setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); |
| | | } |
| | | } |
| | |
| | | VITE_APP_ENV = 'development' |
| | | |
| | | # ç³»ç»/å¼åç¯å¢ |
| | | # wangxiang |
| | | # VITE_APP_BASE_API = 'http://127.0.0.1:8080' |
| | | # hangmingjun |
| | | # VITE_APP_BASE_API = 'http://127.0.0.1:8080' |
| | | # weishuaishuai |
| | | # VITE_APP_BASE_API = 'https://demo-ems.zhitancloud.com' |
| | | # test |
| | | VITE_APP_BASE_API = 'http://139.159.201.118:8201' |
| | | VITE_APP_BASE_API = 'http://127.0.0.1:8080' |
| | | # hangmingjun |
| | | |
| | |
| | | .DS_Store |
| | | */.DS_Store |
| | | node_modules/ |
| | | dist/ |
| | | npm-debug.log* |
| | |
| | | yarn-error.log* |
| | | **/*.log |
| | | |
| | | |
| | | tests/**/coverage/ |
| | | tests/e2e/reports |
| | | selenium-debug.log |
| | |
| | | params: query, |
| | | }) |
| | | } |
| | | // 对æ¯åæåæ¯ |
| | | export function querySameCompareList(query) { |
| | | return request({ |
| | | url: "/statisticsAnalysis/querySameCompareList", |
| | | method: "get", |
| | | params: query, |
| | | }) |
| | | } |
| | | // 对æ¯åæç¯æ¯ |
| | | export function queryLoopCompareList(query) { |
| | | return request({ |
| | | url: "/statisticsAnalysis/queryLoopCompareList", |
| | | method: "get", |
| | | params: query, |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="è½æºç±»å" clearable 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="queryParams.analysisType == 'YOY' ? 'primary' : ''" @click="handleAnalysisType('YOY')"> |
| | | 忝 |
| | | </el-button> |
| | | <el-button :type="queryParams.analysisType == 'MOM' ? 'primary' : ''" @click="handleAnalysisType('MOM')"> |
| | | ç¯æ¯ |
| | | </el-button> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item> |
| | | <el-button type="primary" 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="chart-box"> |
| | | <div id="Chart1" /> |
| | | </div> |
| | | </BaseCard> |
| | | |
| | | <BaseCard :title="queryParams.nodeName + |
| | | '-è½è对æ¯åæåæ¯åæè¡¨-' + |
| | | queryParams.enername |
| | | "> |
| | | <div class="table-box"> |
| | | <el-table :data="departmentList" show-summary> |
| | | <el-table-column label="æ¬ææ¶é´" align="center" key="currentTime" prop="currentTime" |
| | | :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="'æ¬æè' + |
| | | queryParams.enername + |
| | | '(' + |
| | | queryParams.muid + |
| | | ')' |
| | | " align="center" key="currentValue" prop="currentValue" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="åææ¶é´" align="center" key="compareTime" prop="compareTime" |
| | | :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="'åæè' + |
| | | queryParams.enername + |
| | | '(' + |
| | | queryParams.muid + |
| | | ')' |
| | | " align="center" key="contrastValues" prop="contrastValues" :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="(queryParams.analysisType == 'YOY' ? 'å' : 'ç¯') + 'æ¯(%)' |
| | | " align="center" key="ratio" prop="ratio" :show-overflow-tooltip="true" width="200" /> |
| | | </el-table> |
| | | </div> |
| | | </BaseCard> |
| | | <!-- </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="department"> |
| | | import { |
| | | listRegion, |
| | | listDepartment, |
| | | querySameCompareList, |
| | | } from "@/api/energyAnalysis/energyAnalysis"; |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType"; |
| | | import * as echarts from "echarts"; |
| | | 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, |
| | | timeCode: null, |
| | | analysisType: "YOY", |
| | | energyType: null, |
| | | }, |
| | | query: { |
| | | modelCode: null, |
| | | }, |
| | | }); |
| | | const { queryParams, query } = toRefs(data); |
| | | /** èç¹åå»äºä»¶ */ |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id; |
| | | queryParams.value.nodeName = data.label; |
| | | handleTimeType(period.value[1].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; |
| | | if(e=='MONTH'){ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM"); |
| | | }else if(e=='YEAR'){ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY"); |
| | | }else{ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM-DD"); |
| | | } |
| | | |
| | | } |
| | | function handleEnergyType(item) { |
| | | queryParams.value.enername = item.enername; |
| | | queryParams.value.muid = item.muid; |
| | | handleQuery(); |
| | | } |
| | | function handleAnalysisType(analysisType) { |
| | | queryParams.value.analysisType = analysisType; |
| | | getList(); |
| | | } |
| | | // è½è对æ¯åæ-å表 |
| | | function getList() { |
| | | loading.value = true; |
| | | // å¨åå§åä¹åï¼å
disposeæ§çå®ä¾ |
| | | if (echarts.getInstanceByDom(document.getElementById("Chart1"))) { |
| | | echarts.dispose(document.getElementById("Chart1")); |
| | | } |
| | | // if (echarts.getInstanceByDom(document.getElementById("Chart2"))) { |
| | | // echarts.dispose(document.getElementById("Chart2")); |
| | | // } |
| | | const myChart1 = echarts.init(document.getElementById("Chart1")); |
| | | // const myChart2 = echarts.init(document.getElementById("Chart2")); |
| | | querySameCompareList( |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }) |
| | | ).then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | | loading.value = false; |
| | | let xdata = []; |
| | | let yvalue = []; |
| | | let ycompareValue = []; |
| | | let yqoq = []; |
| | | if (!!res.data) { |
| | | res.data.map((item) => { |
| | | xdata.push( |
| | | proxy |
| | | .dayjs(item.currentTime) |
| | | .format( |
| | | queryParams.value.timeType == "YEAR"? "MMæ": queryParams.value.timeType =="MONTH"? "DDæ¥": "HHæ¶" |
| | | ) |
| | | ); |
| | | yvalue.push(!!item.currentValue ? item.currentValue : 0); |
| | | ycompareValue.push(!!item.contrastValues? item.contrastValues : 0); |
| | | yqoq.push(!!item.ratio ? item.ratio : 0); |
| | | }); |
| | | console.log(xdata) |
| | | } |
| | | setTimeout(() => { |
| | | myChart1.setOption({ |
| | | color: ["#2979ff", "#19be6b", "#ff9900", "#fa3534"], |
| | | grid: { |
| | | top: "45", |
| | | left: "7%", |
| | | right: "5%", |
| | | bottom: "10", |
| | | containLabel: true, |
| | | }, |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | 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: xdata, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | name: |
| | | "è" + |
| | | queryParams.value.enername + |
| | | "é(" + |
| | | queryParams.value.muid + |
| | | ")", |
| | | 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, |
| | | }, |
| | | }, |
| | | { |
| | | type: "value", |
| | | name: queryParams.value.analysisType == "YOY" ? "忝(%)" : "ç¯æ¯(%)", |
| | | alignTicks: true, |
| | | nameTextStyle: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | }, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "æ¬æå¼", |
| | | type: "bar", |
| | | barWidth: "8", |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + queryParams.value.muid; |
| | | }, |
| | | }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: yvalue, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | name: "åæå¼", |
| | | type: "bar", |
| | | barWidth: "8", |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + queryParams.value.muid; |
| | | }, |
| | | }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: ycompareValue, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | name: queryParams.value.analysisType == "YOY" ? "忝" : "ç¯æ¯", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | symbol: "none", // 设置为 'none' 廿åç¹ |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + "%"; |
| | | }, |
| | | }, |
| | | data: yqoq, |
| | | }, |
| | | ], |
| | | }); |
| | | }, 100); |
| | | departmentList.value = !!res.data ? res.data : []; |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart1.resize(); |
| | | }, |
| | | { passive: true } |
| | | ); |
| | | } |
| | | }); |
| | | // listDepartment( |
| | | // proxy.addDateRange({ |
| | | // ...queryParams.value, |
| | | // ...query.value, |
| | | // }) |
| | | // ).then((res) => { |
| | | // if (!!res.code && res.code == 200) { |
| | | // loading.value = false; |
| | | // let seriesdata = []; |
| | | // let xdata = []; |
| | | // if (!!energyTypeList.value) { |
| | | // energyTypeList.value.map((item) => { |
| | | // seriesdata.push({ |
| | | // name: item.enername, |
| | | // type: "bar", |
| | | // barWidth: "16", |
| | | // stack: "total", |
| | | // data: [], |
| | | // }); |
| | | // }); |
| | | // } |
| | | // if (!!res.data) { |
| | | // res.data.map((dataItem) => { |
| | | // xdata.push(dataItem.nodeName) |
| | | // seriesdata.forEach((seriesdataItem) => { |
| | | // if ( |
| | | // dataItem.data.find( |
| | | // (dataItemItem) => |
| | | // dataItemItem.energyTypeName == seriesdataItem.name |
| | | // ) == undefined |
| | | // ) { |
| | | // dataItem.data.push({ |
| | | // nodeId: dataItem.nodeId, |
| | | // nodeName: dataItem.nodeName, |
| | | // energyTypeNo: null, |
| | | // energyTypeName: seriesdataItem.name, |
| | | // energyConsumption: 0, |
| | | // }); |
| | | // } |
| | | // dataItem.data.map(dataItemItem => { |
| | | // if (seriesdataItem.name == dataItemItem.energyTypeName) { |
| | | // seriesdataItem.data.push(dataItemItem.energyConsumption) |
| | | // } |
| | | // }) |
| | | // }); |
| | | // }); |
| | | // } |
| | | // setTimeout(() => { |
| | | // myChart2.setOption({ |
| | | // color: ["#2979ff", "#19be6b", "#ff9900", "#fa3534"], |
| | | // grid: { |
| | | // top: "45", |
| | | // left: "17%", |
| | | // right: "5%", |
| | | // bottom: "10", |
| | | // containLabel: true, |
| | | // }, |
| | | // tooltip: { |
| | | // trigger: "axis", |
| | | // axisPointer: { |
| | | // type: "shadow", |
| | | // }, |
| | | // }, |
| | | // legend: { |
| | | // icon: "rect", |
| | | // itemWidth: 14, |
| | | // itemHeight: 10, |
| | | // right: 0, |
| | | // textStyle: { |
| | | // color: |
| | | // settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | // }, |
| | | // }, |
| | | // xAxis: { |
| | | // nameLocation: "start", |
| | | // type: "value", |
| | | // name: "åä½tce", |
| | | // 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, |
| | | // // formatter: '{value} ml' |
| | | // }, |
| | | // }, |
| | | // yAxis: { |
| | | // 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: xdata.splice(0, 6), |
| | | // }, |
| | | // series: seriesdata, |
| | | // }); |
| | | // }, 100); |
| | | // window.addEventListener("resize", () => { |
| | | // myChart2.resize(); |
| | | // },{passive: true}); |
| | | // } |
| | | // }); |
| | | } |
| | | // è½è对æ¯åæ-ç§å®¤è½èåæ-æç´¢ |
| | | function handleQuery() { |
| | | getList(); |
| | | } |
| | | // è½è对æ¯åæ-éç½® |
| | | 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 = "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"; |
| | | </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="è½æºç±»å" clearable 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="queryParams.analysisType == 'YOY' ? 'primary' : ''" @click="handleAnalysisType('YOY')"> |
| | | 忝 |
| | | </el-button> |
| | | <el-button :type="queryParams.analysisType == 'MOM' ? 'primary' : ''" @click="handleAnalysisType('MOM')"> |
| | | ç¯æ¯ |
| | | </el-button> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item> |
| | | <el-button type="primary" 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="chart-box"> |
| | | <div id="Chart1" /> |
| | | </div> |
| | | </BaseCard> |
| | | |
| | | <BaseCard :title="queryParams.nodeName + |
| | | '-è½è对æ¯åæç¯æ¯åæè¡¨-' + |
| | | queryParams.enername |
| | | "> |
| | | <div class="table-box"> |
| | | <el-table :data="departmentList" show-summary> |
| | | <el-table-column label="æ¬ææ¶é´" align="center" key="currentTime" prop="currentTime" |
| | | :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="'æ¬æè' + |
| | | queryParams.enername + |
| | | '(' + |
| | | queryParams.muid + |
| | | ')' |
| | | " align="center" key="currentValue" prop="currentValue" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="åææ¶é´" align="center" key="compareTime" prop="compareTime" |
| | | :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="'åæè' + |
| | | queryParams.enername + |
| | | '(' + |
| | | queryParams.muid + |
| | | ')' |
| | | " align="center" key="contrastValues" prop="contrastValues" :show-overflow-tooltip="true" /> |
| | | <el-table-column :label="(queryParams.analysisType == 'YOY' ? 'å' : 'ç¯') + 'æ¯(%)' |
| | | " align="center" key="ratio" prop="ratio" :show-overflow-tooltip="true" width="200" /> |
| | | </el-table> |
| | | </div> |
| | | </BaseCard> |
| | | <!-- </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="department"> |
| | | import { |
| | | listRegion, |
| | | listDepartment, |
| | | queryLoopCompareList, |
| | | } from "@/api/energyAnalysis/energyAnalysis"; |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType"; |
| | | import * as echarts from "echarts"; |
| | | 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, |
| | | analysisType: "MOM", |
| | | timeCode: null, |
| | | energyType: null, |
| | | }, |
| | | query: { |
| | | modelCode: null, |
| | | }, |
| | | }); |
| | | const { queryParams, query } = toRefs(data); |
| | | /** èç¹åå»äºä»¶ */ |
| | | function handleNodeClick(data) { |
| | | queryParams.value.nodeId = data.id; |
| | | queryParams.value.nodeName = data.label; |
| | | handleTimeType(period.value[1].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; |
| | | if(e=='MONTH'){ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM"); |
| | | }else if(e=='YEAR'){ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY"); |
| | | }else{ |
| | | queryParams.value.timeCode = proxy.dayjs(new Date()).format("YYYY-MM-DD"); |
| | | } |
| | | } |
| | | function handleEnergyType(item) { |
| | | queryParams.value.enername = item.enername; |
| | | queryParams.value.muid = item.muid; |
| | | handleQuery(); |
| | | } |
| | | function handleAnalysisType(analysisType) { |
| | | queryParams.value.analysisType = analysisType; |
| | | getList(); |
| | | } |
| | | // è½è对æ¯åæ-å表 |
| | | function getList() { |
| | | loading.value = true; |
| | | // å¨åå§åä¹åï¼å
disposeæ§çå®ä¾ |
| | | if (echarts.getInstanceByDom(document.getElementById("Chart1"))) { |
| | | echarts.dispose(document.getElementById("Chart1")); |
| | | } |
| | | // if (echarts.getInstanceByDom(document.getElementById("Chart2"))) { |
| | | // echarts.dispose(document.getElementById("Chart2")); |
| | | // } |
| | | const myChart1 = echarts.init(document.getElementById("Chart1")); |
| | | // const myChart2 = echarts.init(document.getElementById("Chart2")); |
| | | queryLoopCompareList( |
| | | proxy.addDateRange({ |
| | | ...queryParams.value, |
| | | ...query.value, |
| | | }) |
| | | ).then((res) => { |
| | | if (!!res.code && res.code == 200) { |
| | | loading.value = false; |
| | | let xdata = []; |
| | | let yvalue = []; |
| | | let ycompareValue = []; |
| | | let yqoq = []; |
| | | if (!!res.data) { |
| | | res.data.map((item) => { |
| | | xdata.push( |
| | | proxy |
| | | .dayjs(item.currentTime) |
| | | .format( |
| | | queryParams.value.timeType == "YEAR" |
| | | ? "MMæ" |
| | | : queryParams.value.timeType == "MONTH" |
| | | ? "DDæ¥" |
| | | : "HHæ¶" |
| | | ) |
| | | ); |
| | | yvalue.push(!!item.currentValue ? item.currentValue : 0); |
| | | ycompareValue.push(!!item.contrastValues ? item.contrastValues : 0); |
| | | yqoq.push(!!item.ratio ? item.ratio : 0); |
| | | }); |
| | | } |
| | | setTimeout(() => { |
| | | myChart1.setOption({ |
| | | color: ["#2979ff", "#19be6b", "#ff9900", "#fa3534"], |
| | | grid: { |
| | | top: "45", |
| | | left: "7%", |
| | | right: "5%", |
| | | bottom: "10", |
| | | containLabel: true, |
| | | }, |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | 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: xdata, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | name: |
| | | "è" + |
| | | queryParams.value.enername + |
| | | "é(" + |
| | | queryParams.value.muid + |
| | | ")", |
| | | 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, |
| | | }, |
| | | }, |
| | | { |
| | | type: "value", |
| | | name: queryParams.value.analysisType == "YOY" ? "忝(%)" : "ç¯æ¯(%)", |
| | | alignTicks: true, |
| | | nameTextStyle: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | }, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: |
| | | settingsStore.sideTheme == "theme-dark" |
| | | ? "#FFFFFF" |
| | | : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "æ¬æå¼", |
| | | type: "bar", |
| | | barWidth: "8", |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + queryParams.value.muid; |
| | | }, |
| | | }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: yvalue, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | name: "åæå¼", |
| | | type: "bar", |
| | | barWidth: "8", |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + queryParams.value.muid; |
| | | }, |
| | | }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: ycompareValue, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | name: queryParams.value.analysisType == "YOY" ? "忝" : "ç¯æ¯", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | symbol: "none", // 设置为 'none' 廿åç¹ |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value + "%"; |
| | | }, |
| | | }, |
| | | data: yqoq, |
| | | }, |
| | | ], |
| | | }); |
| | | }, 100); |
| | | departmentList.value = !!res.data ? res.data : []; |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart1.resize(); |
| | | }, |
| | | { passive: true } |
| | | ); |
| | | } |
| | | }); |
| | | // listDepartment( |
| | | // proxy.addDateRange({ |
| | | // ...queryParams.value, |
| | | // ...query.value, |
| | | // }) |
| | | // ).then((res) => { |
| | | // if (!!res.code && res.code == 200) { |
| | | // loading.value = false; |
| | | // let seriesdata = []; |
| | | // let xdata = []; |
| | | // if (!!energyTypeList.value) { |
| | | // energyTypeList.value.map((item) => { |
| | | // seriesdata.push({ |
| | | // name: item.enername, |
| | | // type: "bar", |
| | | // barWidth: "16", |
| | | // stack: "total", |
| | | // data: [], |
| | | // }); |
| | | // }); |
| | | // } |
| | | // if (!!res.data) { |
| | | // res.data.map((dataItem) => { |
| | | // xdata.push(dataItem.nodeName) |
| | | // seriesdata.forEach((seriesdataItem) => { |
| | | // if ( |
| | | // dataItem.data.find( |
| | | // (dataItemItem) => |
| | | // dataItemItem.energyTypeName == seriesdataItem.name |
| | | // ) == undefined |
| | | // ) { |
| | | // dataItem.data.push({ |
| | | // nodeId: dataItem.nodeId, |
| | | // nodeName: dataItem.nodeName, |
| | | // energyTypeNo: null, |
| | | // energyTypeName: seriesdataItem.name, |
| | | // energyConsumption: 0, |
| | | // }); |
| | | // } |
| | | // dataItem.data.map(dataItemItem => { |
| | | // if (seriesdataItem.name == dataItemItem.energyTypeName) { |
| | | // seriesdataItem.data.push(dataItemItem.energyConsumption) |
| | | // } |
| | | // }) |
| | | // }); |
| | | // }); |
| | | // } |
| | | // setTimeout(() => { |
| | | // myChart2.setOption({ |
| | | // color: ["#2979ff", "#19be6b", "#ff9900", "#fa3534"], |
| | | // grid: { |
| | | // top: "45", |
| | | // left: "17%", |
| | | // right: "5%", |
| | | // bottom: "10", |
| | | // containLabel: true, |
| | | // }, |
| | | // tooltip: { |
| | | // trigger: "axis", |
| | | // axisPointer: { |
| | | // type: "shadow", |
| | | // }, |
| | | // }, |
| | | // legend: { |
| | | // icon: "rect", |
| | | // itemWidth: 14, |
| | | // itemHeight: 10, |
| | | // right: 0, |
| | | // textStyle: { |
| | | // color: |
| | | // settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | // }, |
| | | // }, |
| | | // xAxis: { |
| | | // nameLocation: "start", |
| | | // type: "value", |
| | | // name: "åä½tce", |
| | | // 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, |
| | | // // formatter: '{value} ml' |
| | | // }, |
| | | // }, |
| | | // yAxis: { |
| | | // 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: xdata.splice(0, 6), |
| | | // }, |
| | | // series: seriesdata, |
| | | // }); |
| | | // }, 100); |
| | | // window.addEventListener("resize", () => { |
| | | // myChart2.resize(); |
| | | // },{passive: true}); |
| | | // } |
| | | // }); |
| | | } |
| | | // è½è对æ¯åæ-æç´¢ |
| | | function handleQuery() { |
| | | getList(); |
| | | } |
| | | // è½è对æ¯åæ-éç½® |
| | | 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"; |
| | | 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"; |
| | | </style> |
| | |
| | | |
| | | // https://vitejs.dev/config/ |
| | | export default defineConfig(({ mode, command }) => { |
| | | mode='production' |
| | | const env = loadEnv(mode, process.cwd()) |
| | | console.log(mode,'==========env') |
| | | const { VITE_APP_ENV } = env |
| | | return { |
| | | // é¨ç½²ç产ç¯å¢åå¼åç¯å¢ä¸çURLã |