|
@@ -44,6 +44,7 @@ import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.unit.FileUtils;
|
|
import org.springblade.manager.unit.FileUtils;
|
|
import org.springblade.manager.unit.HtmlToPdf;
|
|
import org.springblade.manager.unit.HtmlToPdf;
|
|
|
|
+import org.springblade.manager.unit.PdfConvertA4Utils;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
@@ -257,7 +258,7 @@ public class ExcelTabController extends BladeController {
|
|
public R putFileAttach(@RequestParam("file") MultipartFile file, Long nodeId) {
|
|
public R putFileAttach(@RequestParam("file") MultipartFile file, Long nodeId) {
|
|
|
|
|
|
ExcelTab detail = excelTabService.getById(nodeId);
|
|
ExcelTab detail = excelTabService.getById(nodeId);
|
|
- // 删除excel文件
|
|
|
|
|
|
+ // 上传excel文件
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(file);
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(file);
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
String filecode = SnowFlakeUtil.getId()+"";
|
|
String filecode = SnowFlakeUtil.getId()+"";
|
|
@@ -268,6 +269,8 @@ public class ExcelTabController extends BladeController {
|
|
//获取工作表
|
|
//获取工作表
|
|
Worksheet sheet = wb.getWorksheets().get(0);
|
|
Worksheet sheet = wb.getWorksheets().get(0);
|
|
sheet.saveToHtml(thmlUrl);
|
|
sheet.saveToHtml(thmlUrl);
|
|
|
|
+
|
|
|
|
+
|
|
detail.setExtension(bladeFile1.getOriginalName());
|
|
detail.setExtension(bladeFile1.getOriginalName());
|
|
detail.setFileUrl(bladeFile1.getLink());
|
|
detail.setFileUrl(bladeFile1.getLink());
|
|
detail.setFileType(3); // 表示为清表信息 1 表示祖节点 2 表示为节点信息 3 表示清表
|
|
detail.setFileType(3); // 表示为清表信息 1 表示祖节点 2 表示为节点信息 3 表示清表
|
|
@@ -568,7 +571,7 @@ public class ExcelTabController extends BladeController {
|
|
@PostMapping("/save_buss_data")
|
|
@PostMapping("/save_buss_data")
|
|
@ApiOperationSupport(order = 13)
|
|
@ApiOperationSupport(order = 13)
|
|
@ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
|
|
@ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
|
|
- public R<String> saveBussData(@Valid @RequestBody JSONObject dataInfo, BladeUser bladeUser) {
|
|
|
|
|
|
+ public R<String> saveBussData(@Valid @RequestBody JSONObject dataInfo, BladeUser bladeUser) throws IOException {
|
|
|
|
|
|
JSONArray dataArray = new JSONArray();
|
|
JSONArray dataArray = new JSONArray();
|
|
if(dataInfo.containsKey("dataInfo")){ // 节点保存
|
|
if(dataInfo.containsKey("dataInfo")){ // 节点保存
|
|
@@ -693,7 +696,7 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
jdbcTemplate.execute(sqlInfo);
|
|
jdbcTemplate.execute(sqlInfo);
|
|
-
|
|
|
|
|
|
+ this.getBussPdfInfo(Long.parseLong(pkeyId));
|
|
}
|
|
}
|
|
return R.success("1");
|
|
return R.success("1");
|
|
}
|
|
}
|
|
@@ -1184,17 +1187,24 @@ public class ExcelTabController extends BladeController {
|
|
return R.fail("请关联清表!");
|
|
return R.fail("请关联清表!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
|
|
+ String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='"+tabName+"'";
|
|
|
|
+ List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
|
|
|
|
+
|
|
|
|
+ Document doc = null;
|
|
|
|
+ //
|
|
|
|
+ if(tablist!=null && tablist.size()>=1){
|
|
|
|
+
|
|
String querySql = "select * from "+wbsTreeContract.getInitTableName()+" where p_key_id="+pkeyId ;
|
|
String querySql = "select * from "+wbsTreeContract.getInitTableName()+" where p_key_id="+pkeyId ;
|
|
List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
if(dataIn==null){
|
|
if(dataIn==null){
|
|
return R.fail("请填写数据!");
|
|
return R.fail("请填写数据!");
|
|
}
|
|
}
|
|
Map<String, Object> mysqlData = dataIn.get(0);
|
|
Map<String, Object> mysqlData = dataIn.get(0);
|
|
-
|
|
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
// 样式集合
|
|
// 样式集合
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
+ doc = Jsoup.parse(htmlString);
|
|
//解析
|
|
//解析
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
Elements trs = table.select("tr");
|
|
Elements trs = table.select("tr");
|
|
@@ -1224,7 +1234,14 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }else{
|
|
|
|
+ File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
|
+ String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
|
+ // 样式集合
|
|
|
|
+ doc = Jsoup.parse(htmlString);
|
|
|
|
+ }
|
|
String pdfPath="/Users/hongchuangyanfa/Desktop/pdf//"+pkeyId+".pdf";
|
|
String pdfPath="/Users/hongchuangyanfa/Desktop/pdf//"+pkeyId+".pdf";
|
|
|
|
+ String pdfPath_size="/Users/hongchuangyanfa/Desktop/pdf//"+pkeyId+"size.pdf";
|
|
String pdfHtmlPath="/Users/hongchuangyanfa/Desktop/pdfHtml//"+pkeyId+".html";
|
|
String pdfHtmlPath="/Users/hongchuangyanfa/Desktop/pdfHtml//"+pkeyId+".html";
|
|
|
|
|
|
File writefile = new File(pdfHtmlPath);
|
|
File writefile = new File(pdfHtmlPath);
|
|
@@ -1233,8 +1250,9 @@ public class ExcelTabController extends BladeController {
|
|
HtmlToPdf html = new HtmlToPdf();
|
|
HtmlToPdf html = new HtmlToPdf();
|
|
html.tomPdf(pdfHtmlPath,pdfPath);
|
|
html.tomPdf(pdfHtmlPath,pdfPath);
|
|
|
|
|
|
- BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
|
|
|
|
+ PdfConvertA4Utils.convert(pdfPath,pdfPath_size);
|
|
|
|
|
|
|
|
+ BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath_size);
|
|
//
|
|
//
|
|
TableFile tableFile1 = tableFileService.getBaseMapper().selectOne(Wrappers.<TableFile>query().lambda()
|
|
TableFile tableFile1 = tableFileService.getBaseMapper().selectOne(Wrappers.<TableFile>query().lambda()
|
|
.eq(TableFile::getTabId, pkeyId).eq(TableFile::getType,1));
|
|
.eq(TableFile::getTabId, pkeyId).eq(TableFile::getType,1));
|
|
@@ -1271,7 +1289,6 @@ public class ExcelTabController extends BladeController {
|
|
updateWrapper.set("pdf_url",bladeFile2.getLink());
|
|
updateWrapper.set("pdf_url",bladeFile2.getLink());
|
|
wbsTreeContractService.update(updateWrapper);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
|
|
|
|
-
|
|
|
|
return R.data(bladeFile2.getLink());
|
|
return R.data(bladeFile2.getLink());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1393,7 +1410,7 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// 获取有权限的节点信息
|
|
// 获取有权限的节点信息
|
|
List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
- List<String> data = wbsTreeContractList.stream().filter(wbsTreeContract -> wbsTreeContract.getPdfUrl()!=null).map(WbsTreeContract::getPdfUrl).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> data = wbsTreeContractList.stream().filter(wbsTreeContract -> wbsTreeContract.getPdfUrl()!=null && !wbsTreeContract.getIsBussShow().equals("2")).map(WbsTreeContract::getPdfUrl).collect(Collectors.toList());
|
|
|
|
|
|
String listPdf = "/Users/hongchuangyanfa/Desktop/pdf/"+nodeId+".pdf";
|
|
String listPdf = "/Users/hongchuangyanfa/Desktop/pdf/"+nodeId+".pdf";
|
|
|
|
|