|
@@ -5,6 +5,7 @@ import cn.hutool.log.StaticLog;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -717,6 +718,39 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
return parent;
|
|
return parent;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ *编辑元素,提示未匹配元素
|
|
|
|
+ * @param pkeyId
|
|
|
|
+ * @param tabId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<WbsFormElement> getUnMatchField(Long pkeyId, Long tabId) throws FileNotFoundException {
|
|
|
|
+ // 获取 节点信息
|
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getOne(
|
|
|
|
+ new LambdaQueryWrapper<WbsTreePrivate>().eq(WbsTreePrivate::getPKeyId,pkeyId));
|
|
|
|
+ // 读取html页面信息
|
|
|
|
+ File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
|
+ FileInputStream inputStream = new FileInputStream(file1);
|
|
|
|
+ String htmlString = IoUtil.readToString(inputStream);
|
|
|
|
+ // 样式集合
|
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
|
+ Element table = doc.select("table").first();
|
|
|
|
+ Elements td = table.select("td");
|
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
|
+ for (Element element : td) {
|
|
|
|
+ if (element.childNodes().size() >= 2) {
|
|
|
|
+ String title = element.childNodes().get(1).attr("placeholder");
|
|
|
|
+ if (StringUtils.isNotBlank(title)) {
|
|
|
|
+ set.add(title);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //获取未匹配的字段
|
|
|
|
+ List<WbsFormElement> list = baseMapper.getUnMatchField(tabId, set);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void processElements(Elements elements) {
|
|
private void processElements(Elements elements) {
|
|
elements.stream().map(this::findParentTd).filter(Objects::nonNull).forEach(element -> element.attr("gscolor", "11"));
|
|
elements.stream().map(this::findParentTd).filter(Objects::nonNull).forEach(element -> element.attr("gscolor", "11"));
|
|
}
|
|
}
|