|
@@ -52,6 +52,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
@@ -1789,5 +1790,36 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
this.saveOrUpdateBatch(changeArchiveList);
|
|
|
}
|
|
|
|
|
|
+ public Long getNodeIdByName(String projectName, String contractName, String nodeName) {
|
|
|
+ // 1. 获取合同ID
|
|
|
+ Long contractId = projectInfoService.getContractIdbyName(projectName, contractName);
|
|
|
+
|
|
|
+ // 2. 检查合同ID有效性
|
|
|
+ if (contractId == null) {
|
|
|
+ System.out.println("Contract not found with projectName: " + projectName + ", contractName: " + contractName);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 根据合同ID和节点名称查询节点
|
|
|
+ List<ArchiveTreeContract> nodes = baseMapper.selectList(Wrappers.<ArchiveTreeContract>query().lambda()
|
|
|
+ .eq(ArchiveTreeContract::getContractId, contractId)
|
|
|
+ .like(ArchiveTreeContract::getNodeName, nodeName)
|
|
|
+ .eq(ArchiveTreeContract::getIsDeleted, 0));
|
|
|
+
|
|
|
+ // 4. 处理查询结果
|
|
|
+ if (nodes == null || nodes.isEmpty()) {
|
|
|
+ System.out.println("No node found for contractId: " + contractId + ", nodeName: " + nodeName);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 打印找到的节点数
|
|
|
+ System.out.println("Found " + nodes.size() + " nodes matching the criteria");
|
|
|
+
|
|
|
+ // 返回第一个匹配节点的ID
|
|
|
+ Long nodeId = nodes.get(0).getId();
|
|
|
+ System.out.println("Returning nodeId: " + nodeId);
|
|
|
+ return nodeId;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|