Browse Source

Merge branch 'test-merge' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

lvy 1 week ago
parent
commit
34aa4d62c8

+ 1 - 1
blade-common/src/main/java/org/springblade/common/utils/AsyncConfig.java

@@ -20,7 +20,7 @@ public class AsyncConfig {
     public ThreadPoolExecutor getAsyncExecutor() {
         return new ThreadPoolMonitor(cpuNum
                 , 15
-                , 180
+                , 600
                 , TimeUnit.SECONDS
                 , new LinkedBlockingQueue<>(2000)
                 , new ThreadPoolExecutor.DiscardOldestPolicy(), "manager-thread-pool");

File diff suppressed because it is too large
+ 172 - 175
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java


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

@@ -1527,48 +1527,51 @@ public class TaskController extends BladeController {
                             Task::getId,
                             task -> task));
         }
-        //所有满足条件的日志 转map
-        String logQuery = "select business_id,create_user_name ,create_time, operation_type, save_data from u_operation_log where operation_type in (6,9,12,15,18,21,24,26,61,62)";
-        List<OperationLog> operationLogs = jdbcTemplate.query(logQuery, new BeanPropertyRowMapper<>(OperationLog.class));
-        if(ObjectUtil.isNotEmpty(operationLogs)){
-             operationLogMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getBusinessId));
-        }
-        for (BusinessTaskPageVO businessTaskPageVO : pageList) {
-            if("已废除".equals(businessTaskPageVO.getTaskStatusName())){
-                Long taskId = businessTaskPageVO.getTaskId();
-                Task task = taskMap.get(taskId);
-                if (ObjectUtil.isEmpty(task)){
-                    continue;
-                }
-                //任务创建时间
-                Date createTime = task.getCreateTime();
-                //废除时间肯定在任务创建时间之后  选择距离当前任务创建时间最近的一条数据
-                List<OperationLog> operationLogsF = operationLogMap.get(task.getFormDataId());
-
-                if(ObjectUtil.isNotEmpty(operationLogsF)){
-                    Optional<OperationLog> min = operationLogsF.stream().filter(o -> o.getCreateTime().compareTo(createTime) >= 0)
-                            .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
-                    if (min.isPresent()){
-                        OperationLog operationLog = min.get();
-                        String createUserName = operationLog.getCreateUserName();
-                        String date = DateUtil.formatDateTime(operationLog.getCreateTime());
-                        if (operationLog.getOperationType() != null && operationLog.getOperationType() == 61) {
-                            businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date);
-                            String saveData = operationLog.getSaveData();
-                            if (saveData != null && !saveData.isEmpty()) {
-                                try  {
-                                    JSONObject data = JSONObject.parseObject(saveData);
-                                    if (data != null && data.containsKey("comment")) {
-                                        businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date + ";驳回原因:"+data.getString("comment"));
+        if(CollectionUtil.isNotEmpty(pageList)){
+            //所有满足条件的日志 转map
+            Set<String> collect = pageList.stream().map(BusinessTaskPageVO::getFormDataId).collect(Collectors.toSet());
+            String logQuery = "select business_id,create_user_name ,create_time, operation_type, save_data from u_operation_log where business_id in (" + StringUtil.join(collect) + ") and operation_type in (6,9,12,15,18,21,24,26,61,62)";
+            List<OperationLog> operationLogs = jdbcTemplate.query(logQuery, new BeanPropertyRowMapper<>(OperationLog.class));
+            if(ObjectUtil.isNotEmpty(operationLogs)){
+                operationLogMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getBusinessId));
+            }
+            for (BusinessTaskPageVO businessTaskPageVO : pageList) {
+                if("已废除".equals(businessTaskPageVO.getTaskStatusName())){
+                    Long taskId = businessTaskPageVO.getTaskId();
+                    Task task = taskMap.get(taskId);
+                    if (ObjectUtil.isEmpty(task)){
+                        continue;
+                    }
+                    //任务创建时间
+                    Date createTime = task.getCreateTime();
+                    //废除时间肯定在任务创建时间之后  选择距离当前任务创建时间最近的一条数据
+                    List<OperationLog> operationLogsF = operationLogMap.get(task.getFormDataId());
+
+                    if(ObjectUtil.isNotEmpty(operationLogsF)){
+                        Optional<OperationLog> min = operationLogsF.stream().filter(o -> o.getCreateTime().compareTo(createTime) >= 0)
+                                .min(Comparator.comparing(t -> t.getCreateTime().getTime() - createTime.getTime()));
+                        if (min.isPresent()){
+                            OperationLog operationLog = min.get();
+                            String createUserName = operationLog.getCreateUserName();
+                            String date = DateUtil.formatDateTime(operationLog.getCreateTime());
+                            if (operationLog.getOperationType() != null && operationLog.getOperationType() == 61) {
+                                businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date);
+                                String saveData = operationLog.getSaveData();
+                                if (saveData != null && !saveData.isEmpty()) {
+                                    try  {
+                                        JSONObject data = JSONObject.parseObject(saveData);
+                                        if (data != null && data.containsKey("comment")) {
+                                            businessTaskPageVO.setEVisaStatus("驳回成功:"+ createUserName +"-"+ date + ";驳回原因:"+data.getString("comment"));
+                                        }
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
                                     }
-                                } catch (Exception e) {
-                                    e.printStackTrace();
                                 }
+                            } else if (operationLog.getOperationType() != null && operationLog.getOperationType() == 62) {
+                                businessTaskPageVO.setEVisaStatus("撤回成功:"+ createUserName +"-"+ date);
+                            } else {
+                                businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+ createUserName +"-"+ date);
                             }
-                        } else if (operationLog.getOperationType() != null && operationLog.getOperationType() == 62) {
-                            businessTaskPageVO.setEVisaStatus("撤回成功:"+ createUserName +"-"+ date);
-                        } else {
-                            businessTaskPageVO.setEVisaStatus(businessTaskPageVO.getEVisaStatus()+":"+ createUserName +"-"+ date);
                         }
                     }
                 }
@@ -2138,7 +2141,7 @@ public class TaskController extends BladeController {
     /**
      * 任务超时提示信息
      */
-    @Scheduled(cron = "0 0 3 * * ?")
+//    @Scheduled(cron = "0 0 3 * * ?")
     public void TaskTimeoutTips() {
         String key = "task.time.out";
         String value = ParamCache.getValue(key);

+ 36 - 39
blade-service/blade-business/src/main/java/org/springblade/business/sync/TaskSync.java

@@ -49,34 +49,32 @@ public class TaskSync {
     private IUserClient userClient;
 
 
-    public void reSigningEVisaStatusSync(List<InformationQuery> dtos, String header) {
+    public void reSigningEVisaStatusSync(InformationQuery dto, String header) {
         log.info("数据正在重刷,线程名称:{}", Thread.currentThread().getName());
 
-        for (InformationQuery dto : dtos) {
-            informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
-                    .eq(InformationQuery::getId, dto.getId())
-                    .set(InformationQuery::getEVisaPdfUrl, null)
-                    .set(InformationQuery::getUpdateTime, DateTime.now())
-
-                    .set(InformationQuery::getPdfUrl, null));
-            R result = this.saveNodePdf(dto.getClassify() + "", dto.getWbsId() + "", dto.getContractId() + "", dto.getProjectId() + "", header);
-
-            LambdaUpdateWrapper<InformationQuery> lambda = Wrappers.<InformationQuery>update().lambda();
-            if (result == null || result.getCode() != 200) {
-                //重签失败
-                lambda.set(InformationQuery::getSaveAgain, 3)
-                        .set(InformationQuery::getEVisaPdfUrl, dto.getEVisaPdfUrl())
-                        .setSql("save_again_count = save_again_count + 1")
-                        .set(InformationQuery::getPdfUrl, dto.getPdfUrl());
-            } else {
-                //成功重签
-                lambda.set(InformationQuery::getSaveAgain, 2);
-            }
-            lambda.set(InformationQuery::getUpdateTime, DateTime.now());
-            lambda.eq(InformationQuery::getId, dto.getId());
-
-            informationQueryService.update(lambda);
+        informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
+                .eq(InformationQuery::getId, dto.getId())
+                .set(InformationQuery::getEVisaPdfUrl, null)
+                .set(InformationQuery::getUpdateTime, DateTime.now())
+
+                .set(InformationQuery::getPdfUrl, null));
+        R result = this.saveNodePdf(dto.getClassify() + "", dto.getWbsId() + "", dto.getContractId() + "", dto.getProjectId() + "", header);
+
+        LambdaUpdateWrapper<InformationQuery> lambda = Wrappers.<InformationQuery>update().lambda();
+        if (result == null || result.getCode() != 200) {
+            //重签失败
+            lambda.set(InformationQuery::getSaveAgain, 3)
+                    .set(InformationQuery::getEVisaPdfUrl, dto.getEVisaPdfUrl())
+                    .setSql("save_again_count = save_again_count + 1")
+                    .set(InformationQuery::getPdfUrl, dto.getPdfUrl());
+        } else {
+            //成功重签
+            lambda.set(InformationQuery::getSaveAgain, 2);
         }
+        lambda.set(InformationQuery::getUpdateTime, DateTime.now());
+        lambda.eq(InformationQuery::getId, dto.getId());
+
+        informationQueryService.update(lambda);
         log.info("数据重刷完毕,线程名称:{}", Thread.currentThread().getName());
     }
 
@@ -86,7 +84,7 @@ public class TaskSync {
      * 一个小时检查一次
      */
     @Scheduled(cron = "0 0 * * * ?")
-    public void updateStuckTask(){
+    public void updateStuckTask() {
         List<InformationQuery> list = informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
                 .eq(InformationQuery::getSaveAgain, 1)
                 .eq(InformationQuery::getIsDeleted, 0));
@@ -98,9 +96,11 @@ public class TaskSync {
                 ids.add(informationQuery.getId());
             }
         }
-        informationQueryService.update(null, Wrappers.<InformationQuery>lambdaUpdate()
-                .set(InformationQuery::getSaveAgain, 0)
-                .in(InformationQuery::getId, ids));
+        if (CollectionUtils.isNotEmpty(ids)) {
+            informationQueryService.update(null, Wrappers.<InformationQuery>lambdaUpdate()
+                    .set(InformationQuery::getSaveAgain, 0)
+                    .in(InformationQuery::getId, ids));
+        }
     }
 
 
@@ -115,33 +115,30 @@ public class TaskSync {
         List<InformationQuery> list = informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
                 .in(InformationQuery::getSaveAgain, 0, 3)
                 .eq(InformationQuery::getIsDeleted, 0)
-                //失败重刷次数小于5
-                .lt(InformationQuery::getSaveAgainCount, 5)
+                //失败重刷次数小于2
+                .lt(InformationQuery::getSaveAgainCount, 2)
                 .last("limit 50"));
-        if(CollectionUtils.isEmpty(list)){
+        if (CollectionUtils.isEmpty(list)) {
             return;
         }
 
-        List<List<InformationQuery>> partition = Lists.partition(list, 10);
-
-        for (List<InformationQuery> informationQueries : partition) {
-            List<Long> collect = informationQueries.stream().map(InformationQuery::getId).collect(Collectors.toList());
+        for (InformationQuery informationQueries : list) {
             //修改状态之后开始重刷
             boolean update = informationQueryService.update(Wrappers.<InformationQuery>update().lambda()
                     .set(InformationQuery::getSaveAgain, 1)
                     .set(InformationQuery::getUpdateTime, DateTime.now())
-                    .in(InformationQuery::getId, collect));
+                    .eq(InformationQuery::getId, informationQueries.getId()));
             if (update) {
                 CompletableFuture.runAsync(() -> {
                     try {
                         /*===============执行批量任务===============*/
                         this.reSigningEVisaStatusSync(informationQueries, header);
                     } catch (Exception e) {
-                        log.error("执行重刷任务失败,任务ID列表:{}", collect, e);
+                        log.error("执行重刷任务失败,任务ID列表:{}", informationQueries.getId(), e);
                         // 可选:回滚状态或标记为失败
                     }
                 }, executor).exceptionally(throwable -> {
-                    log.error("异步任务执行异常,任务ID列表:{}", collect, throwable);
+                    log.error("异步任务执行异常,任务ID列表:{}", informationQueries.getId(), throwable);
                     return null;
                 });
             }

+ 210 - 96
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/AlbumController.java

@@ -162,7 +162,7 @@ public class AlbumController extends BladeController {
 		album.setStartDate(strings[0]);
 		album.setEndDate(strings[1]);
 		//获取固定表格
-		ExcelTab excelTab = this.excelTabClient.getById("1550363881879781377"); //影像资料模板
+		ExcelTab excelTab = this.excelTabClient.getById("1950465427890794498"); //影像资料模板
 		String file_path = null;
 		if (SystemUtils.isWindows()) {
 			file_path = "C:\\pdfFiles\\";
@@ -180,117 +180,231 @@ public class AlbumController extends BladeController {
 		}
 		if (excelTab != null) {
 			//获取数据
+//			try {
+//					//需要删除的本地文件集合
+//					List<String> removeList = new ArrayList<>();
+//							//获取模板文件流
+//							InputStream modInput = null;
+//							FileInputStream excelFileInput = null;
+//							FileOutputStream outputStream = null;
+//							Workbook workbook = null;
+//
+//							List<String> pdfFileList = new ArrayList<>();
+//							//两个图片一组
+//							List<List<String>> groupUrls =  CommonUtil.getBatchSize(uris, 2);
+//							for (List<String> urls : groupUrls) {
+//								try {
+//									//创建模板Workbook
+//									modInput = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
+//									if (modInput != null) {
+//										workbook = WorkbookFactory.create(modInput);
+//										for (int i = 0, l = urls.size(); i < l; i++) {
+//											try {
+//												CreationHelper helper = workbook.getCreationHelper();
+//												Sheet sheet = workbook.getSheetAt(0);
+//												Drawing<?> drawing = sheet.createDrawingPatriarch();
+//												ClientAnchor anchor = helper.createClientAnchor();
+//												Long id = map.get(urls.get(i));
+//								                ImageClassificationFile file=imageClassificationFileClient.getImageClassificationFileById(id);
+//												//获取文件流
+//												byte[] bytes = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(urls.get(i)));
+//												if (bytes[0] == 82 && bytes[1] == 73 && bytes[2] == 70){
+//													bytes = CommonUtil.webpToPngBytes(CommonUtil.getOSSInputStream(urls.get(i)));
+//												}
+//												//压缩文件大小
+//												byte[] byteNew = FileUtils.compressImage(bytes);
+//												//创建图片
+//												Picture picture = drawing.createPicture(anchor, workbook.addPicture(byteNew, Workbook.PICTURE_TYPE_PNG));
+//												picture.resize();
+//
+//												//图片定位
+//												FileUtils.imageOrientation(sheet, anchor, i == 1 ? new DataVO(1, 8) : new DataVO(0, 2));
+//
+//												//定位其它信息
+//												//文字说明
+//												sheet.getRow(i == 0 ? 0 : 6).getCell(i == 0 ? 3 : 0).setCellValue("文字说明:\n" + "  " + (ObjectUtil.isNotEmpty(file.getTextContent()) ? file.getTextContent() : ""));
+//												//照片号
+//												sheet.getRow(i == 0 ? 1 : 7).getCell(i == 0 ? 3 : 0).setCellValue("照片号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getPhotoCode()) ? file.getPhotoCode() : ""));
+//												//底片号
+//												sheet.getRow(i == 0 ? 2 : 8).getCell(i == 0 ? 3 : 0).setCellValue("底片号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getFilmCode()) ? file.getFilmCode() : ""));
+//												//题名
+//												sheet.getRow(i == 0 ? 3 : 9).getCell(i == 0 ? 0 : 2).setCellValue("题名:\n" + "  " + (ObjectUtil.isNotEmpty(file.getTitle()) ? file.getTitle() : ""));
+//												//参见号
+//												sheet.getRow(i == 0 ? 3 : 9).getCell(i == 0 ? 2 : 0).setCellValue("参见号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getSeeAlsoCode()) ? file.getSeeAlsoCode() : ""));
+//												//拍摄时间
+//												sheet.getRow(i == 0 ? 4 : 10).getCell(i == 0 ? 2 : 0).setCellValue("拍摄时间:\n" + "  " + (ObjectUtil.isNotEmpty(DateUtil.format(file.getShootingTime(), "yyyy-MM-dd")) ? DateUtil.format(file.getShootingTime(), "yyyy-MM-dd") : ""));
+//												//拍摄者
+//												sheet.getRow(i == 0 ? 5 : 11).getCell(i == 0 ? 2 : 0).setCellValue("拍摄者:\n" + "  " + (ObjectUtil.isNotEmpty(file.getShootingUser()) ? file.getShootingUser() : ""));
+//
+//											} catch (Exception e) {
+//												e.printStackTrace();
+//											}
+//										}
+//
+//										String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
+//										outputStream = new FileOutputStream(locationFile);
+//										//记录文件删除
+//										removeList.add(locationFile);
+//										//生成一份新的excel
+//										workbook.write(outputStream);
+//										//将excel转PDF
+//										File excelFile = new File(locationFile);
+//										excelFileInput = new FileInputStream(excelFile);
+//										MultipartFile files = new MockMultipartFile("file", excelFile.getName(), "text/plain", IOUtils.toByteArray(excelFileInput));
+//										NewBladeFile bladeFile = this.commonFileClient.excelToPdf(files);
+//										if (bladeFile != null) {
+//											pdfFileList.add(bladeFile.getPdfUrl());
+//										}
+//									}
+//								} catch (Exception e) {
+//									e.printStackTrace();
+//								} finally {
+//									if (outputStream != null) {
+//										IoUtil.closeQuietly(outputStream);
+//									}
+//									if (modInput != null) {
+//										IoUtil.closeQuietly(modInput);
+//									}
+//									if (excelFileInput != null) {
+//										IoUtil.closeQuietly(excelFileInput);
+//									}
+//									if (workbook != null) {
+//										IoUtil.closeQuietly(workbook);
+//									}
+//								}
+//							}
+//
+//							//合并pdf并上传
+//							String mergeName = SnowFlakeUtil.getId() + ".pdf";
+//							String mergeUrl = file_path + mergeName;
+//							FileUtils.mergePdfPublicMethods(pdfFileList, mergeUrl);
+//							//记录文件删除
+//							removeList.add(mergeUrl);
+//							//上传
+//							BladeFile bladeFile = this.newIOSSClient.uploadFile(mergeName, mergeUrl);
+//							if (bladeFile != null) {
+//								album.setImagesPdf(bladeFile.getLink());
+//							}
+//
+//					if (removeList.size() > 0) {
+//						//删除本地文件
+//						CommonUtil.removeFile(removeList);
+//					}
+//
+//			} catch (Exception e) {
+//				e.printStackTrace();
+//			}
 			try {
-					//需要删除的本地文件集合
-					List<String> removeList = new ArrayList<>();
-							//获取模板文件流
-							InputStream modInput = null;
-							FileInputStream excelFileInput = null;
-							FileOutputStream outputStream = null;
-							Workbook workbook = null;
+				//需要删除的本地文件集合
+				List<String> removeList = new ArrayList<>();
+				//获取模板文件流
+				InputStream modInput = null;
+				FileInputStream excelFileInput = null;
+				FileOutputStream outputStream = null;
+				Workbook workbook = null;
 
-							List<String> pdfFileList = new ArrayList<>();
-							//两个图片一组
-							List<List<String>> groupUrls =  CommonUtil.getBatchSize(uris, 2);
-							for (List<String> urls : groupUrls) {
+				List<String> pdfFileList = new ArrayList<>();
+				//两个图片一组
+				List<List<String>> groupUrls = CommonUtil.getBatchSize(uris, 2);
+				for (List<String> urls : groupUrls) {
+					try {
+						//创建模板Workbook
+						modInput = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
+						if (modInput != null) {
+							workbook = WorkbookFactory.create(modInput);
+							for (int i = 0, l = urls.size(); i < l; i++) {
 								try {
-									//创建模板Workbook
-									modInput = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
-									if (modInput != null) {
-										workbook = WorkbookFactory.create(modInput);
-										for (int i = 0, l = urls.size(); i < l; i++) {
-											try {
-												CreationHelper helper = workbook.getCreationHelper();
-												Sheet sheet = workbook.getSheetAt(0);
-												Drawing<?> drawing = sheet.createDrawingPatriarch();
-												ClientAnchor anchor = helper.createClientAnchor();
-												Long id = map.get(urls.get(i));
-								                ImageClassificationFile file=imageClassificationFileClient.getImageClassificationFileById(id);
-												//获取文件流
-												byte[] bytes = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(urls.get(i)));
-												if (bytes[0] == 82 && bytes[1] == 73 && bytes[2] == 70){
-													bytes = CommonUtil.webpToPngBytes(CommonUtil.getOSSInputStream(urls.get(i)));
-												}
-												//压缩文件大小
-												byte[] byteNew = FileUtils.compressImage(bytes);
-												//创建图片
-												Picture picture = drawing.createPicture(anchor, workbook.addPicture(byteNew, Workbook.PICTURE_TYPE_PNG));
-												picture.resize();
+									CreationHelper helper = workbook.getCreationHelper();
+									Sheet sheet = workbook.getSheetAt(0);
+									Drawing<?> drawing = sheet.createDrawingPatriarch();
+									ClientAnchor anchor = helper.createClientAnchor();
+									Long id = map.get(urls.get(i));
+									ImageClassificationFile file = imageClassificationFileClient.getImageClassificationFileById(id);
 
-												//图片定位
-												FileUtils.imageOrientation(sheet, anchor, i == 1 ? new DataVO(1, 8) : new DataVO(0, 2));
+									//获取文件流
+									byte[] bytes = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(urls.get(i)));
+									if (bytes[0] == 82 && bytes[1] == 73 && bytes[2] == 70) {
+										bytes = CommonUtil.webpToPngBytes(CommonUtil.getOSSInputStream(urls.get(i)));
+									}
+									//压缩文件大小
+									byte[] byteNew = FileUtils.compressImage(bytes);
+									//创建图片
+									Picture picture = drawing.createPicture(anchor, workbook.addPicture(byteNew, Workbook.PICTURE_TYPE_PNG));
+									picture.resize();
 
-												//定位其它信息
-												//文字说明
-												sheet.getRow(i == 0 ? 0 : 6).getCell(i == 0 ? 3 : 0).setCellValue("文字说明:\n" + "  " + (ObjectUtil.isNotEmpty(file.getTextContent()) ? file.getTextContent() : ""));
-												//照片号
-												sheet.getRow(i == 0 ? 1 : 7).getCell(i == 0 ? 3 : 0).setCellValue("照片号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getPhotoCode()) ? file.getPhotoCode() : ""));
-												//底片号
-												sheet.getRow(i == 0 ? 2 : 8).getCell(i == 0 ? 3 : 0).setCellValue("底片号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getFilmCode()) ? file.getFilmCode() : ""));
-												//题名
-												sheet.getRow(i == 0 ? 3 : 9).getCell(i == 0 ? 0 : 2).setCellValue("题名:\n" + "  " + (ObjectUtil.isNotEmpty(file.getTitle()) ? file.getTitle() : ""));
-												//参见号
-												sheet.getRow(i == 0 ? 3 : 9).getCell(i == 0 ? 2 : 0).setCellValue("参见号:\n" + "  " + (ObjectUtil.isNotEmpty(file.getSeeAlsoCode()) ? file.getSeeAlsoCode() : ""));
-												//拍摄时间
-												sheet.getRow(i == 0 ? 4 : 10).getCell(i == 0 ? 2 : 0).setCellValue("拍摄时间:\n" + "  " + (ObjectUtil.isNotEmpty(DateUtil.format(file.getShootingTime(), "yyyy-MM-dd")) ? DateUtil.format(file.getShootingTime(), "yyyy-MM-dd") : ""));
-												//拍摄者
-												sheet.getRow(i == 0 ? 5 : 11).getCell(i == 0 ? 2 : 0).setCellValue("拍摄者:\n" + "  " + (ObjectUtil.isNotEmpty(file.getShootingUser()) ? file.getShootingUser() : ""));
+									//图片定位
+									FileUtils.imageOrientation(sheet, anchor, i == 1 ? new DataVO(0, 8) : new DataVO(0, 3));
 
-											} catch (Exception e) {
-												e.printStackTrace();
-											}
-										}
+									//定位其它信息
+									int baseRow = i == 0 ? 0 : 5; // 第一组在0-4行,第二组在5-9行
+
+									// 分组号 (C列,索引2)
+									sheet.getRow(baseRow ).getCell(3).setCellValue(albumDTO.getGroupNumber() != null ? albumDTO.getGroupNumber() : "");
+									// 照片编号 (C列,索引2)
+									sheet.getRow(baseRow + 1).getCell(3).setCellValue(file.getPhotoCode() != null ? file.getPhotoCode() : "");
+									// 摄影者 (C列,索引2)
+									sheet.getRow(baseRow + 2).getCell(3).setCellValue(file.getShootingUser() != null ? file.getShootingUser() : "");
+									// 拍摄时间 (C列,索引2)
+									sheet.getRow(baseRow + 3).getCell(3).setCellValue(file.getShootingTime() != null ?
+											DateUtil.format(file.getShootingTime(), "yyyy-MM-dd") : "");
+									// 照片说明 (A列,索引0)
+									String a=albumDTO.getImagesName()!=null?albumDTO.getImagesName():"";
+									String b=file.getTextContent() != null ? file.getTextContent() : "";
+									sheet.getRow(baseRow+4).getCell(1).setCellValue(a+b);
 
-										String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
-										outputStream = new FileOutputStream(locationFile);
-										//记录文件删除
-										removeList.add(locationFile);
-										//生成一份新的excel
-										workbook.write(outputStream);
-										//将excel转PDF
-										File excelFile = new File(locationFile);
-										excelFileInput = new FileInputStream(excelFile);
-										MultipartFile files = new MockMultipartFile("file", excelFile.getName(), "text/plain", IOUtils.toByteArray(excelFileInput));
-										NewBladeFile bladeFile = this.commonFileClient.excelToPdf(files);
-										if (bladeFile != null) {
-											pdfFileList.add(bladeFile.getPdfUrl());
-										}
-									}
 								} catch (Exception e) {
 									e.printStackTrace();
-								} finally {
-									if (outputStream != null) {
-										IoUtil.closeQuietly(outputStream);
-									}
-									if (modInput != null) {
-										IoUtil.closeQuietly(modInput);
-									}
-									if (excelFileInput != null) {
-										IoUtil.closeQuietly(excelFileInput);
-									}
-									if (workbook != null) {
-										IoUtil.closeQuietly(workbook);
-									}
 								}
 							}
-
-							//合并pdf并上传
-							String mergeName = SnowFlakeUtil.getId() + ".pdf";
-							String mergeUrl = file_path + mergeName;
-							FileUtils.mergePdfPublicMethods(pdfFileList, mergeUrl);
+							String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
+							outputStream = new FileOutputStream(locationFile);
 							//记录文件删除
-							removeList.add(mergeUrl);
-							//上传
-							BladeFile bladeFile = this.newIOSSClient.uploadFile(mergeName, mergeUrl);
+							removeList.add(locationFile);
+							//生成一份新的excel
+							workbook.write(outputStream);
+							//将excel转PDF
+							File excelFile = new File(locationFile);
+							excelFileInput = new FileInputStream(excelFile);
+							MultipartFile files = new MockMultipartFile("file", excelFile.getName(), "text/plain", IOUtils.toByteArray(excelFileInput));
+							NewBladeFile bladeFile = this.commonFileClient.excelToPdf(files);
 							if (bladeFile != null) {
-								album.setImagesPdf(bladeFile.getLink());
+								pdfFileList.add(bladeFile.getPdfUrl());
 							}
-
-					if (removeList.size() > 0) {
-						//删除本地文件
-						CommonUtil.removeFile(removeList);
+						}
+					} catch (Exception e) {
+						e.printStackTrace();
+					} finally {
+						if (outputStream != null) {
+							IoUtil.closeQuietly(outputStream);
+						}
+						if (modInput != null) {
+							IoUtil.closeQuietly(modInput);
+						}
+						if (excelFileInput != null) {
+							IoUtil.closeQuietly(excelFileInput);
+						}
+						if (workbook != null) {
+							IoUtil.closeQuietly(workbook);
+						}
 					}
+				}
+
+				//合并pdf并上传
+				String mergeName = SnowFlakeUtil.getId() + ".pdf";
+				String mergeUrl = file_path + mergeName;
+				FileUtils.mergePdfPublicMethods(pdfFileList, mergeUrl);
+				//记录文件删除
+				removeList.add(mergeUrl);
+				//上传
+				BladeFile bladeFile = this.newIOSSClient.uploadFile(mergeName, mergeUrl);
+				if (bladeFile != null) {
+					album.setImagesPdf(bladeFile.getLink());
+				}
 
+				if (removeList.size() > 0) {
+					//删除本地文件
+					CommonUtil.removeFile(removeList);
+				}
 			} catch (Exception e) {
 				e.printStackTrace();
 			}

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java

@@ -416,6 +416,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
                     try {
                         File writefile = new File(htmlurl);
                         FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+                        System.out.println("修改成功:"+ htmlurl);
                     }catch (Exception e){
                         System.out.println("修改html文件异常:"+ htmlurl);
                     }finally {

Some files were not shown because too many files changed in this diff