Sfoglia il codice sorgente

修改生产日报和故障日报分开上传

‘xugp 2 anni fa
parent
commit
016316fd92
29 ha cambiato i file con 358 aggiunte e 320 eliminazioni
  1. BIN
      .gradle/7.4.2/checksums/checksums.lock
  2. BIN
      .gradle/7.4.2/executionHistory/executionHistory.bin
  3. BIN
      .gradle/7.4.2/executionHistory/executionHistory.lock
  4. BIN
      .gradle/7.4.2/fileHashes/fileHashes.bin
  5. BIN
      .gradle/7.4.2/fileHashes/fileHashes.lock
  6. BIN
      .gradle/7.4.2/fileHashes/resourceHashesCache.bin
  7. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  8. BIN
      .gradle/buildOutputCleanup/outputFiles.bin
  9. BIN
      .gradle/file-system.probe
  10. 17 0
      .idea/dataSources.xml
  11. 1 0
      .idea/gradle.xml
  12. 1 1
      .idea/misc.xml
  13. 89 0
      .idea/sonarlint/issuestore/index.pb
  14. 1 39
      logs/warn.log
  15. 2 1
      report-fd/build/resources/main/application.yaml
  16. 5 6
      report-fd/build/resources/main/templates/FaultReport.html
  17. 5 8
      report-fd/build/resources/main/templates/productionReport.html
  18. 18 0
      report-fd/src/main/java/com/gyee/wisdom/report/controller/ReportController.java
  19. 185 154
      report-fd/src/main/java/com/gyee/wisdom/report/service/SeleniumService.java
  20. 2 1
      report-fd/src/main/resources/application.yaml
  21. 5 6
      report-fd/src/main/resources/templates/FaultReport.html
  22. 5 8
      report-fd/src/main/resources/templates/productionReport.html
  23. 1 1
      report-gf/src/main/java/com/gyee/wisdom/report/config/MyJsonConfig.java
  24. 2 2
      report-gf/src/main/java/com/gyee/wisdom/report/config/MyWebAppConfigurer.java
  25. 0 7
      report-gf/src/main/java/com/gyee/wisdom/report/controller/IndexController.java
  26. 1 1
      report-gf/src/main/java/com/gyee/wisdom/report/controller/TestController.java
  27. 17 84
      report-gf/src/main/java/com/gyee/wisdom/report/service/SeleniumService.java
  28. BIN
      report-gf/src/main/resources/report.db
  29. 1 1
      report-gf/src/main/resources/templates/productionReport.html

BIN
.gradle/7.4.2/checksums/checksums.lock


BIN
.gradle/7.4.2/executionHistory/executionHistory.bin


BIN
.gradle/7.4.2/executionHistory/executionHistory.lock


BIN
.gradle/7.4.2/fileHashes/fileHashes.bin


BIN
.gradle/7.4.2/fileHashes/fileHashes.lock


BIN
.gradle/7.4.2/fileHashes/resourceHashesCache.bin


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock


BIN
.gradle/buildOutputCleanup/outputFiles.bin


BIN
.gradle/file-system.probe


+ 17 - 0
.idea/dataSources.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
+    <data-source source="LOCAL" name="report" uuid="4e2be5f1-2f88-41df-86d6-c8051fe86dbc">
+      <driver-ref>sqlite.xerial</driver-ref>
+      <synchronize>true</synchronize>
+      <jdbc-driver>org.sqlite.JDBC</jdbc-driver>
+      <jdbc-url>jdbc:sqlite:E:\report-import\report-gf\src\main\resources\report.db</jdbc-url>
+      <working-dir>$ProjectFileDir$</working-dir>
+      <libraries>
+        <library>
+          <url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.38.0/sqlite-jdbc-3.38.0.jar</url>
+        </library>
+      </libraries>
+    </data-source>
+  </component>
+</project>

+ 1 - 0
.idea/gradle.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>

+ 1 - 1
.idea/misc.xml

@@ -4,5 +4,5 @@
   <component name="FrameworkDetectionExcludesConfiguration">
     <file type="web" url="file://$PROJECT_DIR$" />
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
 </project>

+ 89 - 0
.idea/sonarlint/issuestore/index.pb

@@ -0,0 +1,89 @@
+
+^
+..idea/inspectionProfiles/profiles_settings.xml,1\e\1e9075f5bf079c01ef2c910709e91a497d262080
+\
+,.idea/inspectionProfiles/Project_Default.xml,4\9\496a238a6afa168dbaf6efd37bb459331589579c
+G
+datalogs/dataChange.log,9\c\9c34922df1a9febc2fcdc7aa083a3f4e2da4f951
+X
+(gradle/wrapper/gradle-wrapper.properties,f\b\fbe448ebfc3eb2d4e308f6b8b043666f5b57235e
+>
+logs/error.log,5\a\5a00245462ed6666737fdbfd3ba4de91698d61ae
+=
+
logs/info.log,d\3\d3090eba8be764b31ee31b4cd61536c0aee41bb4
+<
+build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
+A
+gradle.properties,2\a\2afbb999f001938c88fa43fc2ef52abf0f8213e4
+7
+gradlew,5\b\5bbfa66edb4db3c7c33c5181f43510990d3307f9
+;
+gradlew.bat,2\a\2a45a911a8f1836b0b6c5b758962572012d8f8c3
+=
+
lombok.config,8\2\823fe80d2650ec87c2614800da17ca3a55af96a9
+9
+	README.md,8\e\8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d
+?
+settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
+F
+report-fd/build.gradle,a\e\ae208822b4f47e3025c3c624e74e92be59da6f17
+C
+report-fd/README.md,c\3\c396dfa43d43494c4862f9fac25bc32b442b74ab
+}
+Mreport-fd/src/main/java/com/gyee/wisdom/report/config/cache/CacheService.java,8\c\8cb7901059d035c46d5b7960abd35d6c0a895165
+z
+Jreport-fd/src/main/java/com/gyee/wisdom/report/config/sqlite/Database.java,b\c\bc1753bce02e36b24e648a6f2c3c03ad9c6a4080
+w
+Greport-fd/src/main/java/com/gyee/wisdom/report/config/MyJsonConfig.java,c\4\c49395c880423d7e596a0dd1266eba1cc580afdc
+}
+Mreport-fd/src/main/java/com/gyee/wisdom/report/config/MyWebAppConfigurer.java,0\4\04b1051d403c4a7979e82fd7c8aae0e4696cb8ca
+y
+Ireport-fd/src/main/java/com/gyee/wisdom/report/service/ReportService.java,b\9\b94c05c26d92178520da18bf6952c6cd72a6b006
+y
+Ireport-fd/src/main/java/com/gyee/wisdom/report/utils/ExcelClassField.java,0\2\02db87f3ec8d1fb448e01de2acb3948ede87a4b2
+u
+Ereport-fd/src/main/java/com/gyee/wisdom/report/utils/ExcelExport.java,f\0\f096db39f0e74bb327462738fc8e5fb0969419b1
+u
+Ereport-fd/src/main/java/com/gyee/wisdom/report/utils/ExcelImport.java,1\8\183db6323cb8027986a36212631e0d863eef54b0
+s
+Creport-fd/src/main/java/com/gyee/wisdom/report/utils/ExcelUtil.java,5\5\55fc1a57b170a7294343d8bbf922f6461ea35be3
+t
+Dreport-fd/src/main/java/com/gyee/wisdom/report/utils/ExcelUtils.java,2\5\25890f63740b57d540f1f237f96ca07ce53ad820
+r
+Breport-fd/src/main/java/com/gyee/wisdom/report/utils/MD5Utils.java,c\d\cde91cfe0702f14ad2a2d9cd20925b718d98dfee
+y
+Ireport-fd/src/main/java/com/gyee/wisdom/report/utils/ResponseWrapper.java,7\2\72b8cbea5b9a8990d9457bafc97c2f871426b314
+F
+report-gf/build.gradle,1\1\11da98b887ba702d7a9ef096ea3f49cb7fb566a2
+C
+report-gf/README.md,2\4\249ad7e2adbc51e46395bef0a8c91b8bb72f3416
+q
+Areport-gf/src/main/java/com/gyee/wisdom/report/common/Common.java,9\f\9f70a9b8d26654641283fab77c12dffe0d90cefd
+t
+Dreport-gf/src/main/java/com/gyee/wisdom/report/entity/Parameter.java,e\7\e750f00c9acce217a122795a8cca07d468e07402
+{
+Kreport-gf/src/main/java/com/gyee/wisdom/report/entity/WindpowerStation.java,e\9\e9fdfad68285f40b226e5acea1cf02ea441e304a
+y
+Ireport-gf/src/main/java/com/gyee/wisdom/report/service/ReportService.java,1\2\125c9a648636a6d71c21f130bdd0b440f88f165b
+y
+Ireport-gf/src/main/java/com/gyee/wisdom/report/utils/ExcelClassField.java,3\0\30d2384c5be0ae9210181d5dea579b8d1cb407e6
+u
+Ereport-gf/src/main/java/com/gyee/wisdom/report/utils/ExcelExport.java,8\5\85cb9495f6bd2d1c64fb4ed19e4ff1abeabb236f
+u
+Ereport-gf/src/main/java/com/gyee/wisdom/report/utils/ExcelImport.java,d\3\d3c368750834dcff29b6bc0a3df281a5a12684a9
+s
+Creport-gf/src/main/java/com/gyee/wisdom/report/utils/ExcelUtil.java,4\3\43ea534fd26715f4a34691d55c64450871a51f7e
+t
+Dreport-gf/src/main/java/com/gyee/wisdom/report/utils/ExcelUtils.java,7\7\7779f2e6d1610e0ae1f92d2936a50d932286d3da
+r
+Breport-gf/src/main/java/com/gyee/wisdom/report/utils/MD5Utils.java,0\3\035845cd2df9033fa06eb3e55fb05c5aa049924a
+y
+Ireport-gf/src/main/java/com/gyee/wisdom/report/utils/ResponseWrapper.java,9\c\9c7f25bad215a9c2367a3c1c6578d9cf8a0592c2
+t
+Dreport-fd/src/main/java/com/gyee/wisdom/report/entity/Parameter.java,3\2\326e62f25bbdaf952a6527b8659c82c8d1e3c00d
+{
+Kreport-fd/src/main/java/com/gyee/wisdom/report/entity/WindpowerStation.java,a\c\ac7df921dda2077d74dd8480067b6e053f2bc2bc
+q
+Areport-fd/src/main/java/com/gyee/wisdom/report/common/Common.java,0\f\0f7f23caa1ba0e5faf799053d0e70e3d3f8e49c3
+}
+Mreport-fd/src/main/java/com/gyee/wisdom/report/controller/TestController.java,1\9\19ea878502cdbecca051e7c1a20cec4b871391ff

+ 1 - 39
logs/warn.log

@@ -1,39 +1 @@
-2022-12-07 10:52:40.937  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 10:52:42.627  WARN main refresh(AbstractApplicationContext.java:591) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8090 is already in use
-2022-12-07 10:52:42.688 ERROR main report(LoggingFailureAnalysisReporter.java:40) 
-
-***************************
-APPLICATION FAILED TO START
-***************************
-
-Description:
-
-Web server failed to start. Port 8090 was already in use.
-
-Action:
-
-Identify and stop the process that's listening on port 8090 or configure this application to listen on another port.
-
-2022-12-07 10:53:04.156  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 10:55:03.509  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 11:22:03.228  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 15:04:02.495  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 16:07:35.181  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-07 19:40:41.562  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-08 10:11:15.458  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
-2022-12-08 10:11:17.230  WARN main refresh(AbstractApplicationContext.java:591) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8090 is already in use
-2022-12-08 10:11:17.304 ERROR main report(LoggingFailureAnalysisReporter.java:40) 
-
-***************************
-APPLICATION FAILED TO START
-***************************
-
-Description:
-
-Web server failed to start. Port 8090 was already in use.
-
-Action:
-
-Identify and stop the process that's listening on port 8090 or configure this application to listen on another port.
-
-2022-12-08 10:12:59.775  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
+2022-12-12 15:36:33.796  WARN main handleDeployment(Bootstrap.java:68) UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used

+ 2 - 1
report-fd/build/resources/main/application.yaml

@@ -36,4 +36,5 @@ logging:
 #  宁夏谷歌浏览器地址:
 chromeDriver: C:\Users\戴尔\AppData\Local\Google\Chrome\Application\chromedriver.exe
 #   宁夏新能源miss系统登录密码   AHbl***2022
-password: AHbl***2020
+#   山西新能源miss系统登录密码   AHbl***2020
+password: AHbl***2022

+ 5 - 6
report-fd/build/resources/main/templates/FaultReport.html

@@ -12,11 +12,9 @@
 
 <body>
 <ul class="layui-nav layui-bg-blue" lay-bar="disabled">
-    <li class="layui-nav-item"><a href="http://localhost:8090/indexPro">报导入</a></li>
+    <li class="layui-nav-item"><a href="http://localhost:8090/indexPro">风电生产日报导入</a></li>
     <li class="layui-nav-item"><a href=""></a></li>
-<!--
-    <li class="layui-nav-item layui-this"><a href="http://localhost:8090/indexFault">故障日报导入</a></li>
--->
+    <li class="layui-nav-item layui-this"><a href="http://localhost:8090/indexFault">风电故障日报导入</a></li>
 
 </ul>
 <div class="layui-form-item" style="height: 30px"></div>
@@ -28,8 +26,9 @@
             <label class="layui-form-label">区域</label>
             <div class="layui-input-block">
                 <select name="interest" lay-filter="aihao" id = "departId">
-                    <option value="185SC">山西</option>
-                    <option value="131SC">太旗</option>
+<!--                    <option value="185SC">山西</option>-->
+<!--                    <option value="131SC">太旗</option>-->
+                    <option value="198sc">宁夏新能源</option>
                 </select>
             </div>
         </div>

+ 5 - 8
report-fd/build/resources/main/templates/productionReport.html

@@ -12,11 +12,9 @@
 
 <body>
 <ul class="layui-nav layui-bg-blue" lay-bar="disabled">
-    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >报导入</a></li>
+    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >风电生产日报导入</a></li>
     <li class="layui-nav-item"><a href=""></a></li>
-<!--
-    <li class="layui-nav-item"><a href="http://localhost:8090/indexFault" >故障日报导入</a></li>
--->
+    <li class="layui-nav-item"><a href="http://localhost:8090/indexFault" >风电故障日报导入</a></li>
 
 </ul>
 <div class="layui-form-item" style="height: 30px"></div>
@@ -28,10 +26,9 @@
             <label class="layui-form-label">区域</label>
             <div class="layui-input-block">
                 <select name="departId" lay-filter="aihao" id = "departId">
-                    <option value="185SC">山西</option>
-                    <option value="131SC">太旗</option>
-                    <!--<option value="317sc">海子井光伏</option>
-                    <option value="198sc">宁夏新能源</option>-->
+                    <!--<option value="185SC">山西</option>
+                    <option value="131SC">太旗</option>-->
+                    <option value="198sc">宁夏新能源</option>
                 </select>
             </div>
         </div>

+ 18 - 0
report-fd/src/main/java/com/gyee/wisdom/report/controller/ReportController.java

@@ -60,4 +60,22 @@ public class ReportController {
         return wrapper;
     }
 
+
+    @Operation(description = "故障日报报表导入")
+    @PostMapping(value = "/importFault")
+    @ResponseBody
+    public ResponseWrapper ImportFault(@RequestParam(value = "file", required = false) MultipartFile file,
+                                     HttpServletRequest request, String departId) throws Exception {
+
+        log.info("开始导入");
+        ResponseWrapper<T> wrapper = new ResponseWrapper<T>();
+        if (!file.isEmpty()) {
+            //得到三个sheet页数据
+            Map<Integer, List<String[]>> map = reportService.commonReport(file);
+            seleniumService.faultLoginAndWrite(map,departId);
+            wrapper.setMsg("填报成功");
+        }
+        return wrapper;
+    }
+
 }

+ 185 - 154
report-fd/src/main/java/com/gyee/wisdom/report/service/SeleniumService.java

@@ -351,11 +351,191 @@ public class SeleniumService {
             // 切出iframe
             driver.switchTo().defaultContent();
             //todo: 后续添加点击日报保存按钮
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (webDriver != null) {
+                webDriver.quit();
+            }
+        }
+    }
 
-            //故障报表填写
-            Thread.sleep(60000);
-            // 切出iframe,重新进入菜单
-            driver.switchTo().defaultContent();
+    private int faultType(String strings) {
+
+        //故障类型字典装换
+        if(strings.equals("机舱振动故障")){
+            return 2;
+        }else if (strings.equals("变频器故障")){
+            return 3;
+        }else if (strings.equals("发电机故障")){
+            return 4;
+        }else if (strings.equals("齿轮箱故障")){
+            return 5;
+        }else if (strings.equals("箱变故障")){
+            return 6;
+        }else if (strings.equals("偏航系统故障")){
+            return 7;
+        }else if (strings.equals("液压系统故障")){
+            return 8;
+        }else if (strings.equals("电网故障")){
+            return 9;
+        }else if (strings.equals("控制柜制冷故障")){
+            return 10;
+        }else if (strings.equals("控制柜加热故障")){
+            return 11;
+        }else if (strings.equals("UPS故障")){
+            return 12;
+        }else if (strings.equals("FROFIBUS故障")){
+            return 13;
+        }else if (strings.equals("风速风向故障")){
+            return 14;
+        }else if (strings.equals("防雷保护故障")){
+            return 15;
+        }else if (strings.equals("初始化故障")){
+            return 16;
+        }else if (strings.equals("熔丝类故障")){
+            return 17;
+        }else if (strings.equals("CPU故障")){
+            return 18;
+        }else if (strings.equals("机舱冷却类故障")){
+            return 19;
+        }else if (strings.equals("故障停机类故障")){
+            return 20;
+        }else if (strings.equals("故障停机类故障")){
+            return 21;
+        }else if (strings.equals("转子位置类故障")){
+            return 22;
+        }else if (strings.equals("主轴类故障")){
+            return 23;
+        }else if (strings.equals("LUST变桨故障")){
+            return 24;
+        }else if (strings.equals("SSB变桨故障")){
+            return 25;
+        }else if (strings.equals("航灯类故障")){
+            return 26;
+        }else if (strings.equals("转速类故障")){
+            return 27;
+        }else if (strings.equals("安全链故障")){
+            return 28;
+        }else if (strings.equals("结冰类故障")){
+            return 29;
+        }else if (strings.equals("35KV电缆故障")){
+            return 30;
+        }else if (strings.equals("35KV集电线路故障")){
+            return 31;
+        }else if (strings.equals("35KV配电系统故障")){
+            return 32;
+        }else if (strings.equals("35KV以上输配电系统故障")){
+            return 33;
+        }else if (strings.equals("送出线路故障")){
+            return 34;
+        }
+        return 1;
+    }
+
+    private int windpowerSataion(String strings) {
+
+        //山西场站状态字段字典装换
+        if(strings.equals("右玉高家堡一期")){
+            return 2;
+        }else if (strings.equals("大仁庄二期第一批5万")){
+            return 3;
+        }else if (strings.equals("虎头山三期第二批")){
+            return 4;
+        }else if (strings.equals("大仁庄二期第二批")){
+            return 5;
+        }else if (strings.equals("大仁庄一期")){
+            return 6;
+        }else if (strings.equals("吕梁马坊风电场")){
+            return 7;
+        }else if (strings.equals("阳高采凉山风电场")){
+            return 8;
+        }else if (strings.equals("吕梁马坊二期")){
+            return 9;
+        }else if (strings.equals("阳高采凉山二期")){
+            return 10;
+        }else if (strings.equals("虎头山三期二阶段")){
+            return 11;
+        }else if (strings.equals("右玉高家堡二期")){
+            return 12;
+        }else if (strings.equals("右玉高家堡三期")){
+            return 13;
+        }else if (strings.equals("虎头山一期")){
+            return 14;
+        }else if (strings.equals("虎头山二期")){
+            return 15;
+        }else if (strings.equals("右玉高家堡四期")){
+            return 16;
+        }else if (strings.equals("虎头山三期第一批")){
+            return 17;
+        }else if (strings.equals("广灵南村镇一期")){
+            return 18;
+        }else if (strings.equals("虎头山风电场四期")){
+            return 19;
+        }
+        //太旗场站
+        else if (strings.equals("太仆寺旗一期")){
+            return 2;
+        }else if (strings.equals("太仆寺旗二期")){
+            return 3;
+        }else if (strings.equals("太仆寺旗三期")){
+            return 4;
+        }
+        //宁夏场站
+        return 1;
+    }
+
+
+    public int dataictonary(String strings){
+        //状态字段字典装换
+        if(strings.equals("运行")){
+            return 2;
+        }else if (strings.equals("备用")){
+            return 3;
+        }else if (strings.equals("D检")){
+            return 4;
+        }else if (strings.equals("C检")){
+            return 5;
+        }else if (strings.equals("B检")){
+            return 6;
+        }else if (strings.equals("A检")){
+            return 7;
+        }else if (strings.equals("临检")){
+            return 8;
+        }else if (strings.equals("停用")){
+            return 9;
+        }
+        return 1;
+    }
+
+    public void faultLoginAndWrite(Map<Integer, List<String[]>> map, String departId) {
+
+        WebDriver webDriver = null;
+        try {
+            System.out.println("打开浏览器进行操作");
+            System.setProperty(driver1,chromeDriver);
+            WebDriver driver = new ChromeDriver();
+            driver.manage().window().maximize();//浏览器最大化
+            //超时等待30秒
+            Duration duration = Duration.ofSeconds(30);
+            driver.manage().timeouts().implicitlyWait(duration);
+            //跳转到浏览器
+            driver.get("http://10.65.17.158:7001/Liems/");
+            Thread.sleep(2000);
+            //操作浏览器 获取到输入框
+            WebElement kk = driver.findElement(By.id("userName"));
+            //然后向输入框输入selenium java
+            kk.sendKeys(departId);
+            Thread.sleep(1000);
+            //操作浏览器 获取到输入框
+            WebElement kk2 = driver.findElement(By.id("password"));
+            //然后向输入框输入selenium java
+            kk2.sendKeys(password);
+            Thread.sleep(1000);
+            WebElement btn = driver.findElement(By.id("submitBtn"));
+            Actions actions = new Actions(driver);
+            //对按钮进行点击操作
+            btn.click();
             WebElement btntop = driver.findElement(By.id("topMenuDiv_0_-01100001602"));
             btntop.click();
             Thread.sleep(2000);
@@ -388,7 +568,7 @@ public class SeleniumService {
                 report1_B.click();
                 WebElement odiv_0 = driver.findElement(By.id("odiv_0"));
                 driver.switchTo().frame(odiv_0);
-                int s = cacheService.getSerial(listExcel.get(i - 4)[0], departId);
+                int s = cacheService.getSerial(listFault.get(i - 4)[0], departId);
                 WebElement div1 = driver.findElement(By.xpath("//html/body/div[1]/table/tbody/tr[" + s + "]"));
                 actions.moveToElement(div1).click().perform();
                 driver.switchTo().defaultContent();
@@ -518,153 +698,4 @@ public class SeleniumService {
             }
         }
     }
-
-    private int faultType(String strings) {
-
-        //故障类型字典装换
-        if(strings.equals("机舱振动故障")){
-            return 2;
-        }else if (strings.equals("变频器故障")){
-            return 3;
-        }else if (strings.equals("发电机故障")){
-            return 4;
-        }else if (strings.equals("齿轮箱故障")){
-            return 5;
-        }else if (strings.equals("箱变故障")){
-            return 6;
-        }else if (strings.equals("偏航系统故障")){
-            return 7;
-        }else if (strings.equals("液压系统故障")){
-            return 8;
-        }else if (strings.equals("电网故障")){
-            return 9;
-        }else if (strings.equals("控制柜制冷故障")){
-            return 10;
-        }else if (strings.equals("控制柜加热故障")){
-            return 11;
-        }else if (strings.equals("UPS故障")){
-            return 12;
-        }else if (strings.equals("FROFIBUS故障")){
-            return 13;
-        }else if (strings.equals("风速风向故障")){
-            return 14;
-        }else if (strings.equals("防雷保护故障")){
-            return 15;
-        }else if (strings.equals("初始化故障")){
-            return 16;
-        }else if (strings.equals("熔丝类故障")){
-            return 17;
-        }else if (strings.equals("CPU故障")){
-            return 18;
-        }else if (strings.equals("机舱冷却类故障")){
-            return 19;
-        }else if (strings.equals("故障停机类故障")){
-            return 20;
-        }else if (strings.equals("故障停机类故障")){
-            return 21;
-        }else if (strings.equals("转子位置类故障")){
-            return 22;
-        }else if (strings.equals("主轴类故障")){
-            return 23;
-        }else if (strings.equals("LUST变桨故障")){
-            return 24;
-        }else if (strings.equals("SSB变桨故障")){
-            return 25;
-        }else if (strings.equals("航灯类故障")){
-            return 26;
-        }else if (strings.equals("转速类故障")){
-            return 27;
-        }else if (strings.equals("安全链故障")){
-            return 28;
-        }else if (strings.equals("结冰类故障")){
-            return 29;
-        }else if (strings.equals("35KV电缆故障")){
-            return 30;
-        }else if (strings.equals("35KV集电线路故障")){
-            return 31;
-        }else if (strings.equals("35KV配电系统故障")){
-            return 32;
-        }else if (strings.equals("35KV以上输配电系统故障")){
-            return 33;
-        }else if (strings.equals("送出线路故障")){
-            return 34;
-        }
-        return 1;
-    }
-
-    private int windpowerSataion(String strings) {
-
-        //山西场站状态字段字典装换
-        if(strings.equals("右玉高家堡一期")){
-            return 2;
-        }else if (strings.equals("大仁庄二期第一批5万")){
-            return 3;
-        }else if (strings.equals("虎头山三期第二批")){
-            return 4;
-        }else if (strings.equals("大仁庄二期第二批")){
-            return 5;
-        }else if (strings.equals("大仁庄一期")){
-            return 6;
-        }else if (strings.equals("吕梁马坊风电场")){
-            return 7;
-        }else if (strings.equals("阳高采凉山风电场")){
-            return 8;
-        }else if (strings.equals("吕梁马坊二期")){
-            return 9;
-        }else if (strings.equals("阳高采凉山二期")){
-            return 10;
-        }else if (strings.equals("虎头山三期二阶段")){
-            return 11;
-        }else if (strings.equals("右玉高家堡二期")){
-            return 12;
-        }else if (strings.equals("右玉高家堡三期")){
-            return 13;
-        }else if (strings.equals("虎头山一期")){
-            return 14;
-        }else if (strings.equals("虎头山二期")){
-            return 15;
-        }else if (strings.equals("右玉高家堡四期")){
-            return 16;
-        }else if (strings.equals("虎头山三期第一批")){
-            return 17;
-        }else if (strings.equals("广灵南村镇一期")){
-            return 18;
-        }else if (strings.equals("虎头山风电场四期")){
-            return 19;
-        }
-        //太旗场站
-        else if (strings.equals("太仆寺旗一期")){
-            return 2;
-        }else if (strings.equals("太仆寺旗二期")){
-            return 3;
-        }else if (strings.equals("太仆寺旗三期")){
-            return 4;
-        }
-        //宁夏场站
-        return 1;
-    }
-
-
-    public int dataictonary(String strings){
-        //状态字段字典装换
-        if(strings.equals("运行")){
-            return 2;
-        }else if (strings.equals("备用")){
-            return 3;
-        }else if (strings.equals("D检")){
-            return 4;
-        }else if (strings.equals("C检")){
-            return 5;
-        }else if (strings.equals("B检")){
-            return 6;
-        }else if (strings.equals("A检")){
-            return 7;
-        }else if (strings.equals("临检")){
-            return 8;
-        }else if (strings.equals("停用")){
-            return 9;
-        }
-        return 1;
-    }
-
 }

+ 2 - 1
report-fd/src/main/resources/application.yaml

@@ -36,4 +36,5 @@ logging:
 #  宁夏谷歌浏览器地址:
 chromeDriver: C:\Users\戴尔\AppData\Local\Google\Chrome\Application\chromedriver.exe
 #   宁夏新能源miss系统登录密码   AHbl***2022
-password: AHbl***2020
+#   山西新能源miss系统登录密码   AHbl***2020
+password: AHbl***2022

+ 5 - 6
report-fd/src/main/resources/templates/FaultReport.html

@@ -12,11 +12,9 @@
 
 <body>
 <ul class="layui-nav layui-bg-blue" lay-bar="disabled">
-    <li class="layui-nav-item"><a href="http://localhost:8090/indexPro">报导入</a></li>
+    <li class="layui-nav-item"><a href="http://localhost:8090/indexPro">风电生产日报导入</a></li>
     <li class="layui-nav-item"><a href=""></a></li>
-<!--
-    <li class="layui-nav-item layui-this"><a href="http://localhost:8090/indexFault">故障日报导入</a></li>
--->
+    <li class="layui-nav-item layui-this"><a href="http://localhost:8090/indexFault">风电故障日报导入</a></li>
 
 </ul>
 <div class="layui-form-item" style="height: 30px"></div>
@@ -28,8 +26,9 @@
             <label class="layui-form-label">区域</label>
             <div class="layui-input-block">
                 <select name="interest" lay-filter="aihao" id = "departId">
-                    <option value="185SC">山西</option>
-                    <option value="131SC">太旗</option>
+<!--                    <option value="185SC">山西</option>-->
+<!--                    <option value="131SC">太旗</option>-->
+                    <option value="198sc">宁夏新能源</option>
                 </select>
             </div>
         </div>

+ 5 - 8
report-fd/src/main/resources/templates/productionReport.html

@@ -12,11 +12,9 @@
 
 <body>
 <ul class="layui-nav layui-bg-blue" lay-bar="disabled">
-    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >报导入</a></li>
+    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >风电生产日报导入</a></li>
     <li class="layui-nav-item"><a href=""></a></li>
-<!--
-    <li class="layui-nav-item"><a href="http://localhost:8090/indexFault" >故障日报导入</a></li>
--->
+    <li class="layui-nav-item"><a href="http://localhost:8090/indexFault" >风电故障日报导入</a></li>
 
 </ul>
 <div class="layui-form-item" style="height: 30px"></div>
@@ -28,10 +26,9 @@
             <label class="layui-form-label">区域</label>
             <div class="layui-input-block">
                 <select name="departId" lay-filter="aihao" id = "departId">
-                    <option value="185SC">山西</option>
-                    <option value="131SC">太旗</option>
-                    <!--<option value="317sc">海子井光伏</option>
-                    <option value="198sc">宁夏新能源</option>-->
+                    <!--<option value="185SC">山西</option>
+                    <option value="131SC">太旗</option>-->
+                    <option value="198sc">宁夏新能源</option>
                 </select>
             </div>
         </div>

+ 1 - 1
report-gf/src/main/java/com/gyee/wisdom/report/config/MyJsonConfig.java

@@ -18,7 +18,7 @@ import java.util.TimeZone;
 
 /**
  * @description:
- * @auther: Wanghs
+ * @auther: xugp
  * @date: 2022-04-06
  */
 @Configuration

+ 2 - 2
report-gf/src/main/java/com/gyee/wisdom/report/config/MyWebAppConfigurer.java

@@ -15,9 +15,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 /**
  * 拦截器
  *
- * @author gyee
+ * @author xugp
  * @ClassName: MyWebAppConfigurer
- * @date 2018年6月3
+ * @date 2022年12月01
  */
 @Configuration
 public class MyWebAppConfigurer implements WebMvcConfigurer {

+ 0 - 7
report-gf/src/main/java/com/gyee/wisdom/report/controller/IndexController.java

@@ -21,11 +21,4 @@ public class IndexController {
         return "productionReport";
     }
 
-
-    //miss故障日报
-    @RequestMapping("/indexFault")
-    public String indexFault()
-    {
-        return "FaultReport";
-    }
 }

+ 1 - 1
report-gf/src/main/java/com/gyee/wisdom/report/controller/TestController.java

@@ -28,7 +28,7 @@ public class TestController {
             //操作浏览器 获取到输入框
             WebElement kk = driver.findElement(By.id("kw"));
             //然后向百度输入框输入selenium java
-            kk.sendKeys("如也");
+            kk.sendKeys("java");
             //通过元素属性id=su找到百度一下搜索按钮
             WebElement btn = driver.findElement(By.id("su"));
             //对按钮进行点击操作

+ 17 - 84
report-gf/src/main/java/com/gyee/wisdom/report/service/SeleniumService.java

@@ -36,6 +36,8 @@ public class SeleniumService {
     public void loginAndWrite(Map<Integer, List<String[]>> map, String departId) {
         WebDriver webDriver = null;
         try {
+            List<String[]> strings = map.get(1);
+            strings.remove(0);
             //截取excel行
             List<String[]> list3 = map.get(2);
             List<String[]> listExcel = list3.subList(5,list3.size()-1);
@@ -76,8 +78,6 @@ public class SeleniumService {
 
 
             //填写frameL表格数据
-            List<String[]> strings = map.get(1);
-            strings.remove(0);
             System.out.println("开始填写Left数据");
             WebElement mainFrame2 = driver.findElement(By.id("mainFrame"));
             driver.switchTo().frame(mainFrame2);
@@ -106,81 +106,66 @@ public class SeleniumService {
             WebElement report1_D25 = report2.findElement(By.id("report1_D25"));
             actions.doubleClick(report1_D25).sendKeys(strings.get(6)[1]).perform();
 
-            WebElement report1_D26 = report2.findElement(By.id("report1_D26"));
-            actions.doubleClick(report1_D26).sendKeys(strings.get(7)[1]).perform();
-
             WebElement report1_D28 = report2.findElement(By.id("report1_D28"));
-            actions.doubleClick(report1_D28).sendKeys(strings.get(8)[1]).perform();
+            actions.doubleClick(report1_D28).sendKeys(strings.get(7)[1]).perform();
 
             WebElement report1_D29 = report2.findElement(By.id("report1_D29"));
-            actions.doubleClick(report1_D29).sendKeys(strings.get(9)[1]).perform();
-
-            WebElement report1_D35 = report2.findElement(By.id("report1_D35"));
-            actions.doubleClick(report1_D35).sendKeys(strings.get(12)[1]).perform();
+            actions.doubleClick(report1_D29).sendKeys(strings.get(8)[1]).perform();
 
             WebElement report1_D36 = report2.findElement(By.id("report1_D36"));
             report1_D36.click();
             WebElement report1_editBox = driver.findElement(By.id("report1_editBox"));
             report1_editBox.clear();
-            System.out.println(strings.get(13)[1]);
-            report1_editBox.sendKeys(strings.get(13)[1]);
+            report1_editBox.sendKeys(strings.get(11)[1]);
 
             WebElement report1_D43 = report2.findElement(By.id("report1_D43"));
             report1_D43.click();
             WebElement report1_editBox5 = driver.findElement(By.id("report1_editBox"));
             report1_editBox5.clear();
-            report1_editBox5.sendKeys(strings.get(14)[1]);
+            report1_editBox5.sendKeys(strings.get(12)[1]);
 
             WebElement report1_D44 = report2.findElement(By.id("report1_D44"));
             report1_D44.click();
             WebElement report1_editBox4 = driver.findElement(By.id("report1_editBox"));
             report1_editBox4.clear();
-            report1_editBox4.sendKeys(strings.get(15)[1]);
-            System.out.println(strings.get(15)[1]);
+            report1_editBox4.sendKeys(strings.get(13)[1]);
 
             WebElement report1_D45 = report2.findElement(By.id("report1_D45"));
-            actions.doubleClick(report1_D45).sendKeys(strings.get(16)[1]).perform();
+            actions.doubleClick(report1_D45).sendKeys(strings.get(14)[1]).perform();
 
             WebElement report1_D46 = report2.findElement(By.id("report1_D46"));
-            actions.doubleClick(report1_D46).sendKeys(strings.get(17)[1]).perform();
+            actions.doubleClick(report1_D46).sendKeys(strings.get(15)[1]).perform();
 
             WebElement report1_D48 = report2.findElement(By.id("report1_D48"));
             report1_D48.click();
             WebElement report1_editBox6 = driver.findElement(By.id("report1_editBox"));
             report1_editBox6.clear();
-            report1_editBox6.sendKeys(strings.get(18)[1]);
-            actions.doubleClick(report1_D48).sendKeys(strings.get(18)[1]).perform();
+            report1_editBox6.sendKeys(strings.get(16)[1]);
+            actions.doubleClick(report1_D48).sendKeys(strings.get(16)[1]).perform();
 
             WebElement report1_D52 = report2.findElement(By.id("report1_D52"));
             report1_D52.click();
             WebElement report1_editBox2 = driver.findElement(By.id("report1_editBox"));
             report1_editBox2.clear();
-            report1_editBox2.sendKeys(strings.get(19)[1]);
-            System.out.println(strings.get(19)[1]);
+            report1_editBox2.sendKeys(strings.get(17)[1]);
 
             WebElement report1_D56 = report2.findElement(By.id("report1_D56"));
             report1_D56.click();
             WebElement report1_editBox7 = driver.findElement(By.id("report1_editBox"));
             report1_editBox7.clear();
-            report1_editBox7.sendKeys(strings.get(20)[1]);
-
-            WebElement report1_D57 = report2.findElement(By.id("report1_D57"));
-            report1_D57.click();
-            WebElement report1_editBox3 = driver.findElement(By.id("report1_editBox"));
-            report1_editBox3.clear();
-            report1_editBox3.sendKeys(strings.get(21)[1]);
+            report1_editBox7.sendKeys(strings.get(18)[1]);
 
-            WebElement report1_D62 = report2.findElement(By.id("report1_D62"));
-            report1_D62.click();
+            WebElement report1_D63 = report2.findElement(By.id("report1_D63"));
+            report1_D63.click();
             WebElement report1_editBox8 = driver.findElement(By.id("report1_editBox"));
             report1_editBox8.clear();
-            report1_editBox8.sendKeys(strings.get(22)[1]);
+            report1_editBox8.sendKeys(strings.get(19)[1]);
 
             WebElement report1_D79 = report2.findElement(By.id("report1_D79"));
             report1_D79.click();
             WebElement report1_textArea = driver.findElement(By.id("report1_textArea"));
             report1_textArea.clear();
-            actions.doubleClick(report1_textArea).sendKeys(strings.get(23)[1]).perform();
+            actions.doubleClick(report1_textArea).sendKeys(strings.get(20)[1]).perform();
             System.out.println("------------leftData表格数据填写完成------------------");
             // 切出iframe
             driver.switchTo().defaultContent();
@@ -592,58 +577,6 @@ public class SeleniumService {
         return 1;
     }
 
-    private int windpowerSataion(String strings) {
-
-        //山西场站状态字段字典装换
-        if(strings.equals("右玉高家堡一期")){
-            return 2;
-        }else if (strings.equals("大仁庄二期第一批5万")){
-            return 3;
-        }else if (strings.equals("虎头山三期第二批")){
-            return 4;
-        }else if (strings.equals("大仁庄二期第二批")){
-            return 5;
-        }else if (strings.equals("大仁庄一期")){
-            return 6;
-        }else if (strings.equals("吕梁马坊风电场")){
-            return 7;
-        }else if (strings.equals("阳高采凉山风电场")){
-            return 8;
-        }else if (strings.equals("吕梁马坊二期")){
-            return 9;
-        }else if (strings.equals("阳高采凉山二期")){
-            return 10;
-        }else if (strings.equals("虎头山三期二阶段")){
-            return 11;
-        }else if (strings.equals("右玉高家堡二期")){
-            return 12;
-        }else if (strings.equals("右玉高家堡三期")){
-            return 13;
-        }else if (strings.equals("虎头山一期")){
-            return 14;
-        }else if (strings.equals("虎头山二期")){
-            return 15;
-        }else if (strings.equals("右玉高家堡四期")){
-            return 16;
-        }else if (strings.equals("虎头山三期第一批")){
-            return 17;
-        }else if (strings.equals("广灵南村镇一期")){
-            return 18;
-        }else if (strings.equals("虎头山风电场四期")){
-            return 19;
-        }
-        //太旗场站
-        else if (strings.equals("太仆寺旗一期")){
-            return 2;
-        }else if (strings.equals("太仆寺旗二期")){
-            return 3;
-        }else if (strings.equals("太仆寺旗三期")){
-            return 4;
-        }
-        //宁夏场站
-        return 1;
-    }
-
 
     public int dataictonary(String strings){
         //状态字段字典装换

BIN
report-gf/src/main/resources/report.db


+ 1 - 1
report-gf/src/main/resources/templates/productionReport.html

@@ -12,7 +12,7 @@
 
 <body>
 <ul class="layui-nav layui-bg-blue" lay-bar="disabled">
-    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >报表导入</a></li>
+    <li class="layui-nav-item layui-this" ><a href="http://localhost:8090/indexPro" >光伏报表导入</a></li>
     <li class="layui-nav-item"><a href=""></a></li>
 <!--
     <li class="layui-nav-item"><a href="http://localhost:8090/indexFault" >故障日报导入</a></li>