|
@@ -2,6 +2,7 @@ package org.springblade.manager.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.StopWatch;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
import cn.hutool.log.StaticLog;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -48,6 +49,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.common.vo.DataVO;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -97,6 +99,8 @@ import java.util.function.Function;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static java.util.stream.Collectors.toMap;
|
|
|
+
|
|
|
/**
|
|
|
* 清表基础数据表 服务实现类
|
|
|
*
|
|
@@ -123,7 +127,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
private final IContractInfoService contractInfoService;
|
|
|
private final IProjectInfoService projectInfoService;
|
|
|
private final OperationLogClient operationLogClient;
|
|
|
- private final TrialSelfInspectionRecordClient inspectionRecordClient;
|
|
|
private final TableInfoServiceImpl tableInfoService;
|
|
|
|
|
|
@Autowired
|
|
@@ -358,7 +361,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
/*补充缺失的数据*/
|
|
|
List<Long> cp = tableInfoList.stream().map(TableInfo::getPkeyId).map(Long::parseLong).collect(Collectors.toList());
|
|
|
List<Long> load = tableAll.stream().map(NodeTable::getPKeyId).filter(pk -> !cp.contains(pk)).collect(Collectors.toList());
|
|
|
- Map<Long, String> keyMap = tableAll.stream().collect(Collectors.toMap(NodeTable::getPKeyId, NodeTable::getInitTableName));
|
|
|
+ Map<Long, String> keyMap = tableAll.stream().collect(toMap(NodeTable::getPKeyId, NodeTable::getInitTableName));
|
|
|
Map<String, List<Long>> loadMap = load.stream().collect(Collectors.groupingBy(keyMap::get, Collectors.toList()));
|
|
|
loadMap.entrySet().parallelStream().forEach(entry -> {
|
|
|
/*init_table_name*/
|
|
@@ -1340,7 +1343,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
|
|
|
Elements defText = doc.getElementsByAttribute("defText");
|
|
|
-
|
|
|
sgtitle.addAll(sgtitle1);
|
|
|
|
|
|
//合同段显示合同编号
|
|
@@ -1351,8 +1353,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
|
|
|
- //编号为父节点划分编号
|
|
|
+ //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号”
|
|
|
Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ if(wbsTreeContract.getWbsType()==1){
|
|
|
+ Elements bhtitle2 = doc.select("el-input[placeholder~=^工程编号]");
|
|
|
+ Elements bhtitle3 = doc.select("el-input[placeholder~=^分项工程编号]");
|
|
|
+ Elements bhtitle4 = doc.select("el-input[placeholder~=^分部分项编号]");
|
|
|
+ bhtitle.addAll(bhtitle2);
|
|
|
+ bhtitle.addAll(bhtitle3);
|
|
|
+ bhtitle.addAll(bhtitle4);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//合同编号为合同编号
|
|
|
Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
bhtitle1.addAll(htdtitle);
|
|
@@ -1360,10 +1372,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
bhtitle1.addAll(htdtitle2);
|
|
|
|
|
|
|
|
|
- Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
|
|
|
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
@@ -1387,7 +1399,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
for (Element element : sgtitle) {
|
|
|
int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
String placeholderxx = element.attr("placeholder");
|
|
|
- if (trindex < 10 || placeholderxx.equals("施工单位")) {
|
|
|
+ if ((trindex < 10 || placeholderxx.equals("施工单位")) && placeholderxx.indexOf("自评意见")<0) {
|
|
|
reData.put(element.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
}
|
|
|
}
|
|
@@ -1408,7 +1420,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
String placeholderxx = element.attr("placeholder");
|
|
|
|
|
|
- if (trindex < 10 || placeholderxx.equals("监理单位")) {
|
|
|
+ if ((trindex < 10 || placeholderxx.equals("监理单位")) && placeholderxx.indexOf("自评意见")<0) {
|
|
|
reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
}
|
|
|
}
|
|
@@ -1417,7 +1429,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
.eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
- // 编号
|
|
|
+ // 编号 //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号”
|
|
|
if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
for (Element element : bhtitle) {
|
|
|
int trindex = Integer.parseInt(element.attr("trindex"));
|
|
@@ -1452,7 +1464,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//电签默认值
|
|
|
if (defText.size() >= 1) {
|
|
|
for (Element element : defText) {
|
|
|
- reData.put(element.attr("keyName"), element.attr("defText"));
|
|
|
+ String keys = element.attr("keyName");
|
|
|
+ String defText2 = element.attr("defText");
|
|
|
+ if(keys!=null && Func.isNotEmpty(keys)){
|
|
|
+ reData.put(keys, defText2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1971,7 +1987,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
.collect(Collectors.toList());
|
|
|
Long sigSize = table.getElementsByAttribute(":readonly").stream().count();
|
|
|
int keySize = keyList.size();
|
|
|
- List<String> fills = DataInfo.keySet().stream().filter(e -> e.contains("__") && e.contains("key")).collect(Collectors.toList());
|
|
|
+ List<String> fills = DataInfo.keySet().stream().filter(e -> e.contains("__") && e.contains("key") && StringUtils.isNotEmpty(e)).collect(Collectors.toList());
|
|
|
if (fills.size() != 0 && keyList != null && keyList.size() != 0) {
|
|
|
if (keySize == sigSize) {
|
|
|
realFillRate = 100;
|
|
@@ -2704,7 +2720,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Map<String, WbsFormElement> elementMap = null;
|
|
|
if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableId())) {
|
|
|
String eleSql = "select e_key,e_name from m_wbs_form_element where f_id = " + wbsTreePrivate.getInitTableId();
|
|
|
- elementMap = jdbcTemplate.query(eleSql, new BeanPropertyRowMapper<>(WbsFormElement.class)).stream().collect(Collectors.toMap(WbsFormElement::getEKey, Function.identity()));
|
|
|
+ elementMap = jdbcTemplate.query(eleSql, new BeanPropertyRowMapper<>(WbsFormElement.class)).stream().collect(toMap(WbsFormElement::getEKey, Function.identity()));
|
|
|
}
|
|
|
|
|
|
if (dataIn.size() >= 1) {
|
|
@@ -3855,12 +3871,31 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 获取
|
|
|
+ TextdictInfoVO textdictInfo =new TextdictInfoVO();
|
|
|
+ textdictInfo.setType(2);
|
|
|
+ textdictInfo.setExcelId(wbsTreePrivate.getExcelId()+"");
|
|
|
+ textdictInfo.setTabId(pkeyId+"");
|
|
|
+
|
|
|
+ Query query = new Query();
|
|
|
+ query.setCurrent(0);
|
|
|
+ query.setSize(100);
|
|
|
+ IPage<TextdictInfoVO> pages = textdictInfoService.selectTextdictInfoPage(Condition.getPage(query), textdictInfo);
|
|
|
+ List<TextdictInfoVO> records = pages.getRecords();
|
|
|
+ Map<Long,TextdictInfo> textMap = new HashMap<>();
|
|
|
+ if(records!=null && records.size()>=1) {
|
|
|
+ for (TextdictInfo entity : records) {
|
|
|
+ if (entity.getId() != null) {
|
|
|
+ textMap.put(entity.getId(), entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//输出流
|
|
|
FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
|
workbook.write(outputStream);
|
|
|
FileUtils.excelToPdf(excelPath, pdfPath);
|
|
|
- PdfAddimgUtil.pdfAddImgInfo(pdfPath, String.join(",", sign));
|
|
|
- return R.data(PdfAddimgUtil.getNetUrl(pdfPath));
|
|
|
+ PdfAddimgUtil.pdfAddImgInfo(pdfPath, String.join(",", sign),textMap);
|
|
|
+ return R.data(FileUtils.getNetUrl(pdfPath));
|
|
|
}
|
|
|
|
|
|
|