Commit 0edfec5f by landerliang@163.com

判断多出一页的报告坐标

parent bfccfc59
...@@ -23,6 +23,7 @@ import me.zhengjie.modules.system.service.UploadRecordService; ...@@ -23,6 +23,7 @@ import me.zhengjie.modules.system.service.UploadRecordService;
import me.zhengjie.utils.AssertUtil; import me.zhengjie.utils.AssertUtil;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.JavascriptExecutor;
...@@ -792,7 +793,6 @@ public class CarReportUtil { ...@@ -792,7 +793,6 @@ public class CarReportUtil {
Document parse1 = Jsoup.parse(reportHtml); Document parse1 = Jsoup.parse(reportHtml);
String imgSrc = parse1.getElementById("qrImg").attr("src"); String imgSrc = parse1.getElementById("qrImg").attr("src");
Object[] cookies = reportDriver.manage().getCookies().toArray(); Object[] cookies = reportDriver.manage().getCookies().toArray();
byte[] respBytes = HttpUtil.createGet(imgSrc).header("Cookie", cookies[0].toString() + ";" + cookies[1].toString() + ";" + cookies[2].toString()).execute().bodyBytes(); byte[] respBytes = HttpUtil.createGet(imgSrc).header("Cookie", cookies[0].toString() + ";" + cookies[1].toString() + ";" + cookies[2].toString()).execute().bodyBytes();
...@@ -821,7 +821,21 @@ public class CarReportUtil { ...@@ -821,7 +821,21 @@ public class CarReportUtil {
Map<String, Object> resp = new HashMap<String,Object>(); Map<String, Object> resp = new HashMap<String,Object>();
String reportPath = getReportPath(fileName, ".pdf"); String reportPath = getReportPath(fileName, ".pdf");
resp.put("path",reportPath); resp.put("path",reportPath);
resp.put("pdfType",(reportHtml.contains("<td class=\"readyStatus\" colspan=\"2\"> OBD系统故障指示器 </td>")?1:0)); Elements wordCalids = parse1.getElementsByClass("word_calid");
boolean flag = false;
for (Element element:wordCalids) {
if(!element.html().contains("-")){
flag = true;
}
}
if(reportHtml.contains("<td class=\"readyStatus\" colspan=\"2\"> OBD系统故障指示器 </td>")){
resp.put("pdfType",1);
} /*else if(flag) {
resp.put("pdfType",2);
}*/ else {
resp.put("pdfType",0);
}
//resp.put("pdfType",(reportHtml.contains("<td class=\"readyStatus\" colspan=\"2\"> OBD系统故障指示器 </td>")?1:0));
return resp; return resp;
} catch (InterruptedException | UnsupportedEncodingException e) { } catch (InterruptedException | UnsupportedEncodingException e) {
driver.close(); driver.close();
......
...@@ -5,7 +5,7 @@ spring: ...@@ -5,7 +5,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev active: prod
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment