系统更新

This commit is contained in:
zfh 2025-02-28 16:30:10 +08:00
parent 3d843da853
commit 858ca63bbd
5 changed files with 148 additions and 8 deletions

View File

@ -1,7 +1,5 @@
package com.bonus.autoweb;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.bonus.autoweb.UI.entity.WeatherData;
import com.bonus.autoweb.base.DataConfig;
import com.bonus.autoweb.task.AutoWebTask;

View File

@ -70,8 +70,18 @@ public class DutyChangeShifts {
//交接事项说明
if (type == 1) {
// /html/body/div[3]/div/div[2]/div/form/div[7]/div/div[1]/textarea
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
log.info("交接事项说明----------");
try {
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
}catch (Exception e){
log.info("交接事项说明div[3]不存在----------");
}
try {
webDriver.findElement(By.xpath("/html/body/div[8]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
}catch (Exception e){
log.info("交接事项说明div[8]不存在----------");
} log.info("交接事项说明----------");
Thread.sleep(500);
//提交
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[3]/div/button[2]")).click();
@ -175,4 +185,4 @@ public class DutyChangeShifts {
}
}
}

View File

@ -69,9 +69,40 @@ public class DutyClock {
log.info("打卡签到----------");
Thread.sleep(1000*5);
//判断是否有相应的元素
try {
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[2]/div/div[3]/button[2]")).click();
log.info("确认提前签到div[2]----------");
} catch (Exception e) {
log.info("无确认框,在时间范围内----------");
}
//判断是否有相应的元素
try {
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[6]/div/div[3]/button[2]")).click();
log.info("确认提前签到div[6]----------");
} catch (Exception e) {
log.info("无确认框,在时间范围内----------");
}
try {
//点击弹出框确认
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click();
} catch (Exception e) {
log.info("当前打卡确认按钮不存在div[2]");
}
try {
//点击弹出框确认
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/div[2]/div[1]")).click();
} catch (Exception e) {
log.info("当前打卡按钮不存在div[3]");
}
//点击弹出框确认
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click();
//webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click();
log.info("点击弹出框确认----------");
Thread.sleep(800);
}

View File

@ -319,6 +319,22 @@ public class DutyLogIOp {
log.info("提交日志----------");
Thread.sleep(300);
//判断是否有相应的元素
try{
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[3]/div/div[3]/button[2]")).click();
log.info("是否确认签到----------");
}catch (Exception e){
log.info("无确认框在时间范围内div[3]----------");
}
try{
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[4]/div/div[3]/button[2]")).click();
log.info("是否确认签到----------");
}catch (Exception e){
log.info("无确认框在时间范围内div[4]----------");
}
//点击弹出框确认
WebElement qrBtn=webDriver.findElement(By.xpath("/html/body/div[4]/div/div[3]/button[2]"));
@ -341,14 +357,14 @@ public class DutyLogIOp {
//退出当前iframe,
webDriver.switchTo().defaultContent();
log.info("退出当前iframe----------");
Thread.sleep(300);
Thread.sleep(3000);
//定位值班管理iframe的标签
WebElement dutyIframe = webDriver.findElement(By.id("zbgln"));
webDriver.switchTo().frame(dutyIframe);
log.info("定位值班管理iframe的标签----------");
Thread.sleep(300);
Thread.sleep(3000);
}

85
pom.xml Normal file
View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>autoWebForSiXian</groupId>
<artifactId>autoWebForSiXian</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.hynnet</groupId>
<artifactId>jacob</artifactId>
<version>1.18</version>
</dependency>
<!--log4j-->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.26</version>
</dependency>
</dependencies>
</project>