系统更新
This commit is contained in:
parent
ac520b2e4c
commit
9d46f884bc
|
|
@ -70,7 +70,18 @@ public class DutyChangeShifts {
|
||||||
//交接事项说明
|
//交接事项说明
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
// /html/body/div[3]/div/div[2]/div/form/div[7]/div/div[1]/textarea
|
// /html/body/div[3]/div/div[2]/div/form/div[7]/div/div[1]/textarea
|
||||||
|
|
||||||
|
try {
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
|
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("交接事项说明----------");
|
log.info("交接事项说明----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
//提交
|
//提交
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,8 @@ public class DutyClock {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void openDutyClock() throws InterruptedException {
|
public void openDutyClock() throws InterruptedException {
|
||||||
Thread.sleep(1000*4);
|
Thread.sleep(1000 * 4);
|
||||||
//定位值班打卡并点击
|
//定位值班打卡并点击
|
||||||
webDriver.findElement(By.id("tab-2")).click();
|
webDriver.findElement(By.id("tab-2")).click();
|
||||||
log.info("定位值班打卡并点击----------");
|
log.info("定位值班打卡并点击----------");
|
||||||
|
|
@ -64,14 +63,47 @@ public class DutyClock {
|
||||||
xpaht = "//*[@id=\"pane-2\"]/div/div[3]/div[2]/div[1]/div[2]/button[2]";
|
xpaht = "//*[@id=\"pane-2\"]/div/div[3]/div[2]/div[1]/div[2]/button[2]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread.sleep(1000*4);
|
|
||||||
|
Thread.sleep(1000 * 4);
|
||||||
webDriver.findElement(By.xpath(xpaht)).click();
|
webDriver.findElement(By.xpath(xpaht)).click();
|
||||||
log.info("打卡签到----------");
|
log.info("打卡签到----------");
|
||||||
Thread.sleep(1000*5);
|
|
||||||
|
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();
|
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();
|
||||||
log.info("点击弹出框确认----------");
|
log.info("点击弹出框确认----------");
|
||||||
Thread.sleep(800);
|
Thread.sleep(800);
|
||||||
}
|
}
|
||||||
|
|
@ -99,19 +131,19 @@ public class DutyClock {
|
||||||
td = dayNum - 1;
|
td = dayNum - 1;
|
||||||
}*/
|
}*/
|
||||||
if (dayNum == 1) {
|
if (dayNum == 1) {
|
||||||
if(DateTimeUtils.getMonthOneDayIs0()){//第一天是0
|
if (DateTimeUtils.getMonthOneDayIs0()) {//第一天是0
|
||||||
tr = weekNum;
|
tr = weekNum;
|
||||||
}else{
|
} else {
|
||||||
tr = weekNum-1;
|
tr = weekNum - 1;
|
||||||
if (weekNum == 1){
|
if (weekNum == 1) {
|
||||||
tr = 5;
|
tr = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
td = 7;
|
td = 7;
|
||||||
}else {
|
} else {
|
||||||
if(DateTimeUtils.getMonthOneDayIs0()){//第一天是0
|
if (DateTimeUtils.getMonthOneDayIs0()) {//第一天是0
|
||||||
tr = weekNum+1;
|
tr = weekNum + 1;
|
||||||
}else{
|
} else {
|
||||||
tr = weekNum;
|
tr = weekNum;
|
||||||
}
|
}
|
||||||
td = dayNum - 1;
|
td = dayNum - 1;
|
||||||
|
|
@ -124,7 +156,7 @@ public class DutyClock {
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
//获取上月最后一天日期
|
//获取上月最后一天日期
|
||||||
String mothDay=DateTimeUtils.getBeforeLastMonthdate();
|
String mothDay = DateTimeUtils.getBeforeLastMonthdate();
|
||||||
//判断上个月最后一天的位置
|
//判断上个月最后一天的位置
|
||||||
tr = DateTimeUtils.getWeekNum(mothDay);
|
tr = DateTimeUtils.getWeekNum(mothDay);
|
||||||
td = DateTimeUtils.getWeekOfDate(mothDay);
|
td = DateTimeUtils.getWeekOfDate(mothDay);
|
||||||
|
|
@ -144,7 +176,7 @@ public class DutyClock {
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
//进行晚班签退操作
|
//进行晚班签退操作
|
||||||
log.info("进行晚班签退操作----------");
|
log.info("进行晚班签退操作----------");
|
||||||
dutyClockOper(2,2);
|
dutyClockOper(2, 2);
|
||||||
|
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,21 @@ public class DutyLogIOp {
|
||||||
log.info("提交日志----------");
|
log.info("提交日志----------");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
|
//判断是否有相应的元素
|
||||||
|
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]----------");
|
||||||
|
}
|
||||||
|
|
||||||
//点击弹出框确认 /html/body/div[4]/div/div[3]/button[2]
|
//点击弹出框确认 /html/body/div[4]/div/div[3]/button[2]
|
||||||
WebElement qrBtn = webDriver.findElement(By.xpath("/html/body/div[4]/div/div[3]/button[2]"));
|
WebElement qrBtn = webDriver.findElement(By.xpath("/html/body/div[4]/div/div[3]/button[2]"));
|
||||||
|
|
@ -379,7 +394,7 @@ public class DutyLogIOp {
|
||||||
WebElement dutyIframe = webDriver.findElement(By.id("zbgln"));
|
WebElement dutyIframe = webDriver.findElement(By.id("zbgln"));
|
||||||
webDriver.switchTo().frame(dutyIframe);
|
webDriver.switchTo().frame(dutyIframe);
|
||||||
log.info("定位值班管理iframe的标签----------");
|
log.info("定位值班管理iframe的标签----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(3000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue