Browse Source

修改档案相关BUG

qianxb 1 year ago
parent
commit
d303f796b1

+ 6 - 5
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveOfflineVersionInfoController.java

@@ -44,11 +44,12 @@ public class ArchiveOfflineVersionInfoController {
     @ApiOperation(value = "打包数据")
     @GetMapping("/packData")
     public R<String> packData(Long projectId) throws Exception {
-        //先获取状态,同时只能有一个项目打包
-        offlineVersionInfoService.getPackStatus();
-        //异步调用自动打包上传,完成后修改数据库信息
-        offlineVersionInfoService.packData(projectId);
-        return R.data("最新数据后台自动打包中,打包完成后会更新打包日期");
+//        //先获取状态,同时只能有一个项目打包
+//        offlineVersionInfoService.getPackStatus();
+//        //异步调用自动打包上传,完成后修改数据库信息
+//        offlineVersionInfoService.packData(projectId);
+//        return R.data("最新数据后台自动打包中,打包完成后会更新打包日期");
+        return R.data("暂时停止使用离线档案,请联系管理员");
     }
 
     /**

+ 2 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml

@@ -1053,7 +1053,7 @@
                     and aei.expert_id = #{userId} and is_pass = 0) > 0 then '整改' else null end) as updateStatusName
         from m_archive_tree_contract atc right join u_archives_auto uaa on atc.id = uaa.node_id
         WHERE uaa.is_apply = 1 and uaa.project_id = #{projectId} and atc.project_id = #{projectId} and atc.is_deleted = 0 and uaa.is_deleted =0
-          and FIND_IN_SET(#{id}, atc.ancestors)
+          and (atc.id =#{id} or FIND_IN_SET(#{id}, atc.ancestors))
         <if test="searchValue != null and searchValue != ''">
             <if test="searchType == 1">
                 and uaa.name like concat('%',#{searchValue},'%')
@@ -1073,7 +1073,7 @@
             and aei.expert_id = #{userId} and is_pass = 0) > 0 then '整改' else null end) as updateStatusName
         from m_archive_tree_contract atc right join u_archives_auto uaa on atc.id = uaa.node_id
         WHERE uaa.is_apply = 1 and uaa.project_id = #{projectId} and atc.project_id = #{projectId} and atc.is_deleted = 0 and uaa.is_deleted =0
-        and FIND_IN_SET(#{id}, atc.ancestors)
+        and (atc.id =#{id} or FIND_IN_SET(#{id}, atc.ancestors))
         <if test="userId != null">
             and FIND_IN_SET(#{userId}, uaa.expert_id)
         </if>

+ 22 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -2910,13 +2910,33 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		ProjectInfo project = projectClient.getById(dto.getProjectId() + "");
 		List<Long> longs = Func.toLongList(dto.getArchiveIds());
 		List<ArchivesAutoVO2> vo2s = baseMapper.getAllArchive(longs);
+		String pdfUrl = null;
 		try {
-			String pdfUrl = createAppPdf(project.getProjectName(),vo2s);
-			task.setAttachmentPdfUrl(pdfUrl);
+			pdfUrl = createAppPdf(project.getProjectName(),vo2s);
+			if (StringUtils.isBlank(pdfUrl)){
+				throw new ServiceException("生成上报PDF失败");
+			}
 		}catch (Exception e){
 			throw new ServiceException(e.getMessage());
 		}
 		//如果存在附件则拼接
+		if (StringUtils.isNotBlank(dto.getAttachmentPdfUrl())){
+			String localFile = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveCheck/"+dto.getProjectId()+".pdf";
+			List<String> urlList = new ArrayList<>();
+			urlList.add(pdfUrl);
+			urlList.add(dto.getAttachmentPdfUrl());
+			FileUtils.mergePdfPublicMethods(urlList, localFile);
+			System.out.println("生成的pdf:"+pdfUrl);
+			System.out.println("附件的pdf:"+dto.getAttachmentPdfUrl());
+			BladeFile bladeFile = this.newIOSSClient.uploadFile(  "123.pdf", localFile);
+			if (bladeFile == null || StringUtils.isBlank(bladeFile.getLink())){
+				throw new ServiceException("合并PDF失败");
+			}
+			System.out.println("合并的pdf:"+bladeFile.getLink());
+			task.setAttachmentPdfUrl(bladeFile.getLink());
+		}else {
+			task.setAttachmentPdfUrl(pdfUrl);
+		}
 		//保存任务
 		taskClient.saveTask(task);
 		//根据任务人设置task_parallel

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

@@ -668,7 +668,7 @@ public class TaskController extends BladeController {
                                     dto.setAccount("expert" + phone);
                                     //如果当前账户已经存在,则代表账号已经注册,直接跳过当前
                                     R<User> r = userClient.userByAccount(AuthUtil.getTenantId(), dto.getAccount());
-                                    if (r.getData() != null) {
+                                    if (r.getData() != null && r.getData().getId() != null) {
                                         if (expertIds.length() == 0){
                                             expertIds.append(r.getData().getId());
                                         }else {