|
@@ -8,9 +8,11 @@ import cn.cslg.pas.common.dto.business.LiteratureQueryDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
import cn.cslg.pas.common.utils.GenerateObjectUtil;
|
|
|
import cn.cslg.pas.common.vo.CompareLiteratureVO;
|
|
|
+import cn.cslg.pas.common.vo.GetReportInfoFromWDVO;
|
|
|
import cn.cslg.pas.common.vo.NoveltyProjectVO.NoveltyCompareLiteratureVO;
|
|
|
import cn.cslg.pas.common.vo.NoveltyProjectVO.NoveltyCompareRecordVO;
|
|
|
import cn.cslg.pas.common.vo.QueryCompareFileVO;
|
|
|
+import cn.cslg.pas.common.vo.QueryNoveltyProjectVO;
|
|
|
import cn.cslg.pas.domain.business.CompareLiterature;
|
|
|
import cn.cslg.pas.domain.es.Marking;
|
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
@@ -22,6 +24,8 @@ import cn.cslg.pas.service.business.CompareLiteratureService;
|
|
|
import cn.cslg.pas.service.business.es.EsPatentService;
|
|
|
import cn.cslg.pas.service.business.es.EsScratchWordsService;
|
|
|
import cn.cslg.pas.service.importPatent.ImportSinglePatentService;
|
|
|
+import cn.cslg.pas.service.permissions.GetReportInfoFromWDService;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -32,24 +36,18 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.openqa.selenium.By;
|
|
|
-import org.openqa.selenium.WebDriver;
|
|
|
import org.openqa.selenium.WebElement;
|
|
|
-import org.openqa.selenium.chrome.ChromeDriver;
|
|
|
-import org.openqa.selenium.chrome.ChromeOptions;
|
|
|
-import org.openqa.selenium.support.ui.ExpectedCondition;
|
|
|
-import org.openqa.selenium.support.ui.WebDriverWait;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import java.time.Duration;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -70,6 +68,9 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
private RetrieveRecordMapper retrieveRecordMapper;
|
|
|
|
|
|
@Autowired
|
|
|
+ private GetReportInfoFromWDService getReportInfoFromWDService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CompareLiteratureMapper compareLiteratureMapper;
|
|
|
@Autowired
|
|
|
private CompareLiteratureService compareLiteratureService;
|
|
@@ -79,6 +80,7 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
private EsPatentService esPatentService;
|
|
|
@Autowired
|
|
|
private ImportSinglePatentService importSinglePatentService;
|
|
|
+
|
|
|
public Records queryNoveltyCompareLiterature(LiteratureQueryDTO vo) throws Exception {
|
|
|
Integer projectId = vo.getProjectId();
|
|
|
Records records = new Records();
|
|
@@ -240,124 +242,21 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
compareLiteratureMapper.deleteById(vo.getCompareLitertureId());
|
|
|
}
|
|
|
|
|
|
- public Map<String, String> getReportInfoFromWD(String caseNo) {
|
|
|
- ChromeOptions options = new ChromeOptions();
|
|
|
-// options.addArguments("user-data-dir=" + strFileSavePath);
|
|
|
- options.addArguments("--lang=nl");
|
|
|
- options.addArguments("--disable-popup-blocking");
|
|
|
- options.addArguments("--disable-images");
|
|
|
- options.addArguments("--remote-allow-origins=*");
|
|
|
-// if (isHeadless) {
|
|
|
-// options.addArguments("headless");
|
|
|
-// }
|
|
|
-
|
|
|
- WebDriver driver = null;
|
|
|
- Map<String, String> retObject = new HashMap<>();
|
|
|
-
|
|
|
- try {
|
|
|
-// System.setProperty("webdriver.chrome.driver", chromeDriverPath);
|
|
|
- driver = new ChromeDriver(options);
|
|
|
-
|
|
|
- driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
|
|
|
- driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
|
|
|
-
|
|
|
-// driver.get(iPEasyWeb);
|
|
|
-
|
|
|
- //进入登录界面
|
|
|
- WebElement userField = driver.findElement(By.id("txtUser"));
|
|
|
- WebElement pwdField = driver.findElement(By.id("txtPwd"));
|
|
|
- WebElement loginButton = driver.findElement(By.id("btnLogin"));
|
|
|
- //输入用户名和密码
|
|
|
- userField.clear();
|
|
|
-// userField.sendKeys(account);
|
|
|
- pwdField.clear();
|
|
|
-// pwdField.sendKeys(password);
|
|
|
- //点击登录按钮
|
|
|
- loginButton.click();
|
|
|
-
|
|
|
- //关闭提示遮罩层
|
|
|
- WebElement closeOverlay = null;
|
|
|
- try {
|
|
|
- closeOverlay = driver.findElement(By.id("jpwClose"));
|
|
|
- if (closeOverlay.isDisplayed()) {
|
|
|
- closeOverlay.click();
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //点击顶部菜单栏中的案件管理菜单
|
|
|
- WebElement caseManagementMenu = driver.findElement(By.name("71A7CC35-F597-40E1-9FEF-BE622A3A3B63"));
|
|
|
- caseManagementMenu.click();
|
|
|
-
|
|
|
- //点击左侧 查询 菜单
|
|
|
- WebElement searchMenu = driver.findElement(By.name("c3266ab3-521a-4815-8aaf-7dd0bc5a76af"));
|
|
|
- searchMenu.click();
|
|
|
-
|
|
|
- //切换到自定义报表Frame
|
|
|
- driver.switchTo().frame(1);
|
|
|
-
|
|
|
- WebElement inputSearch = driver.findElement(By.id("case_volume"));
|
|
|
- inputSearch.sendKeys(caseNo.trim());
|
|
|
-
|
|
|
- WebElement btnSearch = driver.findElement(By.id("btn_Search"));
|
|
|
- btnSearch.click();
|
|
|
-
|
|
|
- WebElement caseLink = driver.findElement(By.xpath("//a[contains(text()," + caseNo + ")]"));
|
|
|
- caseLink.click();
|
|
|
-
|
|
|
- driver.switchTo().parentFrame().switchTo().frame(2);
|
|
|
-
|
|
|
- WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20));
|
|
|
- //等待页面上ID属性值为submitButton的元素加载完成
|
|
|
- WebElement myElement = wait.until((ExpectedCondition<WebElement>) wd -> {
|
|
|
- try {
|
|
|
- if (wd != null) {
|
|
|
- wd.switchTo().parentFrame().switchTo().frame(2);
|
|
|
- return wd.findElement(By.id("libase"));
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return null;
|
|
|
- });
|
|
|
-
|
|
|
- myElement.click();
|
|
|
-
|
|
|
- // 案件号
|
|
|
- retObject.put("CaseNo", caseNo.trim());
|
|
|
- //案件名称
|
|
|
- retObject.put("CaseName", driver.findElement(By.id("p_case_info__case_name")).getAttribute("value"));
|
|
|
- //客户名称
|
|
|
- retObject.put("CustomerName", driver.findElement(By.id("p_case_info__customer_id")).getAttribute("value"));
|
|
|
- //业务类型
|
|
|
- retObject.put("BusinessType", driver.findElement(By.id("p_case_info__business_type_id")).getAttribute("value"));
|
|
|
- retObject.put("CaseState", getSelectText(driver.findElement(By.id("p_case_info__case_status_id"))));
|
|
|
- retObject.put("ApplicationType", getSelectText(driver.findElement(By.id("p_case_info__apply_type_id"))));
|
|
|
-
|
|
|
- //案件类型
|
|
|
- retObject.put("CaseType", driver.findElement(By.id("p_case_info__case_type_id")).getAttribute("value"));
|
|
|
- //委案日期
|
|
|
- retObject.put("EntrustingDate", driver.findElement(By.id("p_case_info__charge_date")).getAttribute("value"));
|
|
|
- //案件备注
|
|
|
- retObject.put("CaseMemo", driver.findElement(By.id("p_case_info__remark")).getAttribute("value"));
|
|
|
-
|
|
|
- WebElement expandInfoButton = driver.findElement(By.xpath("//span[contains(text(),'扩展信息')]"));
|
|
|
- expandInfoButton.click();
|
|
|
- retObject.put("CaseCoefficient", getSelectText(driver.findElement(By.id("p_case_info__case_coefficient_id"))));
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException("An error occurred while retrieving case info", e);
|
|
|
- } finally {
|
|
|
- if (driver != null) {
|
|
|
- driver.quit();
|
|
|
+ public QueryNoveltyProjectVO getReportInfoFromWD(String caseNo) throws IOException {
|
|
|
+ String result = getReportInfoFromWDService.getReportInfoFromWD(caseNo);
|
|
|
+ QueryNoveltyProjectVO projectVO = new QueryNoveltyProjectVO();
|
|
|
+ if (StringUtils.isNotEmpty(result)) {
|
|
|
+ GetReportInfoFromWDVO wdvo = JSONObject.parseObject(result, GetReportInfoFromWDVO.class);
|
|
|
+ projectVO.setInnerCaseNumber(wdvo.getCaseNo());
|
|
|
+ projectVO.setCaseName(wdvo.getCaseName());
|
|
|
+ if (ObjectUtils.isNotEmpty(wdvo.getCustomer()) && StringUtils.isNotEmpty(wdvo.getCustomer().getName())) {
|
|
|
+ projectVO.setApplicants(wdvo.getCustomer().getName());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- return retObject;
|
|
|
+ return projectVO;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public static String getSelectText(WebElement element) {
|
|
|
String strValue = element.getAttribute("value");
|
|
|
|