Преглед на файлове

Merge remote-tracking branch 'origin/dev' into dev

LHB преди 1 седмица
родител
ревизия
27827e562b

+ 1 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@@ -98,7 +98,7 @@ public class OssBuilder {
                 oss.setEndpoint("https://xinan1.zos.ctyun.cn");
             }
         }
-		oss.setEndpoint("https://xinan1.zos.ctyun.cn");
+		//oss.setEndpoint("https://xinan1.zos.ctyun.cn");
 		System.out.println("oss111="+oss.getEndpoint());
 		Oss ossCached = ossPool.get(tenantId);
 		OssTemplate template = templatePool.get(tenantId);

+ 26 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FlushQueryNameDTO.java

@@ -0,0 +1,26 @@
+package org.springblade.business.dto;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class FlushQueryNameDTO {
+
+    @ApiModelProperty(value = "1直接重置题名 2规则更改重置题名")
+    private Integer type;
+
+    @ApiModelProperty(value = "题名内容 type=2{资料查询ID:修改后文件题名},type=1{资料查询ID:空字符串}")
+    private List<MapValue> list;
+
+    @Data
+    public static class MapValue{
+    	@ApiModelProperty(value = "资料查询ID")
+    	private Long id;
+    	@ApiModelProperty(value = "修改后文件题名")
+    	private String nodeName;
+    }
+}

+ 71 - 6
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -26,6 +26,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springblade.business.dto.CustomAddContractNodeDTO;
 import org.springblade.business.dto.ImportTreeDto;
+import org.springblade.business.dto.FlushQueryNameDTO;
+import org.springblade.business.dto.FlushQueryNameDTO;
 import org.springblade.business.entity.*;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.OperationLogClient;
@@ -193,13 +195,13 @@ public class InformationWriteQueryController extends BladeController {
     @PostMapping("/flushQueryName")
     @ApiModelProperty(value = "刷新文件题名")
     @ApiOperationSupport(order = 28)
-    public R<Boolean> flushQueryName(@RequestParam String ids){
-        if(ids==null){
+    public R<Boolean> flushQueryName(@RequestBody FlushQueryNameDTO dto){
+        if(dto.getList().size()<=0){
             throw new ServiceException("请选择要刷新的文件");
         }
-        List<Long> idList = Arrays.stream(ids.split(","))
-            .map(Long::valueOf)
-            .collect(Collectors.toList());
+        List<Long> idList = dto.getList().stream().map(FlushQueryNameDTO.MapValue::getId).collect(Collectors.toList());
+        Map<Long, String> nodeNameMap = dto.getList().stream()
+                .collect(Collectors.toMap(FlushQueryNameDTO.MapValue::getId, FlushQueryNameDTO.MapValue::getNodeName));
         List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
             .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus,InformationQuery::getWbsId).in(InformationQuery::getId, idList));
         String sgSuffix="";
@@ -212,9 +214,14 @@ public class InformationWriteQueryController extends BladeController {
                 jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
             }
             for (InformationQuery query : queryList) {
+                String result="";
                 String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
                 WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
-                  String result=wbsParamClient.createFileTitle(contract);
+                if(dto.getType()==1){
+                    result=wbsParamClient.createFileTitle(contract);
+                }else {
+                    result=nodeNameMap.get(query.getId());
+                }
                 if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
                     if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
                         result=result+sgSuffix;
@@ -241,6 +248,64 @@ public class InformationWriteQueryController extends BladeController {
         return R.status(this.informationQueryService.updateBatchById(queryList));
     }
 
+    private String createFileTitle(WbsTreeContract contract, String param) {
+        if(contract==null){
+            return "";
+        }
+        String ancestorsPId = contract.getAncestorsPId();
+        if (ancestorsPId.startsWith("0,")) {
+            ancestorsPId = ancestorsPId.substring(2);
+        }
+        ancestorsPId=ancestorsPId+","+contract.getPKeyId();
+        String sql="select  REPLACE(REPLACE(node_name, CHAR(10), ''), CHAR(13), '') as node_name,node_type from m_wbs_tree_contract where p_key_id in ("+ancestorsPId+") and is_deleted=0";
+        List<WbsTreeContract> nodeNames = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+        param = param.trim().replaceAll("(?i:c)", "");
+        List<String> list = Arrays.asList(param.split("[^.\\d]"));
+        List<Integer> index = list.stream().map(Integer::parseInt).collect(Collectors.toList());
+        Map<Integer, String> map = nodeNames.stream()
+                .collect(Collectors.toMap(
+                        WbsTreeContract::getNodeType,
+                        WbsTreeContract::getNodeName,
+                        (existing, replacement) -> replacement // 如果键重复,保留后者
+                ));
+        StringBuilder result = new StringBuilder("");
+        for (Integer i : index) {
+            if(i==0){
+                if(map.containsKey(1)){
+                    result.append(map.get(1));
+                }
+            }
+            else if(i==1){
+                if(map.containsKey(18)){
+                    result.append(map.get(18));
+                }
+            }else {
+                if(map.containsKey(i)){
+                    result.append(map.get(i));
+                }
+            }
+        }
+        return result.toString();
+    }
+
+    @GetMapping("/previewNodeName")
+    @ApiOperation(value = "预览节点名称")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "wbsId", value = "资料查询wbsId", required = true),
+            @ApiImplicitParam(name = "param", value = "题名规则", required = true)
+    })
+    public R<String> previewNodeName(@RequestParam String wbsId,@RequestParam String param){
+        if(StringUtils.isEmpty(param)){
+            throw new ServiceException("请输入题名规则");
+        }
+        String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+wbsId+" and is_deleted=0";
+        WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+        if(contract!=null){
+            return R.data(createFileTitle(contract,param));
+        }
+        return R.success("暂无数据");
+    }
+
     /**
      * 初始化合同段导图树
      */

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ImageClassificationFileServiceImpl.java

@@ -84,10 +84,10 @@ public class ImageClassificationFileServiceImpl extends BaseServiceImpl<ImageCla
             //查询下级节点信息
             WbsTreeContract node = wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.valueOf(imageClassificationFile.getWbsIdsStr()));
             List<WbsTreeContract> wbsTreeContracts;
-            if (node.getParentId() == 0) {
-                wbsTreeContracts = wbsTreeContractClient.queryAllChild(imageClassificationFile.getContractId());
+            if (node.getPId() == 0) {
+                wbsTreeContracts = wbsTreeContractClient.queryAllChild(Long.parseLong(node.getContractId()));
             } else {
-                wbsTreeContracts = wbsTreeContractClient.queryCurrentNodeAllChild(imageClassificationFile.getContractId(), node.getId());
+                wbsTreeContracts = wbsTreeContractClient.queryCurrentNodeAllChild(Long.parseLong(node.getContractId()), node.getPKeyId());
             }
             wbsTreeContracts.add(node);
             imageClassificationFile.setWbsIds(wbsTreeContracts.stream().map(wtc -> wtc.getPKeyId() + "").collect(Collectors.toList()));

+ 27 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java

@@ -32,6 +32,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
+import java.util.stream.Stream;
 
 import static java.math.BigDecimal.ROUND_CEILING;
 import static java.math.BigDecimal.ROUND_HALF_UP;
@@ -1277,7 +1278,32 @@ public class CustomFunction {
      * @Date 2022.08.01 11:06
      **/
     public static List<Object> b445check(List<Object> data, Object designs, Object dev, Object xN, Object hz) {
-
+        if(data.isEmpty()){
+            data = data.stream()
+                    .filter(Objects::nonNull)
+                    .map(Object::toString)
+                    .map(String::trim)
+                    .filter(s -> !s.isEmpty())
+                    .flatMap(s -> {
+                        // 检查包含的分隔符类型,按优先级处理
+                        if (s.contains("、")) {
+                            return Arrays.stream(s.split("、"));
+                        } else if (s.contains(",")) {
+                            return Arrays.stream(s.split(","));
+                        } else if (s.contains(",")) {
+                            return Arrays.stream(s.split(","));
+                        } else if (s.contains("/")) {
+                            return Arrays.stream(s.split("/"));
+                        } else if (s.contains(" ")) {
+                            return Arrays.stream(s.split("\\s+"));
+                        } else {
+                            return Stream.of(s);
+                        }
+                    })
+                    .map(String::trim)
+                    .filter(s -> !s.isEmpty())
+                    .collect(Collectors.toList());
+        }
         List<Object> result = new ArrayList<>();
         designs = designFormat(designs);
         if (StringUtils.isNotEmpty(data, designs, dev)) {

+ 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 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -241,7 +241,7 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
 
     @Override
     public List<WbsTreeContract> queryCurrentNodeAllChild(Long contractId, Long parentId) {
-        return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId, contractId).like(WbsTreeContract::getAncestors, parentId).eq(WbsTreeContract::getIsDeleted, 0));
+        return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId, contractId).like(WbsTreeContract::getAncestorsPId, parentId).eq(WbsTreeContract::getIsDeleted, 0));
     }
 
     @Override

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

@@ -910,7 +910,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
             ContractInfo contractInfo1 = baseMapper.selectById(contractInfo.getId());
             //如果模版引用发生改变,需要判断合同段中是否有节点
             if(contractInfo1.getTemplateType()!=null&&contractInfo.getTemplateType()!=null&&contractInfo1.getTemplateType()!=contractInfo.getTemplateType()){
-                String sql="Selcet  COUNT(*) From m_wbs_tree_contract Where contract_id="+contractInfo.getId()+" and is_deleted=0";
+                String sql="select  COUNT(*) From m_wbs_tree_contract Where contract_id="+contractInfo.getId()+" and is_deleted=0";
                 Integer size = jdbcTemplate.queryForObject(sql, Integer.class);
                 if(size>0){
                     throw new ServiceException("合同段中已存在节点,无法更改");

+ 30 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -5465,7 +5465,36 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 /*设计值可以是数值类型,或空(等效0)*/
                 if (dataFd != null) {
                     List<Object> values = dataFd.getRawValue();
-                    boolean nonNumeric = values.stream().filter(StringUtils::isNotEmpty).anyMatch(e -> !StringUtils.isNumber(e));
+                    //boolean nonNumeric = values.stream().filter(StringUtils::isNotEmpty).anyMatch(e -> !StringUtils.isNumber(e));
+                    boolean nonNumeric = values.stream()
+                            .filter(StringUtils::isNotEmpty)
+                            .anyMatch(e -> {
+                                String str = e.toString().trim();
+                                // 检查包含的分隔符类型,按优先级处理
+                                String[] parts;
+                                if (str.contains("、")) {
+                                    parts = str.split("、");
+                                } else if (str.contains(",")) {
+                                    parts = str.split(",");
+                                } else if (str.contains(",")) {
+                                    parts = str.split(",");
+                                } else if (str.contains("/")) {
+                                    parts = str.split("/");
+                                } else if (str.contains(" ")) {
+                                    parts = str.split("\\s+");
+                                } else {
+                                    // 不包含分隔符的情况,直接判断
+                                    return !StringUtils.isNumber(str);
+                                }
+
+                                // 对拆分后的每个部分进行数字判断
+                                for (String part : parts) {
+                                    if (!StringUtils.isNumber(part.trim())) {
+                                        return true;
+                                    }
+                                }
+                                return false;
+                            });
                     if (nonNumeric) {
                         data = values.stream().filter(StringUtils::isNotEmpty).count();
                     } else if (designFd != null) {