|
@@ -19,6 +19,8 @@ import com.spire.xls.collections.PicturesCollection;
|
|
import com.spire.xls.core.spreadsheet.HTMLOptions;
|
|
import com.spire.xls.core.spreadsheet.HTMLOptions;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.Data;
|
|
|
|
+import lombok.NoArgsConstructor;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import org.apache.commons.codec.Charsets;
|
|
import org.apache.commons.codec.Charsets;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
@@ -52,6 +54,7 @@ import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.utils.*;
|
|
import org.springblade.core.tool.utils.*;
|
|
import org.springblade.manager.bean.TableInfo;
|
|
import org.springblade.manager.bean.TableInfo;
|
|
|
|
+import org.springblade.manager.dto.AddBussFileSortDTO;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.enums.ExecuteType;
|
|
import org.springblade.manager.enums.ExecuteType;
|
|
import org.springblade.manager.mapper.ExcelTabMapper;
|
|
import org.springblade.manager.mapper.ExcelTabMapper;
|
|
@@ -1710,7 +1713,7 @@ public class ExcelTabController extends BladeController {
|
|
/**
|
|
/**
|
|
* 上传文件
|
|
* 上传文件
|
|
*
|
|
*
|
|
- * @param file 文件
|
|
|
|
|
|
+ * @param files 文件
|
|
* @return ObjectStat
|
|
* @return ObjectStat
|
|
*/
|
|
*/
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -1725,40 +1728,45 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "classify", value = "classify", required = true),
|
|
@ApiImplicitParam(name = "classify", value = "classify", required = true),
|
|
@ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
@ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
})
|
|
})
|
|
- public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
|
|
|
|
-
|
|
|
|
|
|
+ public R addBussFile(@RequestParam("file") MultipartFile[] file, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
|
|
|
|
+ List<TableFile>list=new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < file.length; i++) {
|
|
|
|
+ R<BladeFile> bladeFile = iossClient.addFileInfo(file[i]);
|
|
|
|
+ BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
+ TableFile tableFile = new TableFile();
|
|
|
|
+ String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
|
|
+ tableFile.setTabId(pkeyId + "");
|
|
|
|
+ tableFile.setName(file[i].getOriginalFilename());
|
|
|
|
+ tableFile.setContractId(Long.valueOf(contractId));
|
|
|
|
+ tableFile.setClassify(Integer.parseInt(classify));
|
|
|
|
+ tableFile.setType(2);
|
|
|
|
+ tableFile.setDomainUrl(bladeFile1.getLink());
|
|
|
|
+ tableFile.setIsDeleted(0);
|
|
|
|
+ tableFile.setExtension(fileExtension);
|
|
|
|
+
|
|
|
|
+ NewBladeFile newBladeFile = new NewBladeFile();
|
|
|
|
+ if (fileExtension.contains("xlsx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("xls")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("docx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.wordToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("png") || fileExtension.contains("jpg") || fileExtension.contains("webp") || fileExtension.contains("apng") ||
|
|
|
|
+ fileExtension.contains("bmp") || fileExtension.contains("jepg") || fileExtension.contains("tif") || fileExtension.contains("gif")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.pngOrJpgToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("pdf")) {
|
|
|
|
+ tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
|
|
+ }
|
|
|
|
|
|
- R<BladeFile> bladeFile = iossClient.addFileInfo(file);
|
|
|
|
- BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
- TableFile tableFile = new TableFile();
|
|
|
|
- String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
|
|
- tableFile.setTabId(pkeyId + "");
|
|
|
|
- tableFile.setName(file.getOriginalFilename());
|
|
|
|
- tableFile.setType(2);
|
|
|
|
- tableFile.setDomainUrl(bladeFile1.getLink());
|
|
|
|
- tableFile.setIsDeleted(0);
|
|
|
|
- tableFile.setExtension(fileExtension);
|
|
|
|
-
|
|
|
|
- NewBladeFile newBladeFile = new NewBladeFile();
|
|
|
|
- if (fileExtension.contains("xlsx")) {
|
|
|
|
- newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
|
|
- tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
- } else if (fileExtension.contains("xls")) {
|
|
|
|
- newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
|
|
- tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
- } else if (fileExtension.contains("docx")) {
|
|
|
|
- newBladeFile = this.commonFileClient.wordToPdf(file);
|
|
|
|
- tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
- } else if (fileExtension.contains("png") || fileExtension.contains("jpg") || fileExtension.contains("webp") || fileExtension.contains("apng") ||
|
|
|
|
- fileExtension.contains("bmp") || fileExtension.contains("jepg") || fileExtension.contains("tif") || fileExtension.contains("gif")) {
|
|
|
|
- newBladeFile = this.commonFileClient.pngOrJpgToPdf(file);
|
|
|
|
- tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
- } else if (fileExtension.contains("pdf")) {
|
|
|
|
- tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
|
|
|
|
+ tableFile.setStatus("finished");
|
|
|
|
+ list.add(tableFile);
|
|
}
|
|
}
|
|
|
|
|
|
- tableFile.setStatus("finished");
|
|
|
|
- tableFileService.save(tableFile);
|
|
|
|
|
|
+ tableFileService.saveBatch(list);
|
|
|
|
|
|
// 生成单个pdf
|
|
// 生成单个pdf
|
|
excelTabService.getBussPdfInfo(pkeyId);
|
|
excelTabService.getBussPdfInfo(pkeyId);
|
|
@@ -1789,7 +1797,7 @@ public class ExcelTabController extends BladeController {
|
|
informationQueryClient.saveInfo(query);
|
|
informationQueryClient.saveInfo(query);
|
|
}
|
|
}
|
|
excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
|
|
excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
|
|
- return R.data(tableFile.getId());
|
|
|
|
|
|
+ return R.status(true);
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/show-buss-tab")
|
|
@GetMapping("/show-buss-tab")
|
|
@@ -1810,6 +1818,8 @@ public class ExcelTabController extends BladeController {
|
|
excelTabService.getBussPdfInfo(pkeyId);
|
|
excelTabService.getBussPdfInfo(pkeyId);
|
|
//重新生成PDF修改queryInfo
|
|
//重新生成PDF修改queryInfo
|
|
excelTabService.getBussPdfs(nodeId, classify, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
|
|
excelTabService.getBussPdfs(nodeId, classify, wbsTreeContract.getContractId(), wbsTreeContract.getProjectId());
|
|
|
|
+ WbsTreeContract contract = wbsTreeContractService.getById(Long.parseLong(nodeId));
|
|
|
|
+ wbsTreeContractService.checkNodeAllDate(contract);
|
|
return R.data("成功");
|
|
return R.data("成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2053,7 +2063,11 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //检查当前节点下所有的未隐藏的表单日期是否填写完整
|
|
|
|
+ WbsTreeContract contract = wbsTreeContractService.getById(Long.parseLong(nodeId));
|
|
|
|
+ if(contract!=null){
|
|
|
|
+ wbsTreeContractService.checkNodeAllDate(contract);
|
|
|
|
+ }
|
|
executionTime.info("----数据保存完毕 ----");
|
|
executionTime.info("----数据保存完毕 ----");
|
|
//发生异常后直接返回,不进行合并
|
|
//发生异常后直接返回,不进行合并
|
|
if (errorPKeyIds.size() > 0) {
|
|
if (errorPKeyIds.size() > 0) {
|
|
@@ -4402,6 +4416,43 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ @Data
|
|
|
|
+ @AllArgsConstructor
|
|
|
|
+ @NoArgsConstructor
|
|
|
|
+ public static class BussfileDTO{
|
|
|
|
+ private String name;
|
|
|
|
+ private String url;
|
|
|
|
+ }
|
|
|
|
+ @PostMapping("/previewBussfile")
|
|
|
|
+ public R<List<BussfileDTO>> previewBussfile(@RequestPart("file")MultipartFile[] file){
|
|
|
|
+ List<BussfileDTO>list=new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < file.length; i++){
|
|
|
|
+ BussfileDTO dto = new BussfileDTO();
|
|
|
|
+ R<BladeFile> bladeFile = iossClient.addFileInfo(file[i]);
|
|
|
|
+ BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
+ String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
|
|
+ NewBladeFile newBladeFile = new NewBladeFile();
|
|
|
|
+ if (fileExtension.contains("xlsx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ dto.setUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("xls")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ dto.setUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("docx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.wordToPdf(file[i]);
|
|
|
|
+ dto.setUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("png") || fileExtension.contains("jpg") || fileExtension.contains("webp") || fileExtension.contains("apng") ||
|
|
|
|
+ fileExtension.contains("bmp") || fileExtension.contains("jepg") || fileExtension.contains("tif") || fileExtension.contains("gif")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.pngOrJpgToPdf(file[i]);
|
|
|
|
+ dto.setUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("pdf")) {
|
|
|
|
+ dto.setUrl(bladeFile1.getLink());
|
|
|
|
+ }
|
|
|
|
+ dto.setName(file[i].getOriginalFilename());
|
|
|
|
+ list.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return R.data(list);
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 质检附件追加
|
|
* 质检附件追加
|
|
@@ -4417,11 +4468,12 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "nodeId", value = "nodeId", required = true),
|
|
@ApiImplicitParam(name = "nodeId", value = "nodeId", required = true),
|
|
|
|
|
|
})
|
|
})
|
|
- public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId, Integer type, Long contractId, Integer classify, BladeUser b) {
|
|
|
|
|
|
+ public R addBussFile(Integer classify,Long contractId,@RequestParam("file") MultipartFile[] file, String nodeId, Integer type,BladeUser b) {
|
|
List<TableFile> fileList = new ArrayList<>();
|
|
List<TableFile> fileList = new ArrayList<>();
|
|
if (file != null && file.length >= 1) {
|
|
if (file != null && file.length >= 1) {
|
|
- for (MultipartFile multipartFile : file) {
|
|
|
|
- R<BladeFile> bladeFile = iossClient.addFileInfo(multipartFile);
|
|
|
|
|
|
+ for (int i = 0; i < file.length; i++) {
|
|
|
|
+
|
|
|
|
+ R<BladeFile> bladeFile = iossClient.addFileInfo(file[i]);
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
|
|
TableFile tableFile = new TableFile();
|
|
TableFile tableFile = new TableFile();
|
|
@@ -4429,7 +4481,7 @@ public class ExcelTabController extends BladeController {
|
|
String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
|
|
tableFile.setTabId(nodeId + "");
|
|
tableFile.setTabId(nodeId + "");
|
|
tableFile.setContractId(contractId);
|
|
tableFile.setContractId(contractId);
|
|
- tableFile.setName(multipartFile.getOriginalFilename());
|
|
|
|
|
|
+ tableFile.setName(file[i].getOriginalFilename());
|
|
tableFile.setType(type); //10 代表附件
|
|
tableFile.setType(type); //10 代表附件
|
|
if (type == 10 || type == 11 || type == 12 || type == 20 || type == 21 || type == 22) {
|
|
if (type == 10 || type == 11 || type == 12 || type == 20 || type == 21 || type == 22) {
|
|
tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
@@ -4439,8 +4491,26 @@ public class ExcelTabController extends BladeController {
|
|
tableFile.setExtension(fileExtension);
|
|
tableFile.setExtension(fileExtension);
|
|
tableFile.setClassify(classify);
|
|
tableFile.setClassify(classify);
|
|
fileList.add(tableFile);
|
|
fileList.add(tableFile);
|
|
|
|
+ NewBladeFile newBladeFile = new NewBladeFile();
|
|
|
|
+ if (fileExtension.contains("xlsx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("xls")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.excelToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("docx")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.wordToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("png") || fileExtension.contains("jpg") || fileExtension.contains("webp") || fileExtension.contains("apng") ||
|
|
|
|
+ fileExtension.contains("bmp") || fileExtension.contains("jepg") || fileExtension.contains("tif") || fileExtension.contains("gif")) {
|
|
|
|
+ newBladeFile = this.commonFileClient.pngOrJpgToPdf(file[i]);
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
+ } else if (fileExtension.contains("pdf")) {
|
|
|
|
+ tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
tableFileService.saveOrUpdateBatch(fileList);
|
|
tableFileService.saveOrUpdateBatch(fileList);
|
|
|
|
+
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
List<TableFileVO> data = tableFileService.selectTableFileListByTen(Long.valueOf(nodeId + ""), Integer.valueOf(classify));
|
|
List<TableFileVO> data = tableFileService.selectTableFileListByTen(Long.valueOf(nodeId + ""), Integer.valueOf(classify));
|
|
@@ -4453,7 +4523,9 @@ public class ExcelTabController extends BladeController {
|
|
if (tabpdf2.exists()) {
|
|
if (tabpdf2.exists()) {
|
|
tabpdf2.delete();
|
|
tabpdf2.delete();
|
|
}
|
|
}
|
|
- FileUtils.mergePdfPublicMethods(datainfo, listPdf);
|
|
|
|
|
|
+ if(datainfo.size()>=1){
|
|
|
|
+ FileUtils.mergePdfPublicMethods(datainfo, listPdf);
|
|
|
|
+ }
|
|
String netUrl = "";
|
|
String netUrl = "";
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
|
|
@@ -4509,6 +4581,24 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PostMapping("/add-bussfile-node-sort")
|
|
|
|
+ public R addBussFileNodeSort(@RequestBody AddBussFileSortDTO dto){
|
|
|
|
+ List<TableFile> tableFileList = tableFileService.list(new LambdaQueryWrapper<>(TableFile.class).eq(TableFile::getClassify, dto.getClassify()).eq(TableFile::getContractId, dto.getContractId()).eq(TableFile::getTabId, dto.getId()).eq(TableFile::getType, dto.getType()));
|
|
|
|
+ System.out.println(tableFileList);
|
|
|
|
+ if(dto.getList().length>0&&!tableFileList.isEmpty()){
|
|
|
|
+ for (TableFile file : tableFileList) {
|
|
|
|
+ for (int i = 0; i < dto.getList().length; i++) {
|
|
|
|
+ if(dto.getList()[i].equals(file.getName())){
|
|
|
|
+ file.setSort(i);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return R.status(tableFileService.updateBatchById(tableFileList));
|
|
|
|
+ }
|
|
|
|
+ return R.status(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@PostMapping("/save_nodeId")
|
|
@PostMapping("/save_nodeId")
|
|
@ApiOperationSupport(order = 72)
|
|
@ApiOperationSupport(order = 72)
|
|
@@ -4635,16 +4725,21 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true),
|
|
@ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true),
|
|
@ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
|
|
@ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
|
|
})
|
|
})
|
|
- public R<List<Map<String, Object>>> getBussDataInfoTrialentrust(Long id, Long pkeyId, Long contractId, Long sampleId, String formData,Boolean isCancel) {
|
|
|
|
|
|
+ public R<List<Map<String, Object>>> getBussDataInfoTrialentrust(Long id, Long pkeyId, Long contractId, Long sampleId, String formData) {
|
|
JSONObject jsonObject = JSONObject.parseObject(formData);
|
|
JSONObject jsonObject = JSONObject.parseObject(formData);
|
|
Boolean isrmove=true;
|
|
Boolean isrmove=true;
|
|
- if(isCancel==null){
|
|
|
|
- isCancel=false;
|
|
|
|
- }
|
|
|
|
- List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrialentrust(id, pkeyId, contractId, sampleId, jsonObject,isrmove,isCancel);
|
|
|
|
|
|
+ List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrialentrust(id, pkeyId, contractId, sampleId, jsonObject,isrmove);
|
|
return R.data(bussDataInfoTrial);
|
|
return R.data(bussDataInfoTrial);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/cancelSample")
|
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
|
+ @ApiOperation(value = "委托单取消关联样品")
|
|
|
|
+ public R cancelSample(Long groupId, Long pkeyId, Long contractId,Long sampleId1) throws Exception {
|
|
|
|
+ excelTabService.cancelSample(groupId,pkeyId,contractId,sampleId1);
|
|
|
|
+ return R.status(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
public static synchronized InputStream getOSSInputStream2(String urlStr) throws Exception {
|
|
public static synchronized InputStream getOSSInputStream2(String urlStr) throws Exception {
|
|
//获取OSS文件流
|
|
//获取OSS文件流
|
|
URL url = new URL(urlStr);
|
|
URL url = new URL(urlStr);
|