|
@@ -2289,7 +2289,7 @@ public class ExcelTabController extends BladeController {
|
|
|
})
|
|
|
public R<String> getTheLogPdInfo(String pkeyId, String nodePrimaryKeyId, String recordTime, String contractId) throws Exception {
|
|
|
//获取配置的路径
|
|
|
- String file_path = "/Users/hongchuangyanfa/Desktop/" ;//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ String file_path = FileUtils.getSysLocalFileUrl();
|
|
|
if (StringUtils.isEmpty(recordTime)) {
|
|
|
recordTime = DateUtil.format(DateUtil.now(), "yyyy-MM-dd");
|
|
|
}
|
|
@@ -2578,20 +2578,15 @@ public class ExcelTabController extends BladeController {
|
|
|
String querySql = "SELECT * FROM " + tabName + " WHERE id = " + dataId + " and group_id = " + tableNode2.getPKeyId();
|
|
|
List<Map<String, Object>> businessDataMap = this.jdbcTemplate.queryForList(querySql);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
if (businessDataMap.size() > 0) {
|
|
|
// 匹配关联
|
|
|
try {
|
|
|
- //File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
File file1 = ResourceUtil.getFile(tableNode2.getHtmlUrl());
|
|
|
- //File file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1633285246067671040.html");
|
|
|
if (file1.exists()) {
|
|
|
|
|
|
String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
- // 解析
|
|
|
// 模糊匹配
|
|
|
Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
@@ -2612,8 +2607,6 @@ public class ExcelTabController extends BladeController {
|
|
|
Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
|
|
|
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
-
|
|
|
/**
|
|
|
* 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
* 监理单位:引用监理单位名称
|
|
@@ -2761,6 +2754,96 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ // 匹配关联
|
|
|
+ Map<String, Object> reData = new HashMap<>();
|
|
|
+ try {
|
|
|
+ if (tableNode2.getHtmlUrl()!=null) {
|
|
|
+ InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(tableNode2.getHtmlUrl());
|
|
|
+ String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+
|
|
|
+ // 模糊匹配
|
|
|
+ Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
+ Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
+ Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
+ sgtitle.addAll(sgtitle1);
|
|
|
+
|
|
|
+ Elements htdtitle = doc.select("el-input[placeholder~=.*合同号.*]");
|
|
|
+ Elements htdtitle1 = doc.select("el-input[placeholder~=合同段.*]");
|
|
|
+ htdtitle.addAll(htdtitle1);
|
|
|
+
|
|
|
+ Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
+
|
|
|
+ Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
+ bhtitle.addAll(bhtitle1);
|
|
|
+
|
|
|
+
|
|
|
+ Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
+ * 监理单位:引用监理单位名称
|
|
|
+ * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
+ *
|
|
|
+ * 施工单位:施工单位 和 安装单位
|
|
|
+ *
|
|
|
+ */
|
|
|
+ ContractInfo contractInfo = contractInfoService.getById(contractId);
|
|
|
+ // 施工单位名称
|
|
|
+ if (dwtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (sgtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 合同段名称
|
|
|
+ if (htdtitle.size() >= 1) {
|
|
|
+ for (Element element : htdtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 8) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 监理单位名称
|
|
|
+ if (jltitle.size() >= 1) {
|
|
|
+
|
|
|
+ for (Element element : jltitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 10) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 项目名称
|
|
|
+ if (xmtitle.size() >= 1) {
|
|
|
+ for (Element element : xmtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 6) {
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(tableNode2.getProjectId());
|
|
|
+ reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if (reData.size() > 0) {
|
|
|
+ resultMapList.add(reData);
|
|
|
+ }
|
|
|
}
|
|
|
return R.data(resultMapList);
|
|
|
}
|
|
@@ -3241,7 +3324,6 @@ public class ExcelTabController extends BladeController {
|
|
|
@ApiOperationSupport(order = 100)
|
|
|
@ApiOperation(value = "初始化实际", notes = "初始化实际")
|
|
|
public R getFirstExcelHtml() throws Exception {
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String sql = "SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201') and is_deleted=0 and file_type=3 ";
|
|
|
List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
|
|
|
System.out.println(dataInof.size());
|