|
@@ -329,63 +329,65 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
/*用来保存日志执行情况*/
|
|
/*用来保存日志执行情况*/
|
|
StringBuilder log = new StringBuilder();
|
|
StringBuilder log = new StringBuilder();
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
- List<NodeTable> tableAll = createNodeTables(nodeId,tableInfoList.get(0).getContractId(),tableInfoList.get(0).getProjectId(),type);
|
|
|
|
|
|
+ List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type);
|
|
StopWatch stopWatch = new StopWatch();
|
|
StopWatch stopWatch = new StopWatch();
|
|
- List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId),type);
|
|
|
|
|
|
+ List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId), type);
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
- Map<String, Map<String, String>> coordinateMap = createCoordinateMap(keyMappers,type);
|
|
|
|
|
|
+ Map<String, Map<String, String>> coordinateMap = createCoordinateMap(keyMappers, type);
|
|
stopWatch.start("公式处理");
|
|
stopWatch.start("公式处理");
|
|
List<Formula> formulas = this.formulaService.getFormulaList(keyMappers);
|
|
List<Formula> formulas = this.formulaService.getFormulaList(keyMappers);
|
|
WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
|
|
WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
|
|
- CurrentNode currentNode = createCurrentNode(wtc);
|
|
|
|
- TableElementConverter tec = new TableElementConverter(tableInfoList, keyMappers, formulas, coordinateMap, currentNode, tableAll);
|
|
|
|
- tec.setExecuteType(type);
|
|
|
|
- tec.setLog(log);
|
|
|
|
- if (tec.isPresent()) {
|
|
|
|
- tec.before();
|
|
|
|
- this.formulaService.execute(tec);
|
|
|
|
- tec.after();
|
|
|
|
- } else {
|
|
|
|
- tec.getLog().append("【").append("没有执行任何公式").append("】");
|
|
|
|
|
|
+ if (wtc != null) {
|
|
|
|
+ CurrentNode currentNode = createCurrentNode(wtc);
|
|
|
|
+ TableElementConverter tec = new TableElementConverter(tableInfoList, keyMappers, formulas, coordinateMap, currentNode, tableAll);
|
|
|
|
+ tec.setExecuteType(type);
|
|
|
|
+ tec.setLog(log);
|
|
|
|
+ if (tec.isPresent()) {
|
|
|
|
+ tec.before();
|
|
|
|
+ this.formulaService.execute(tec);
|
|
|
|
+ tec.after();
|
|
|
|
+ } else {
|
|
|
|
+ tec.getLog().append("【").append("没有执行任何公式").append("】");
|
|
|
|
+ }
|
|
|
|
+ stopWatch.stop();
|
|
|
|
+ Long totalTime = stopWatch.getTotalTimeMillis();
|
|
|
|
+ log.append("公式执行消耗时间:").append(totalTime);
|
|
|
|
+ StaticLog.info("公式执行用时:{}", totalTime);
|
|
|
|
+ updateFormulaLog(log, wtc);
|
|
}
|
|
}
|
|
- stopWatch.stop();
|
|
|
|
- Long totalTime = stopWatch.getTotalTimeMillis();
|
|
|
|
- log.append("公式执行消耗时间:").append(totalTime);
|
|
|
|
- StaticLog.info("公式执行用时:{}", totalTime);
|
|
|
|
- updateFormulaLog(log, wtc);
|
|
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private List<NodeTable> createNodeTables(Long nodeId,String contractId,String projectId,ExecuteType type){
|
|
|
|
- List<NodeTable> tableAll =new ArrayList<>();
|
|
|
|
- if(type.equals(ExecuteType.INSPECTION)){
|
|
|
|
|
|
+ private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type) {
|
|
|
|
+ List<NodeTable> tableAll = new ArrayList<>();
|
|
|
|
+ if (type.equals(ExecuteType.INSPECTION)) {
|
|
List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId);
|
|
List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId);
|
|
- tableAll = BeanUtil.copyProperties(treeNode,NodeTable.class);
|
|
|
|
- }else if(type.equals(ExecuteType.TESTING)){
|
|
|
|
|
|
+ tableAll = BeanUtil.copyProperties(treeNode, NodeTable.class);
|
|
|
|
+ } else if (type.equals(ExecuteType.TESTING)) {
|
|
List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "9", contractId, projectId, null, null);
|
|
List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "9", contractId, projectId, null, null);
|
|
- tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s,NodeTable.class);
|
|
|
|
|
|
+ tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s, NodeTable.class);
|
|
}
|
|
}
|
|
return tableAll;
|
|
return tableAll;
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, Map<String, String>> createCoordinateMap(List<KeyMapper> keyMappers,ExecuteType type) {
|
|
|
|
|
|
+ private Map<String, Map<String, String>> createCoordinateMap(List<KeyMapper> keyMappers, ExecuteType type) {
|
|
List<Long> pkeyIds = keyMappers.stream().map(KeyMapper::getPkId).distinct().collect(Collectors.toList());
|
|
List<Long> pkeyIds = keyMappers.stream().map(KeyMapper::getPkId).distinct().collect(Collectors.toList());
|
|
Map<String, Map<String, String>> coordinateMap = new HashMap<>(pkeyIds.size() * 2);
|
|
Map<String, Map<String, String>> coordinateMap = new HashMap<>(pkeyIds.size() * 2);
|
|
- if(pkeyIds.size()>0){
|
|
|
|
- if(ExecuteType.TESTING.equals(type)){
|
|
|
|
- List<WbsTreePrivate> list = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>query().lambda().in(WbsTreePrivate::getPKeyId,pkeyIds));
|
|
|
|
- if(list.size()>0){
|
|
|
|
- list.forEach(e-> coordinateMap.computeIfAbsent(e.getInitTableName(), k -> FormulaUtils.getElementCell(e.getHtmlUrl())));
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId,pkeyIds));
|
|
|
|
- if(list.size()>0){
|
|
|
|
- list.forEach(e-> coordinateMap.computeIfAbsent(e.getInitTableName(), k -> FormulaUtils.getElementCell(e.getHtmlUrl())));
|
|
|
|
|
|
+ if (pkeyIds.size() > 0) {
|
|
|
|
+ if (ExecuteType.TESTING.equals(type)) {
|
|
|
|
+ List<WbsTreePrivate> list = wbsTreePrivateService.getBaseMapper().selectList(Wrappers.<WbsTreePrivate>query().lambda().in(WbsTreePrivate::getPKeyId, pkeyIds));
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ list.forEach(e -> coordinateMap.computeIfAbsent(e.getInitTableName(), k -> FormulaUtils.getElementCell(e.getHtmlUrl())));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, pkeyIds));
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ list.forEach(e -> coordinateMap.computeIfAbsent(e.getInitTableName(), k -> FormulaUtils.getElementCell(e.getHtmlUrl())));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -553,7 +555,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
URL url = new URL(downloadUri);
|
|
URL url = new URL(downloadUri);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
- String dataUrl=file_path + "/excel/" + filecode + ".pdf";
|
|
|
|
|
|
+ String dataUrl = file_path + "/excel/" + filecode + ".pdf";
|
|
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
|
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
|
connection.setRequestMethod("GET");
|
|
connection.setRequestMethod("GET");
|
|
connection.setConnectTimeout(5 * 1000);
|
|
connection.setConnectTimeout(5 * 1000);
|
|
@@ -564,8 +566,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
String tabId = callback.getKey();
|
|
String tabId = callback.getKey();
|
|
if (tabId == null) {
|
|
if (tabId == null) {
|
|
throw new Exception("excel为空");
|
|
throw new Exception("excel为空");
|
|
- }else{
|
|
|
|
- tabId = tabId.substring(0,tabId.lastIndexOf("_"));
|
|
|
|
|
|
+ } else {
|
|
|
|
+ tabId = tabId.substring(0, tabId.lastIndexOf("_"));
|
|
}
|
|
}
|
|
//获取数据库信息
|
|
//获取数据库信息
|
|
ExcelTab excelTab = baseMapper.selectById(Long.parseLong(tabId));
|
|
ExcelTab excelTab = baseMapper.selectById(Long.parseLong(tabId));
|
|
@@ -583,7 +585,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
excelTab.setFileUrl(bladeFile.getLink());
|
|
excelTab.setFileUrl(bladeFile.getLink());
|
|
baseMapper.updateById(excelTab);
|
|
baseMapper.updateById(excelTab);
|
|
File file = new File(dataUrl);
|
|
File file = new File(dataUrl);
|
|
- if(file.exists()){
|
|
|
|
|
|
+ if (file.exists()) {
|
|
file.delete();
|
|
file.delete();
|
|
}
|
|
}
|
|
System.out.println("123456");
|
|
System.out.println("123456");
|
|
@@ -721,7 +723,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
|
|
|
|
//获取上传的文件相关
|
|
//获取上传的文件相关
|
|
- String sourceUrl = tableInfoList.get(0).getSourceUrl(),
|
|
|
|
|
|
+ String sourceUrl = tableInfoList.get(0).getSourceUrl(),
|
|
pdfUrl = tableInfoList.get(0).getPdfUrl(),
|
|
pdfUrl = tableInfoList.get(0).getPdfUrl(),
|
|
firstFileName = tableInfoList.get(0).getFirstFileName();
|
|
firstFileName = tableInfoList.get(0).getFirstFileName();
|
|
|
|
|
|
@@ -961,7 +963,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
return dataMap;
|
|
return dataMap;
|
|
}
|
|
}
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
- if(file1.exists()){
|
|
|
|
|
|
+ if (file1.exists()) {
|
|
|
|
|
|
|
|
|
|
FileInputStream fileInputStream = new FileInputStream(file1);
|
|
FileInputStream fileInputStream = new FileInputStream(file1);
|
|
@@ -1019,102 +1021,102 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
// 匹配关联
|
|
// 匹配关联
|
|
try {
|
|
try {
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
- if(file1.exists()){
|
|
|
|
|
|
+ if (file1.exists()) {
|
|
|
|
|
|
- String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
+ 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~=^施工单位]");
|
|
|
|
- Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
|
- sgtitle.addAll(sgtitle1);
|
|
|
|
|
|
+ // 解析
|
|
|
|
+ // 模糊匹配
|
|
|
|
+ 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 htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
|
+ Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
|
|
|
|
+ htdtitle.addAll(htdtitle1);
|
|
|
|
|
|
- Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
|
|
|
+ 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 bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
|
+ Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
|
+ bhtitle.addAll(bhtitle1);
|
|
|
|
|
|
|
|
|
|
- Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
|
|
|
+ Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
|
|
|
|
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
|
|
|
+ // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
|
|
|
- /**
|
|
|
|
- * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
|
- * 监理单位:引用监理单位名称
|
|
|
|
- * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
|
- *
|
|
|
|
- * 施工单位:施工单位 和 安装单位
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
- ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
|
- // 施工单位名称
|
|
|
|
- if (dwtitle.size() >= 1) {
|
|
|
|
- int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
|
- if (y <= 10) {
|
|
|
|
- reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
|
+ * 监理单位:引用监理单位名称
|
|
|
|
+ * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
|
+ *
|
|
|
|
+ * 施工单位:施工单位 和 安装单位
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
|
+ // 施工单位名称
|
|
|
|
+ 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 (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 (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) {
|
|
|
|
|
|
+ // 监理单位名称
|
|
|
|
+ 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());
|
|
|
|
|
|
+ for (Element element : jltitle) {
|
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
+ if (trindex <= 10) {
|
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //获取父节点划分编号
|
|
|
|
- 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"));
|
|
|
|
- if (trindex <= 10) {
|
|
|
|
- reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
|
|
|
+ //获取父节点划分编号
|
|
|
|
+ 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"));
|
|
|
|
+ if (trindex <= 10) {
|
|
|
|
+ reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- // 项目名称
|
|
|
|
- if (xmtitle.size() >= 1) {
|
|
|
|
- for (Element element : xmtitle) {
|
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
- if (trindex <= 6) {
|
|
|
|
- ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
|
- reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
|
|
|
+ // 项目名称
|
|
|
|
+ if (xmtitle.size() >= 1) {
|
|
|
|
+ for (Element element : xmtitle) {
|
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
+ if (trindex <= 6) {
|
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
|
+ reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -1175,7 +1177,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
|
|
String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
|
|
|
|
|
|
reData.put(key + "__" + tabData[1], strings);
|
|
reData.put(key + "__" + tabData[1], strings);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1337,7 +1339,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
x1 = 1;
|
|
x1 = 1;
|
|
}
|
|
}
|
|
String myData = DataInfo.get(val) + "";
|
|
String myData = DataInfo.get(val) + "";
|
|
- if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)){
|
|
|
|
|
|
+ if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
|
sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
|
|
sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
|
|
SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
|
|
SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
|
|
@@ -1361,13 +1363,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(myData.indexOf("lang.String")>=0){
|
|
|
|
- String[] dataDate = (String[]) DataInfo.get(val);
|
|
|
|
- myData = dataDate[0]+" - "+dataDate[1].trim();
|
|
|
|
|
|
+ if (myData.indexOf("lang.String") >= 0) {
|
|
|
|
+ /*String[] dataDate = (String[]) DataInfo.get(val);
|
|
|
|
+ myData = dataDate[0]+" - "+dataDate[1].trim();*/
|
|
|
|
+ Object obj = DataInfo.get(val);
|
|
|
|
+ if (obj instanceof String[]) {
|
|
|
|
+ String[] dataDate = (String[]) obj;
|
|
|
|
+ myData = dataDate[0] + "-" + dataDate[1].trim();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
|
|
//https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
|
|
- if ((myData.indexOf("https") >= 0 ||myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
|
|
|
|
|
|
+ if ((myData.indexOf("https") >= 0 || myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
|
|
|
|
|
|
InputStream imageIn = CommonUtil.getOSSInputStream(myData);
|
|
InputStream imageIn = CommonUtil.getOSSInputStream(myData);
|
|
|
|
|
|
@@ -2041,7 +2048,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
|
|
DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
|
|
}
|
|
}
|
|
|
|
|
|
- org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStream(excelTab.getFileUrl())));
|
|
|
|
|
|
+ org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStreamTow(excelTab.getFileUrl())));
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
sheet.setForceFormulaRecalculation(true);
|
|
sheet.setForceFormulaRecalculation(true);
|
|
Header header = sheet.getHeader();
|
|
Header header = sheet.getHeader();
|