Browse Source

Merge remote-tracking branch 'origin/master'

zhuwei 5 months ago
parent
commit
8d30fbc695
25 changed files with 634 additions and 34 deletions
  1. 3 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO.java
  2. 34 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/NodeBaseInfoDTO.java
  3. 72 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/NodeBaseInfo.java
  4. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/AppWbsTreeContractVO.java
  5. 9 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/NameRuleV03.java
  6. 34 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/NodeBaseInfoVO.java
  7. 1 1
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveAutoService.java
  8. 10 5
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveFileService.java
  9. 2 0
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveMetaService.java
  10. 3 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveTreeService.java
  11. 20 2
      blade-service/blade-archive/src/main/java/org/springblade/archive/external/utils/TransUtil.java
  12. 3 5
      blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml
  13. 2 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java
  14. 7 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  15. 13 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  16. 152 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/NodeBaseInfoController.java
  17. 16 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java
  18. 1 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  19. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsParamMapper.xml
  20. 49 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/INodeBaseInfoService.java
  21. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsParamService.java
  22. 11 6
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  23. 164 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/NodeBaseInfoServiceImpl.java
  24. 14 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java
  25. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/CustomAddContractNodeDTO.java

@@ -45,4 +45,7 @@ public class CustomAddContractNodeDTO implements Serializable {
     @ApiModelProperty(value = "自定义数字化节点的内页资料类型")
     private Integer majorDataType;
 
+    @ApiModelProperty(value = "新加的自定义划分编号")
+    private String newPartitionCode;
+
 }

+ 34 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/NodeBaseInfoDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.dto;
+
+import org.springblade.manager.entity.NodeBaseInfo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NodeBaseInfoDTO extends NodeBaseInfo {
+	private static final long serialVersionUID = 1L;
+
+}

+ 72 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/NodeBaseInfo.java

@@ -0,0 +1,72 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+@Data
+@TableName("m_node_base_info")
+@EqualsAndHashCode(callSuper = true)
+public class NodeBaseInfo extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* wbs的pkeyId
+	*/
+		private Long nodeId;
+	/**
+	* 单位工程
+	*/
+		private String unit;
+	/**
+	* 子单位工程
+	*/
+		private String subUnit;
+	/**
+	* 分部工程
+	*/
+		private String division;
+	/**
+	* 子分部工程
+	*/
+		private String subDivision;
+	/**
+	* 分项工程
+	*/
+		private String item;
+	/**
+	* 子分项工程
+	*/
+		private String subItem;
+	/**
+	* 工序
+	*/
+		private String processes;
+
+
+}

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/AppWbsTreeContractVO.java

@@ -18,4 +18,7 @@ public class AppWbsTreeContractVO extends WbsTreeContract {
     @ApiModelProperty(value = "附件")
     private List<TableFile> fileList;
 
+    @ApiModelProperty(value = "文件题名")
+    private String fileName;
+
 }

+ 9 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/NameRuleV03.java

@@ -0,0 +1,9 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+
+@Data
+public class NameRuleV03 {
+    private String nameRule;
+    private String nameVaule;
+}

+ 34 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/NodeBaseInfoVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.vo;
+
+import org.springblade.manager.entity.NodeBaseInfo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NodeBaseInfoVO extends NodeBaseInfo {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveAutoService.java

@@ -220,7 +220,7 @@ public class ExternalDataArchiveAutoService {
         addArchives.stream()
                 .filter(archive -> archive.getOutId() != null && archive.getId() != null)
                 .forEach(archive ->
-                        archiveMapping.putIfAbsent(archive.getOutId(), archive.getId())
+                        archiveMapping.put(archive.getOutId(), archive.getId())
                 );
     }
 

+ 10 - 5
blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveFileService.java

@@ -203,11 +203,16 @@ public class ExternalDataArchiveFileService {
         }
 
         Map<String, Long> fileMapping = externalDataInfo.getFileIdMapping();
-        localFiles.stream()
-                .filter(file -> file.getOutId() != null && file.getId() != null)
-                .forEach(file ->
-                        fileMapping.putIfAbsent(file.getOutId(), file.getId())
-                );
+//        localFiles.stream()
+//                .filter(file -> file.getOutId() != null && file.getId() != null)
+//                .forEach(file ->
+//                        fileMapping.putIfAbsent(file.getOutId(), file.getId())
+//                );
+        for (ArchiveFile file : localFiles) {
+            if (file.getOutId() != null && file.getId() != null) {
+                fileMapping.put(file.getOutId(), file.getId());
+            }
+        }
     }
 
 

+ 2 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveMetaService.java

@@ -173,9 +173,11 @@ public class ExternalDataArchiveMetaService {
 
                 // 执行SQL
                 try {
+                    System.out.println("AAAA " + cleanSql);
                     jdbcTemplate.execute(cleanSql);
                 } catch (DataAccessException e) {
                     // 添加错误处理(例如记录日志+抛出业务异常)
+                    System.out.println("SQL 执行失败,错误信息: " + e.getMessage());
                     throw new RuntimeException("批量插入元数据失败,位置[" + i + "-" + toIndex + "]", e);
                 }
             }

+ 3 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/external/impl/ExternalDataArchiveTreeService.java

@@ -34,7 +34,7 @@ public class ExternalDataArchiveTreeService {
             externalDataInfo.setParent(archiveTreeContract);
         }
 
-        if (externalDataInfo.getMetadataClassifications()== null){
+        if (externalDataInfo.getMetadataClassifications()== null || externalDataInfo.getMetadataClassifications().size() == 0){
             List<MetadataClassification> metadataClassificationList =   metadataClassificationClient.getMetadataClassification();
             if (metadataClassificationList!= null ) {
                 externalDataInfo.setMetadataClassifications(metadataClassificationList);
@@ -259,7 +259,8 @@ public class ExternalDataArchiveTreeService {
 
             // 线程安全操作(如果存在并发场景)
             synchronized (idMapping) {
-                if (!idMapping.containsKey(outId)) {
+                //if (!idMapping.containsKey(outId))
+                {
                     idMapping.put(outId, localId);
                 }
             }

+ 20 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/external/utils/TransUtil.java

@@ -189,13 +189,31 @@ public class TransUtil {
             for (Map.Entry<String, Object> entry : metaData.entrySet()) {
                 String label = TransUtil.LABEL_MAPPING.get(entry.getKey());
                 if (label != null) {
-                    keyValue.put(label, entry.getValue());
+                    Object value = entry.getValue();
+
+                    // 处理字符串长度限制
+                    if (value instanceof String) {
+                        String strValue = (String) value;
+                        if (strValue.length() > 255) {
+                            // 根据业务需求选择处理方式:
+                            // 1.直接截断(常用在非关键字段)
+                            value = strValue.substring(0, 255);
+
+                            // 2.抛出异常(严格场景)
+                            // throw new IllegalArgumentException("Value exceeds 255 chars: " + entry.getKey());
+
+                            // 3.日志警告(推荐组合使用)
+                            // log.warn("Value truncated for key: {}", entry.getKey());
+                        }
+                    }
+
+                    keyValue.put(label, value);
                 }
             }
 
             // 构建单条记录的VALUES
             StringBuilder valueBuilder = new StringBuilder()
-                    .append(String.format("'%s', -1, -1, '%s', -1, '%s', 0, 0, '%s', '%s'",
+                    .append(String.format("'%s', -1, 123, '%s', -1, '%s', 0, 0, '%s', '%s'",
                             metaId,
                             getCurrentDateTime(),
                             getCurrentDateTime(),

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

@@ -1358,18 +1358,16 @@
 
 
     <select id="getOutArchiveFilesByOutIds" resultMap="archiveFileResultMap1">
-        select *
+        select  *
         from u_archive_file
-        where project_id = #{projectId}
-        and is_deleted=0
-        and
+        where
         out_id in
         <foreach collection="ids" item="id" open="(" separator="," close=")">
             #{id}
         </foreach>
     </select>
     <select id="getMetadaFileByFileIds" resultType="java.util.Map">
-        SELECT *
+        SELECT id,file_id
         FROM u_metadata_file
         WHERE file_id IN
         <foreach collection="fileIds" item="fileId" open="(" close=")" separator=",">

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java

@@ -96,6 +96,7 @@ public class EVisaTaskCheckController {
             //查询当前节点的PDF
             InformationQuery node = informationQueryService.getOne(new LambdaQueryWrapper<InformationQuery>()
                     .eq(InformationQuery::getWbsId, json.getString("nodeId"))
+                    .eq(InformationQuery::getContractId, json.getString("contractId"))
                     .eq(InformationQuery::getClassify, tableOwner));
 
             if (node == null || StringUtils.isBlank(node.getPdfUrl())) {
@@ -357,6 +358,7 @@ public class EVisaTaskCheckController {
         //查询当前节点的PDF
         InformationQuery node = informationQueryService.getOne(new LambdaQueryWrapper<InformationQuery>()
                 .eq(InformationQuery::getWbsId, json.getString("nodeId"))
+                .eq(InformationQuery::getContractId, json.getLong("contractId"))
                 .eq(InformationQuery::getClassify, tableOwner));
 
         if (node == null || StringUtils.isBlank(node.getPdfUrl())) {

+ 7 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -901,7 +901,7 @@ public class InformationWriteQueryController extends BladeController {
         //此时的ids是当前节点的primaryKeyId但并不是业务数据ID,需要根据ids和classify去查询具体的业务ID
         if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId())) {
             //试验
-            businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2));
+            businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2).eq(InformationQuery::getContractId,startTaskVO.getContractId()));
             if (businessData != null) {
                 //设置业务数据ID
                 startTaskVO.setIds(businessData.getWbsId().toString());
@@ -1357,7 +1357,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
             Map<Long, Long> mapKey = new HashMap<>();
             if (queryList.size() == 0) {
                 //试验填报数据
-                queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
+                queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids)).eq(InformationQuery::getContractId,startTaskVO.getContractId())));
                 //重新绑定trialSelfInspectionRecordId使用map
                 if (appType == 1L) { // 试验上报
                     for (InformationQuery informationQuery : queryList) {
@@ -4091,7 +4091,11 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
                 obj.setNodeType(parentNode.getNodeType().equals(6) ? 6 : dto.getNodeType());
             }
         }
-        obj.setPartitionCode(dto.getPartitionCode());
+        if(dto.getNewPartitionCode()!=null&&!dto.getNewPartitionCode().equals("")){
+            obj.setPartitionCode(dto.getNewPartitionCode());
+        }else {
+            obj.setPartitionCode(dto.getPartitionCode());
+        }
         obj.setParentId(parentNode.getId());
         obj.setAncestors(parentNode.getAncestors() + "," + parentNode.getId());
         obj.setType(1);

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

@@ -63,6 +63,7 @@ import org.springframework.dao.DataAccessException;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.SingleColumnRowMapper;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -1884,7 +1885,18 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         long startTime_1 = System.currentTimeMillis();
                         //质检资料
                         if(task.getApprovalType()==1){
-                            result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
+                            String sql="select type from u_information_query where id="+task.getFormDataId();
+                            Integer InformationType = jdbcTemplate.queryForObject(sql, new SingleColumnRowMapper<>(Integer.class));
+                            if(InformationType==1){
+                                result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
+                            }else {
+                                TrialResignDto dto=new TrialResignDto();
+                                dto.setType(1);
+                                dto.setProjectId(projectId);
+                                dto.setTrialIds(queryMap.get(task.getFormDataId()));
+                                result=this.saveTrialSelfNodePdf(dto,queryMap.get(task.getFormDataId()));
+                            }
+
                         }
                         //日志资料
                         if(task.getApprovalType()==3){

+ 152 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/NodeBaseInfoController.java

@@ -0,0 +1,152 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.manager.entity.NodeBaseInfo;
+import org.springblade.manager.vo.NodeBaseInfoVO;
+import org.springblade.manager.service.INodeBaseInfoService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.math.BigDecimal;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/nodebaseinfo")
+@Api(value = "", tags = "接口")
+public class NodeBaseInfoController extends BladeController {
+
+	private final INodeBaseInfoService nodeBaseInfoService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入nodeBaseInfo")
+	public R<NodeBaseInfo> detail(NodeBaseInfo nodeBaseInfo) {
+		NodeBaseInfo detail = nodeBaseInfoService.getOne(Condition.getQueryWrapper(nodeBaseInfo));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入nodeBaseInfo")
+	public R<IPage<NodeBaseInfo>> list(NodeBaseInfo nodeBaseInfo, Query query) {
+		IPage<NodeBaseInfo> pages = nodeBaseInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(nodeBaseInfo));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入nodeBaseInfo")
+	public R<IPage<NodeBaseInfoVO>> page(NodeBaseInfoVO nodeBaseInfo, Query query) {
+		IPage<NodeBaseInfoVO> pages = nodeBaseInfoService.selectNodeBaseInfoPage(Condition.getPage(query), nodeBaseInfo);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入nodeBaseInfo")
+	public R save(@Valid @RequestBody NodeBaseInfo nodeBaseInfo) {
+		return R.status(nodeBaseInfoService.save(nodeBaseInfo));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入nodeBaseInfo")
+	public R update(@Valid @RequestBody NodeBaseInfo nodeBaseInfo) {
+		return R.status(nodeBaseInfoService.updateById(nodeBaseInfo));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入nodeBaseInfo")
+	public R submit(@Valid @RequestBody NodeBaseInfo nodeBaseInfo) {
+		return R.status(nodeBaseInfoService.saveOrUpdate(nodeBaseInfo));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(nodeBaseInfoService.deleteLogic(Func.toLongList(ids)));
+	}
+
+    @GetMapping("/getOrSaveNodeBaseInfo")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "获取节点基础数据", notes = "获取节点基础数据")
+    public R getOrSaveNodeBaseInfo(@RequestParam Long pKeyId){
+        return R.data(nodeBaseInfoService.getOrSaveNodeBaseInfo(pKeyId));
+    }
+
+    @GetMapping("/getNodeBaseInfoByPkeyId")
+    @ApiOperationSupport(order = 9)
+    @ApiOperation(value = "设置自动获取", notes = "pkeyId表单Id,nodeId节点Id")
+    public R getNodeBaseInfoByPkeyId(@RequestParam Long pkeyId, @RequestParam Long nodeId, @RequestParam Integer autoType,@RequestParam(required = false) BigDecimal min,@RequestParam(required = false)BigDecimal max){
+        return R.data(nodeBaseInfoService.getNodeBaseInfoByPkeyId(pkeyId,nodeId,autoType,min,max));
+    }
+
+	@GetMapping("/getAllNodeBaseInfoByPkeyId")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "自动获取表单所有的参数库数据", notes = "pkeyId表单Id")
+	public R getAllNodeBaseInfoByPkeyId(@RequestParam Long pkeyId){
+		return R.data(nodeBaseInfoService.getAllNodeBaseInfoByPkeyId(pkeyId));
+	}
+
+
+
+
+}

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

@@ -146,10 +146,24 @@ public class WbsTreeContractController extends BladeController {
     public R importTree(@RequestParam("file") MultipartFile file, @RequestParam Long pkeyId) throws IOException {
         return iWbsTreeContractService.importTree(file,pkeyId);
     }
+
+    @GetMapping("/getNameRuleByPkeyId")
+    @ApiOperationSupport(order = 31)
+    @ApiOperation(value = "根据节点PkeyId获取节点配置")
+    public R getNameRuleByPkeyId(@RequestParam Long pKeyId){
+        NameRuleVo vo = iWbsParamService.getNameRuleByPkeyId(pKeyId);
+        if(vo!=null){
+            List<String> list = Arrays.asList(vo.getNameVaule().split("-"));
+            return R.data(list);
+        }else {
+            return R.data(null);
+        }
+    }
+
     @GetMapping("/getNameRuleByRule")
     @ApiOperationSupport(order = 32)
     @ApiOperation(value = "节点配置根据选择的文件题名规则获取文件题名", notes = "传入规则和节点pkeyId")
-    public R getNameRuleByRule(String nameRule,Long pkeyId){
+    public R getNameRuleByRule(@RequestParam String nameRule,@RequestParam Long pkeyId){
         String[] codes = nameRule.split("-");
         Arrays.sort(codes, Comparator.comparingInt(s -> Integer.parseInt(s.substring(1))));
         nameRule= String.join("-", codes);
@@ -161,7 +175,7 @@ public class WbsTreeContractController extends BladeController {
     @GetMapping("/saveContractNameRule")
     @ApiOperationSupport(order = 33)
     @ApiOperation(value = "合同段保存文件题名规则")
-    public R saveContractNameRule(String nameRule,Long pkeyId,Long projectId){
+    public R saveContractNameRule(@RequestParam String nameRule,@RequestParam Long pkeyId,@RequestParam Long projectId){
         String[] codes = nameRule.split("-");
         Arrays.sort(codes, Comparator.comparingInt(s -> Integer.parseInt(s.substring(1))));
         nameRule= String.join("-", codes);

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

@@ -893,11 +893,10 @@ public class WbsTreePrivateController extends BladeController {
                 param.setName("文件题名");
                 param.setK("FILE_TITLE");
                 param.setV(sortNameRule(dto.getNameRule()));
-                param.setType(11);
+                param.setType(100);
                 param.setProjectId(dto.getProjectId());
                 param.setNameId(SnowFlakeUtil.getId());
                 param.setNameType(dto.getType());
-                param.setType(100);
                 //如果nameID不为空,先删除在保存
                 if(dto.getNameId()!=null){
                     iWbsParamService.getBaseMapper().delete(new QueryWrapper<WbsParam>().eq("name_id",dto.getNameId()));

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsParamMapper.xml

@@ -28,7 +28,7 @@
         FROM m_wbs_param a
         WHERE a.project_id = #{projectId}
           AND a.is_deleted = 0
-          AND a.type = 11
+          AND a.type = 100
           AND a.k = 'FILE_TITLE'
     </select>
 

+ 49 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/INodeBaseInfoService.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service;
+
+import org.springblade.manager.entity.NodeBaseInfo;
+import org.springblade.manager.vo.NodeBaseInfoVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.math.BigDecimal;
+import java.util.Map;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+public interface INodeBaseInfoService extends BaseService<NodeBaseInfo> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param nodeBaseInfo
+	 * @return
+	 */
+	IPage<NodeBaseInfoVO> selectNodeBaseInfoPage(IPage<NodeBaseInfoVO> page, NodeBaseInfoVO nodeBaseInfo);
+
+    NodeBaseInfo getOrSaveNodeBaseInfo(Long pKeyId);
+
+    Object getNodeBaseInfoByPkeyId(Long pkeyId, Long nodeId, Integer autoType, BigDecimal min,BigDecimal max);
+
+	Map<String,Object> getAllNodeBaseInfoByPkeyId(Long pkeyId);
+}

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsParamService.java

@@ -5,6 +5,8 @@ import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.Formula;
 import org.springblade.manager.entity.WbsParam;
 import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.vo.NameRuleVo;
+import org.springblade.manager.vo.NameRuleVo1;
 import org.springblade.manager.vo.WbsParamVo2;
 
 import javax.validation.constraints.NotNull;
@@ -63,4 +65,6 @@ public interface IWbsParamService extends BaseService<WbsParam> {
 
 
     List<WbsParamVo2> selectNameRule(Long projectId);
+
+    NameRuleVo getNameRuleByPkeyId(Long pkeyId);
 }

+ 11 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -3470,6 +3470,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 //新增SQL
                 String sqlInfo = "";
                 LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
+                if(!dataMap2.containsKey("p_key_id")){
+                    if(tableInfo.getPkeyId()!=null&&!tableInfo.getPkeyId().equals("")){
+                        dataMap2.put("p_key_id",tableInfo.getPkeyId());
+                    }
+                }
                 sqlInfo = "INSERT INTO " + wbsTreePrivate.getInitTableName() + " ( ";
                 String keyStr = "id,group_id,";
                 String valStr = SnowFlakeUtil.getId() + "," + groupId + ",";
@@ -4665,12 +4670,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
         chart(reData, wbsTreePrivate);
         if(ObjectUtil.isNotEmpty(jsonObject)){
-            if(isCancel){
-                if(isCancelList.size()>0){
-                    List<String> finalIsCancelList = isCancelList;
-                    jsonObject.entrySet().removeIf(entry -> finalIsCancelList.contains(entry.getKey()));
-                }
-            }
+//            if(isCancel){
+//                if(isCancelList.size()>0){
+//                    List<String> finalIsCancelList = isCancelList;
+//                    jsonObject.entrySet().removeIf(entry -> finalIsCancelList.contains(entry.getKey()));
+//                }
+//            }
             for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
                 if(entry.getKey().contains("key")){
                     if(!reData.containsKey(entry.getKey())){

+ 164 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/NodeBaseInfoServiceImpl.java

@@ -0,0 +1,164 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.manager.entity.NodeBaseInfo;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.service.IWbsTreeContractService;
+import org.springblade.manager.vo.NodeBaseInfoVO;
+import org.springblade.manager.mapper.NodeBaseInfoMapper;
+import org.springblade.manager.service.INodeBaseInfoService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2025-03-10
+ */
+@Service
+public class NodeBaseInfoServiceImpl extends BaseServiceImpl<NodeBaseInfoMapper, NodeBaseInfo> implements INodeBaseInfoService {
+
+    @Autowired
+    private  IWbsTreeContractService iWbsTreeContractService;
+	@Override
+	public IPage<NodeBaseInfoVO> selectNodeBaseInfoPage(IPage<NodeBaseInfoVO> page, NodeBaseInfoVO nodeBaseInfo) {
+		return page.setRecords(baseMapper.selectNodeBaseInfoPage(page, nodeBaseInfo));
+	}
+
+    @Override
+    public NodeBaseInfo getOrSaveNodeBaseInfo(Long pKeyId) {
+        NodeBaseInfo nodeBaseInfo = baseMapper.selectOne(new QueryWrapper<NodeBaseInfo>().eq("node_id", pKeyId));
+        if(nodeBaseInfo!=null){
+            return nodeBaseInfo;
+        }
+        //查出当前节点的所有父节点
+        WbsTreeContract wbsTreeContract = iWbsTreeContractService.getBaseMapper().selectById(pKeyId);
+        if(wbsTreeContract!=null&&wbsTreeContract.getAncestors()!=null){
+            String ancestors = wbsTreeContract.getAncestors();
+            String[] nodeIds = ancestors.split(",");
+            // 使用MyBatis Plus的查询构建器
+            QueryWrapper<WbsTreeContract> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("project_id",wbsTreeContract.getProjectId());
+            queryWrapper.eq("contract_id",wbsTreeContract.getContractId());
+            queryWrapper.in("id", Arrays.asList(nodeIds));
+            List<WbsTreeContract> wbsTreeContracts = iWbsTreeContractService.getBaseMapper().selectList(queryWrapper);
+            if(wbsTreeContracts.size()>0){
+                NodeBaseInfo info = new NodeBaseInfo();
+                info.setId(SnowFlakeUtil.getId());
+                info.setNodeId(pKeyId);
+                for (WbsTreeContract contract : wbsTreeContracts) {
+                    if(contract.getNodeType()==1){
+                        info.setUnit(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==18){
+                        info.setSubUnit(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==2){
+                        info.setDivision(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==3){
+                        info.setSubDivision(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==4){
+                        info.setItem(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==5){
+                        info.setSubItem(contract.getNodeName());
+                        continue;
+                    }
+                    if(contract.getNodeType()==6){
+                        info.setProcesses(contract.getNodeName());
+                    }
+                }
+                baseMapper.insert(info);
+                return info;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Object getNodeBaseInfoByPkeyId(Long pkeyId, Long nodeId, Integer autoType, BigDecimal min, BigDecimal max) {
+        String result="";
+        if(autoType!=8){
+            NodeBaseInfo nodeBaseInfo = baseMapper.selectOne(new QueryWrapper<NodeBaseInfo>().eq("node_id", nodeId));
+            if(nodeBaseInfo!=null){
+                if(autoType==1){
+                    result= nodeBaseInfo.getUnit();
+                }
+                if(autoType==2){
+                    result= nodeBaseInfo.getSubUnit();
+                }
+                if (autoType==3){
+                    result= nodeBaseInfo.getDivision();
+                }
+                if(autoType==4){
+                    result= nodeBaseInfo.getSubDivision();
+                }
+                if(autoType==5){
+                    result= nodeBaseInfo.getItem();
+                }
+                if (autoType==6){
+                    result= nodeBaseInfo.getSubItem();
+                }
+                if (autoType==7){
+                    result= nodeBaseInfo.getProcesses();
+                }
+            }
+        }else {
+            if (min.compareTo(max) >= 0) {
+                throw new IllegalArgumentException("max must be greater than min");
+            }
+
+            // 计算区间范围
+            BigDecimal range = max.subtract(min);
+
+            // 生成随机数并调整范围
+            BigDecimal randomFactor = new BigDecimal(Math.random());
+            BigDecimal randomValue = min.add(range.multiply(randomFactor));
+
+            // 设置精度和舍入模式 保留两位小数
+            result= randomValue.setScale(2, RoundingMode.HALF_UP).toString();
+        }
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> getAllNodeBaseInfoByPkeyId(Long pkeyId) {
+        return Collections.emptyMap();
+    }
+
+}

+ 14 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java

@@ -8,7 +8,6 @@ import com.mixsmart.utils.FormulaUtils;
 import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.BaseUtils;
-import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.tool.api.R;
@@ -18,11 +17,9 @@ import org.springblade.manager.entity.*;
 import org.springblade.manager.mapper.WbsParamMapper;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
 import org.springblade.manager.service.*;
+import org.springblade.manager.vo.NameRuleVo;
 import org.springblade.manager.vo.WbsParamVo2;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -62,6 +59,7 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
                 if(wtp!=null){
                     /*优先取私有*/
                     WbsParam wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId, wtp.getPKeyId()).eq(WbsParam::getK, FILE_TITLE).last(" limit 1"));
+
                     if (wp == null) {
                         WbsTreePrivate publicWtp = this.getOriginWtp(wtp.getPKeyId());
                         wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId, publicWtp.getId()).eq(WbsParam::getK, FILE_TITLE).last(" limit 1 "));
@@ -490,6 +488,18 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
         return this.baseMapper.selectNameRule(projectId);
     }
 
+    @Override
+    public NameRuleVo getNameRuleByPkeyId(Long pkeyId) {
+        NameRuleVo vo = new NameRuleVo();
+        WbsParam wbsParam = baseMapper.selectOne(Wrappers.lambdaQuery(WbsParam.class).eq(WbsParam::getNodeId, pkeyId).eq(WbsParam::getType, 200).eq(WbsParam::getIsDeleted, 0).eq(WbsParam::getK,"FILE_TITLE"));
+        if(wbsParam!=null){
+            vo.setNameId(wbsParam.getNameId());
+            vo.setNameVaule(wbsParam.getV());
+            return vo;
+        }
+        return null;
+    }
+
 }
 
 

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -25,6 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springblade.business.dto.ImportTreeDto;
 import org.springblade.business.entity.ConstructionLedger;
+import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.feign.ConstructionLedgerFeignClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.vo.QueryProcessDataVO;
@@ -560,6 +561,11 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
          resultTabs.sort(Comparator.comparing((WbsTreeContract contract) -> contract.getNodeName().contains("JS107"))
                 .thenComparing(WbsTreeContract::getNodeName));
         }
+        InformationQuery info = informationQueryClient.getInfoByWbsId(Long.valueOf(primaryKeyId));
+        if(info!=null){
+            resultTabs.forEach(tab->tab.setFileName(info.getName()));
+        }
+
 
 //        if (Optional.ofNullable(wbsTreeContract.getIsUseSort()).orElse(0) == 0) {
 //            //表单排序