|
@@ -1506,6 +1506,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfo(pkeyId, 0).getData();
|
|
|
+ //真实填报率
|
|
|
+ Integer realFillRate = 0;
|
|
|
+ //获取已经填报的数据
|
|
|
+ Long fillNumbers = DataInfo.keySet().stream().filter(e -> e.contains("__")).count();
|
|
|
|
|
|
//获取excel流 和 html流
|
|
|
InputStream exceInp = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
|
|
@@ -1582,10 +1586,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//数据不为空
|
|
|
if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
|
+// InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1578963584895942656.html");
|
|
|
String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
|
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Element table = doc.select("table").first();
|
|
|
+ //计算填报率
|
|
|
+ Long keySize = table.getElementsByAttribute("v-model").stream().count();
|
|
|
+ if (fillNumbers != 0 && keySize != 0){
|
|
|
+ Double v = fillNumbers.doubleValue() / keySize.doubleValue() * 100;
|
|
|
+ realFillRate = v.intValue();
|
|
|
+ }
|
|
|
Elements trs = table.select("tr");
|
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
|
for (String val : DataInfo.keySet()) {
|
|
@@ -1829,6 +1840,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.in("p_key_id", pkeyId + "");
|
|
|
updateWrapper.set("pdf_url", fileUrl);
|
|
|
+ updateWrapper.set("real_fill_fate", realFillRate);
|
|
|
wbsTreeContractService.update(updateWrapper);
|
|
|
|
|
|
//关闭流
|