Browse Source

电签相关

huangjn 3 years ago
parent
commit
9f9577fbf7

+ 17 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -225,6 +225,18 @@ public class InformationWriteQueryController extends BladeController {
 			//获取被复制节点的表格
 			List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(copyVO.getNeedCopyPrimaryKeyId()), "queryTable", "");
 			if(tableList != null && tableList.size() > 0){
+				//获取合同段信息
+				ContractInfo contract = this.contractClient.getContractById(Long.parseLong(tableList.get(0).getContractId()));
+				if(new Integer("1").equals(contract.getIsCopyData())){
+					//说明开启数据复制限制,根据合同段类型判断哪些数据是能够被复制的
+					String removeString = new Integer("1").equals(contract.getContractType()) ? "1,2,3" : "5,6,7";
+					//删除掉不符合条件的数据
+					tableList.removeIf(table -> Arrays.asList(removeString.split(",")).contains(table.getTableType().toString()));
+				}
+				if(tableList.size() <= 0){
+					return R.data(300, false, "当前合同段已开启数据隔离,当前节点下未找到符合复制条件的数据");
+				}
+
 				//获取表格的业务数据
 				Map<String, List<List<Map<String, Object>>>> tableBusinessDataMap = new HashMap<>();
 				for(WbsTreeContract treeContract : tableList){
@@ -454,7 +466,7 @@ public class InformationWriteQueryController extends BladeController {
 					List<String> urls = new ArrayList<>();
 					result.forEach(query -> urls.add(StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl()));
 					//删除空数据
-					urls.removeIf(StringUtils::isNotEmpty);
+					urls.removeIf(StringUtils::isEmpty);
 					//打包下载
 					FileUtils.batchDownloadFileToZip(urls, response);
 				}
@@ -1365,7 +1377,7 @@ public class InformationWriteQueryController extends BladeController {
 		WbsTreeContract node = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(vo.getWbsId());
 		if(!new Integer("6").equals(node.getDeptCategory()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
 			//不是工序,则查询当前节点下的所有填报节点
-			List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), vo.getContractId().toString());
+			List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
 			if(StringUtils.isNotEmpty(vo.getIsFirst())){
 				//如果是首件列表请求,则删掉没有标记为首件的数据
 				queryDataResult.removeIf(data -> StringUtils.isEmpty(data.getFirstId()));
@@ -1376,6 +1388,9 @@ public class InformationWriteQueryController extends BladeController {
 		}
 		//设置进集合中
 		vo.setWbsIds(submitNodeKeyIds);
+		if(StringUtils.isNotEmpty(vo.getContractIdRelation())){
+			vo.setContractId(Long.valueOf(vo.getContractIdRelation()));
+		}
 
 		return R.data(this.informationQueryService.selectInformationQueryPage(Condition.getPage(query), vo));
 	}

+ 16 - 16
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -116,23 +116,23 @@ public class TaskController extends BladeController {
 		result.setFormDataId(formDataId);
 		result.setApprovalType(approvalType);
 
-		TaskApprovalVO vo = this.taskService.queryBusinessData(result);
+//		TaskApprovalVO vo = this.taskService.queryBusinessData(result);
 		//所有文件集合
-		List<String> urlList = new ArrayList<>();
-		if(vo != null && vo.getApprovalFileList().size() > 0){
-			vo.getApprovalFileList().forEach(file -> urlList.add(file.getFileUrl()));
-			String fileName = SnowFlakeUtil.getId() + ".pdf";
-			String localImgUrl = "D:/project/file/" + fileName;
-			//合并方法
-			FileUtils.mergePdfPublicMethods(urlList, localImgUrl);
-
-			BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName, localImgUrl);
-			if(bladeFile != null && StringUtils.isNotEmpty(bladeFile.getLink())){
-				result.setApprovalFileList(fileName, bladeFile.getLink());
-			}
-		}
-
-		return R.data(result);
+//		List<String> urlList = new ArrayList<>();
+//		if(vo != null && vo.getApprovalFileList().size() > 0){
+//			vo.getApprovalFileList().forEach(file -> urlList.add(file.getFileUrl()));
+//			String fileName = SnowFlakeUtil.getId() + ".pdf";
+//			String localImgUrl = "D:/project/file/" + fileName;
+//			//合并方法
+//			FileUtils.mergePdfPublicMethods(urlList, localImgUrl);
+//
+//			BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName, localImgUrl);
+//			if(bladeFile != null && StringUtils.isNotEmpty(bladeFile.getLink())){
+//				result.setApprovalFileList(fileName, bladeFile.getLink());
+//			}
+//		}
+
+		return R.data(this.taskService.queryBusinessData(result));
 	}
 
 	/**

+ 1 - 2
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -82,8 +82,7 @@
         WHERE
             wtc.wbs_type = 1
         AND wtc.type = 1
-        AND (wtc.dept_category in(1,2,3,4,5,6) and wtc.major_data_type in(1,2,3,4))
-        AND wtc.major_data_type != 5
+        AND wtc.major_data_type in(1,2,3,4)
         AND wtc.ancestors like concat('%',#{parentId},'%')
         AND wtc.contract_id = #{contractId}
         AND wtc.is_deleted = 0

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

@@ -10,6 +10,7 @@ import org.apache.commons.lang.time.DateUtils;
 import org.springblade.business.entity.*;
 import org.springblade.business.mapper.TaskMapper;
 import org.springblade.business.service.*;
+import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskVO;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -39,8 +40,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
-/**
+ /**
  * 任务审核主表 服务实现类
  *
  * @author BladeX
@@ -118,9 +120,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 List<WbsTreeContract> tableData = this.wbsTreeContractClient.queryProcessSubmitBusinessDataByPrimaKeyIdAndClassify(query.getWbsId().toString(), query.getClassify().toString());
                 if(tableData != null && tableData.size() > 0){
                     //设置数据
-                    for(WbsTreeContract node : tableData){
-                        vo.setApprovalFileList(node.getDeptName(), node.getPdfUrl());
-                    }
+                    List<String> pdfUrls = tableData.stream().map(WbsTreeContract::getPdfUrl).distinct().collect(Collectors.toList());
+                    //需要重新合并PDF
+//                    FileUtils.mergePdfPublicMethods();
+
                     return vo;
                 }
             } else {

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -234,7 +234,7 @@ public class TextdictInfoController extends BladeController {
 	 */
 	@PostMapping("/save_sigInfo")
 	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
+	@ApiOperation(value = "保存电签", notes = "保存电签")
 	public R<String> saveSigInfo(@Valid @RequestBody JSONObject dataInfo) throws IOException {
 
 		JSONArray jsonArray = dataInfo.getJSONArray("dataInfo");
@@ -269,7 +269,7 @@ public class TextdictInfoController extends BladeController {
 			textdictInfo.setSigRoleId(jsonObject.getString("sigRoleId"));
 			textdictInfo.setTrTd(jsonObject.getString("trTd"));
 			textdictInfo.setTabId(jsonObject.getString("tabId"));
-			textdictInfo.setIsDeleted(1);
+			textdictInfo.setIsDeleted(0);
 			textdictInfos.add(textdictInfo);
 		}
 		textdictInfoService.saveOrUpdateBatch(textdictInfos);