huangjn 2 лет назад
Родитель
Сommit
3a07067c24

+ 32 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -18,6 +18,7 @@ import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.RecycleBinClient;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.business.service.IConstructionLedgerService;
+import org.springblade.business.service.IInformationQueryFileService;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.*;
 import org.springblade.common.utils.CommonUtil;
@@ -71,6 +72,8 @@ public class InformationWriteQueryController extends BladeController {
 
 	private final IInformationQueryService informationQueryService;
 
+	private final IInformationQueryFileService informationQueryFileService;
+
 	private final IDictBizClient dictBizClient;
 
 	private final IConstructionLedgerService constructionLedgerService;
@@ -514,11 +517,36 @@ public class InformationWriteQueryController extends BladeController {
     public R<String> batchPrint(@RequestParam String ids) {
 		//获取勾选的数据
     	List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(ids.split(",")));
-    	//获取pdf
-		List<String> pdfList = queries.stream().map(query -> StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl()).distinct().collect(Collectors.toList());
-    	pdfList.removeIf(StringUtils::isEmpty);
+		//pdf集合
+		List<String> pdfList = new ArrayList<>();
+
+    	for(InformationQuery query : queries){
+    		switch (query.getType()){
+				case 1:
+					//资料填报
+					pdfList.add(StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
+					break;
+				case 3:
+					//首件,需要查出关联的数据
+					//先存放本表
+					pdfList.add(StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
+					//存放关联表
+					pdfList.add(query.getLinkMergePdfUrl());
+					//查询总结报告
+					InformationQueryFile linkFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
+					if(linkFile != null){
+						pdfList.add(linkFile.getPdfUrl());
+					}
+					break;
+				default:
+					break;
+			}
+		}
+		//去掉空元素
+		pdfList.removeIf(StringUtils::isEmpty);
+
     	//执行合并
-		String mergeName = SnowFlakeUtil.getId() + ".pdf", mergeUrl = "/Users/doc/print/" + mergeName;
+		String mergeName = SnowFlakeUtil.getId() + ".pdf", mergeUrl = "/Users/hongchuangyanfa/Desktop/print/" + mergeName;
 		FileUtils.mergePdfPublicMethods(pdfList, mergeUrl);
 
 		//上传

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/MaterialProgressController.java

@@ -202,7 +202,7 @@ public class MaterialProgressController extends BladeController {
 
         //获取合同段信息
         ContractInfo contract = this.contractClient.getContractById(Long.parseLong(contractId));
-        if("2".equals(classifyType) && contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
+        if("1".equals(classifyType) && contract != null && (new Integer("2").equals(contract.getContractType()) || new Integer("3").equals(contract.getContractType()))){
             //监理合同段
             List<String> sgContractIds = this.contractClient.getProcessContractByJLContractId(contractId);
             if(sgContractIds != null && sgContractIds.size() > 0){

+ 7 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -78,6 +78,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     private final IInformationQueryService informationQueryService;
 
+    private final IInformationQueryFileService informationQueryFileService;
+
     private final IContractLogService contractLogService;
 
     private final IMessageWarningService messageWarningService;
@@ -200,12 +202,16 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     //封面
                     vo.setApprovalFileList(query.getName(), StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl());
                 }
-                //不是审批时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
+                //不是签章时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
                 if(!isTask){
                     //关联资料
                     if(StringUtils.isNotEmpty(query.getLinkMergePdfUrl())){
                         vo.setApprovalFileList("首件关联资料", query.getLinkMergePdfUrl());
                     }
+                    InformationQueryFile queryFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
+                    if(queryFile != null){
+                        vo.setApprovalFileList(queryFile.getName(), queryFile.getPdfUrl());
+                    }
                 }
 
             } else {