|
@@ -33,7 +33,9 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.nodes.Entities;
|
|
|
import org.jsoup.nodes.Node;
|
|
|
+import org.jsoup.parser.Parser;
|
|
|
import org.jsoup.select.Elements;
|
|
|
import org.springblade.business.dto.TrialSeleInspectionRecordBaseInfoDTO;
|
|
|
import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
|
|
@@ -1015,19 +1017,43 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements td = table.select("td");
|
|
|
- Set<String> set = new HashSet<>();
|
|
|
+ Map<String, String> set = new HashMap<>();
|
|
|
for (Element element : td) {
|
|
|
if (element.childNodes().size() >= 2) {
|
|
|
String title = element.childNodes().get(1).attr("placeholder");
|
|
|
if (StringUtils.isNotBlank(title)) {
|
|
|
- set.add(title);
|
|
|
+ if (title.contains("&")) {
|
|
|
+ // 处理 < 之类的转义字符
|
|
|
+ if (title.contains("&")) {
|
|
|
+ title = Parser.unescapeEntities(title, false);
|
|
|
+ }
|
|
|
+ title = Parser.unescapeEntities(title, false);
|
|
|
+ }
|
|
|
+ set.put(title, title);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//获取未匹配的字段
|
|
|
List<WbsFormElement> list = new ArrayList<>();
|
|
|
if (set != null && set.size() > 0) {
|
|
|
- list = baseMapper.getUnMatchField(tabId, set);
|
|
|
+// list = baseMapper.getUnMatchField(tabId, set);
|
|
|
+ List<WbsFormElement> elements = jdbcTemplate.query("select * from m_wbs_form_element where f_id = ? and is_deleted = 0", new Object[]{tabId}, new BeanPropertyRowMapper<>(WbsFormElement.class));
|
|
|
+ elements.forEach(wbsFormElement -> {
|
|
|
+ String name = wbsFormElement.getEName();
|
|
|
+ if (StringUtils.isNotBlank(name)) {
|
|
|
+ if (name.contains("&")) {
|
|
|
+ // 处理 < 之类的转义字符
|
|
|
+ if (name.contains("&")) {
|
|
|
+ name = Parser.unescapeEntities(name, false);
|
|
|
+ }
|
|
|
+ name = Parser.unescapeEntities(name, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (set.containsKey(name)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ list.add(wbsFormElement);
|
|
|
+ });
|
|
|
}
|
|
|
return list;
|
|
|
}
|