|
@@ -248,15 +248,18 @@ public class WbsTreeContractController extends BladeController {
|
|
|
ExcelTab excelTab = jdbcTemplate.queryForObject("select file_url,name from m_excel_tab where id = " + tab.getExcelId(), new BeanPropertyRowMapper<>(ExcelTab.class));
|
|
|
if (excelTab != null) {
|
|
|
InputStream inputStream = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
|
|
|
- try (Workbook workbook = parseExcelFile(inputStream)) {
|
|
|
- response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
- response.setCharacterEncoding("UTF-8");
|
|
|
- response.setHeader("Content-disposition", ";filename=" + URLEncoder.encode(excelTab.getName().replace(" ", ""), "UTF-8") + ".xlsx");
|
|
|
- ServletOutputStream servletOutputStream = response.getOutputStream();
|
|
|
- workbook.write(servletOutputStream);
|
|
|
- servletOutputStream.flush();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ if (inputStream != null) {
|
|
|
+ try (/*Workbook workbook = parseExcelFile(inputStream) 先不解析成文本格式,保留原始的excel表格格式*/
|
|
|
+ Workbook workbook = WorkbookFactory.create(inputStream)) {
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ response.setCharacterEncoding("UTF-8");
|
|
|
+ response.setHeader("Content-disposition", ";filename=" + URLEncoder.encode(excelTab.getName().replace(" ", ""), "UTF-8") + ".xlsx");
|
|
|
+ ServletOutputStream servletOutputStream = response.getOutputStream();
|
|
|
+ workbook.write(servletOutputStream);
|
|
|
+ servletOutputStream.flush();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -299,13 +302,6 @@ public class WbsTreeContractController extends BladeController {
|
|
|
for (Map.Entry<String, String> stringStringEntry : stringStringMap.entrySet()) {
|
|
|
String value = stringStringEntry.getValue();
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
- /*String escape = CssSelectorEscaper.escape(value);
|
|
|
- String selectorTitle = "td:containsOwn(" + escape + ")";
|
|
|
- Elements tdElementsTitle = doc.select(selectorTitle);
|
|
|
- //如果找到了匹配的<td>元素,说明是固定的标题,跳过当前循环,只保留填写的excel数据
|
|
|
- if (!tdElementsTitle.isEmpty()) {
|
|
|
- continue;
|
|
|
- }*/
|
|
|
String[] split = stringStringEntry.getKey().split("_");
|
|
|
int row = Integer.parseInt(split[0]) + 1;
|
|
|
int cell = Integer.parseInt(split[1]) + 1;
|
|
@@ -374,5 +370,12 @@ public class WbsTreeContractController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/getConcealedWorksNodeTree")
|
|
|
+ @ApiOperationSupport(order = 15)
|
|
|
+ @ApiOperation(value = "获取合同段隐蔽工程节点树", notes = "传入合同段id")
|
|
|
+ public R<List<WbsTreeContractLazyVO>> getConcealedWorksNodeTree(@RequestParam String contractId) {
|
|
|
+ List<WbsTreeContractLazyVO> result = iWbsTreeContractService.getConcealedWorksNodeTree(contractId);
|
|
|
+ return R.data(result);
|
|
|
+ }
|
|
|
|
|
|
}
|