|
@@ -1,5 +1,6 @@
|
|
package org.springblade.manager.controller;
|
|
package org.springblade.manager.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
+import com.google.gson.Gson;
|
|
import com.spire.xls.*;
|
|
import com.spire.xls.*;
|
|
import com.spire.xls.collections.PicturesCollection;
|
|
import com.spire.xls.collections.PicturesCollection;
|
|
import com.spire.xls.core.spreadsheet.HTMLOptions;
|
|
import com.spire.xls.core.spreadsheet.HTMLOptions;
|
|
@@ -2006,24 +2008,8 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "contractId", value = "合同段Id", required = true)
|
|
@ApiImplicitParam(name = "contractId", value = "合同段Id", required = true)
|
|
})
|
|
})
|
|
public R getPdfS(String nodeId, String classify, String contractId) throws FileNotFoundException {
|
|
public R getPdfS(String nodeId, String classify, String contractId) throws FileNotFoundException {
|
|
|
|
+ String file_path = FileUtils.getSysLocalFileUrl();
|
|
//获取节点下的所有表单,和附件,如果表单全是隐藏的,并且没有附件,则提示暂无数据
|
|
//获取节点下的所有表单,和附件,如果表单全是隐藏的,并且没有附件,则提示暂无数据
|
|
-// WbsTreeContract node = wbsTreeContractService.getOne(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getPKeyId,nodeId));
|
|
|
|
-// List<WbsTreeContract> list = wbsTreeContractService.list(new LambdaQueryWrapper<WbsTreeContract>().eq(WbsTreeContract::getParentId, node.getId()).eq(WbsTreeContract::getContractId, contractId));
|
|
|
|
-// tableInfoService.list(new LambdaQueryWrapper<ta>())
|
|
|
|
-// if (list != null && list.size() > 0){
|
|
|
|
-// Boolean isShow = true;
|
|
|
|
-// for (WbsTreeContract contract : list) {
|
|
|
|
-// if (contract.getIsBussShow() == 1){
|
|
|
|
-// isShow = false;
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if (isShow){
|
|
|
|
-// return R.fail("无历史数据预览,请保存数据");
|
|
|
|
-// }
|
|
|
|
-// }else {
|
|
|
|
-// return R.fail("无历史数据预览,请保存数据");
|
|
|
|
-// }
|
|
|
|
String sql = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position,status from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id='" + contractId + "'";
|
|
String sql = "select pdf_url,e_visa_pdf_url,pdf_trial_url,pdf_trial_url_position,status from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id='" + contractId + "'";
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
if (maps.size() >= 1) {
|
|
if (maps.size() >= 1) {
|
|
@@ -2042,7 +2028,25 @@ public class ExcelTabController extends BladeController {
|
|
if (StringUtils.isEmpty(pdfUrl) || pdfUrl.equals("null")) {
|
|
if (StringUtils.isEmpty(pdfUrl) || pdfUrl.equals("null")) {
|
|
return R.fail("暂无PDF数据");
|
|
return R.fail("暂无PDF数据");
|
|
} else {
|
|
} else {
|
|
- return R.data(pdfUrl);
|
|
|
|
|
|
+ // 由于独立附件 需要追加最后
|
|
|
|
+ List<TableFileVO> data = tableFileService.selectTableFileListByTen(Long.valueOf(nodeId+""));
|
|
|
|
+ List<String> datainfo = new ArrayList<>();
|
|
|
|
+ datainfo.add(pdfUrl);
|
|
|
|
+ if(data!=null && data.size()>=1){
|
|
|
|
+ for(TableFileVO tabsx :data){
|
|
|
|
+ datainfo.add(tabsx.getUrl());
|
|
|
|
+ }
|
|
|
|
+ String listPdf = file_path + "/pdf/" + nodeId + ".pdf";
|
|
|
|
+ File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
|
|
+ if (tabpdf2.exists()) {
|
|
|
|
+ tabpdf2.delete();
|
|
|
|
+ }
|
|
|
|
+ FileUtils.mergePdfPublicMethods(datainfo, listPdf);
|
|
|
|
+ String netUrl = FileUtils.getNetUrl(listPdf);
|
|
|
|
+ return R.data(netUrl);
|
|
|
|
+ }else{
|
|
|
|
+ return R.data(pdfUrl);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return R.fail("无历史数据预览,请保存数据");
|
|
return R.fail("无历史数据预览,请保存数据");
|
|
@@ -3843,11 +3847,14 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
})
|
|
})
|
|
public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId) {
|
|
public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId) {
|
|
|
|
+ List<TableFile> fileList = new ArrayList<>();
|
|
if(file!=null && file.length>=1){
|
|
if(file!=null && file.length>=1){
|
|
for (MultipartFile multipartFile:file){
|
|
for (MultipartFile multipartFile:file){
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(multipartFile);
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(multipartFile);
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
+
|
|
TableFile tableFile = new TableFile();
|
|
TableFile tableFile = new TableFile();
|
|
|
|
+
|
|
String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
tableFile.setTabId(nodeId + "");
|
|
tableFile.setTabId(nodeId + "");
|
|
tableFile.setName(multipartFile.getOriginalFilename());
|
|
tableFile.setName(multipartFile.getOriginalFilename());
|
|
@@ -3855,11 +3862,78 @@ public class ExcelTabController extends BladeController {
|
|
tableFile.setDomainUrl(bladeFile1.getLink());
|
|
tableFile.setDomainUrl(bladeFile1.getLink());
|
|
tableFile.setIsDeleted(0);
|
|
tableFile.setIsDeleted(0);
|
|
tableFile.setExtension(fileExtension);
|
|
tableFile.setExtension(fileExtension);
|
|
|
|
+ fileList.add(tableFile);
|
|
}
|
|
}
|
|
|
|
+ tableFileService.saveOrUpdateBatch(fileList);
|
|
return R.data("操作成功");
|
|
return R.data("操作成功");
|
|
}else{
|
|
}else{
|
|
return R.data("请上传pdf");
|
|
return R.data("请上传pdf");
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @PostMapping("/save_nodeId")
|
|
|
|
+ @ApiOperationSupport(order = 72)
|
|
|
|
+ @ApiOperation(value = "pdf", notes = "pdf")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "contractId", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "nodeIds", value = "nodeIds", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "classify", value = "classify", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
|
|
+ })
|
|
|
|
+ public R synPDFInfo(String contractId,String nodeIds, String classify, String projectId) throws Exception {
|
|
|
|
+
|
|
|
|
+ if( contractId==null && StringUtils.isEmpty(contractId)){
|
|
|
|
+ return R.data("contractId不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(nodeIds==null && StringUtils.isEmpty(nodeIds)){
|
|
|
|
+ return R.data("nodeId不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(classify==null && StringUtils.isEmpty(classify)){
|
|
|
|
+ return R.data("classify不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(projectId==null && StringUtils.isEmpty(projectId)){
|
|
|
|
+ return R.data("projectId不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String nodeId[] = Func.toStrArray(nodeIds);
|
|
|
|
+
|
|
|
|
+ for(String noId : nodeId){
|
|
|
|
+ JSONObject js = new JSONObject();
|
|
|
|
+ JSONObject js2 = new JSONObject();
|
|
|
|
+ List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(noId, classify, contractId, projectId);
|
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
|
+ if(tableAll!=null && tableAll.size()>=1){
|
|
|
|
+ for(AppWbsTreeContractVO tab:tableAll){
|
|
|
|
+ try {
|
|
|
|
+ R bussDataInfo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
|
|
|
|
+ Map<String, Object> jo = (Map<String, Object>) bussDataInfo.getData();
|
|
|
|
+ String s = new Gson().toJson(jo);
|
|
|
|
+ //字符串转jsonobject
|
|
|
|
+ JSONObject obj = JSON.parseObject(s);
|
|
|
|
+ obj.put("classify",classify);
|
|
|
|
+ obj.put("nodeId",noId);
|
|
|
|
+ obj.put("contractId",contractId);
|
|
|
|
+ obj.put("pkeyId",tab.getPKeyId());
|
|
|
|
+ obj.put("projectId",projectId);
|
|
|
|
+ obj.put("isCollapseLoad",true);
|
|
|
|
+ obj.put("isRenderForm",true);
|
|
|
|
+ array.add(obj);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }finally {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ js2.put("orderList",array);
|
|
|
|
+ js.put("dataInfo",js2);
|
|
|
|
+ this.saveBussData2(js);
|
|
|
|
+ }
|
|
|
|
+ return R.data("成功");
|
|
|
|
+ }
|
|
}
|
|
}
|