diff --git a/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java b/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java index 0549e42f..6f45122e 100644 --- a/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java +++ b/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java @@ -500,22 +500,22 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService { LambdaQueryWrapper fileMetaDataQuery = new LambdaQueryWrapper<>(); fileMetaDataQuery.select(FileStorage::getFileId).eq(FileStorage::getDirId, deleteDirId); List deleteFileIdList = fileStorageService.listObjs(fileMetaDataQuery, id -> (Long) id); + deleteFileIdList.add(deleteDirId); + if(ObjectUtils.isNotEmpty(deleteFileIdList)){ + fileMetadataInfoService.removeByIds(deleteFileIdList); + fileMetadataExtensionService.lambdaUpdate().in(FileMetadataExtension::getTFilemetaId, deleteFileIdList).remove(); + fileUserPermissionService.lambdaUpdate().in(FileUserPermission::getTFilemetaId, deleteFileIdList).remove(); + } - fileMetadataInfoService.removeByIds(deleteFileIdList); - fileMetadataExtensionService.lambdaUpdate().in(FileMetadataExtension::getTFilemetaId, deleteFileIdList).remove(); fileStorageService.lambdaUpdate().eq(FileStorage::getDirId, deleteDirId).remove(); - - // 数据库批量删除权限信息 - fileUserPermissionService.lambdaUpdate().in(FileUserPermission::getTFilemetaId, deleteFileIdList).remove(); - // minio文件系统批量删除文件 minioService.deleteDirectoryRecursively(dirMinioObjectKey); - if (ObjectUtils.isNotEmpty(req.getDelUuid()) && ObjectUtils.isNotEmpty(req.getDelUuIdOwnType())) { + if (ObjectUtils.isNotEmpty(deleteDirMetadataInfo.getRelatedResourceUuid()) && ObjectUtils.isNotEmpty(deleteDirMetadataInfo.getRelatedResourceUuidOwnType())) { DelNodeReq delNodeReq = new DelNodeReq(); - delNodeReq.setUuid(req.getDelUuid()); - delNodeReq.setUuidOwnType(req.getDelUuIdOwnType()); + delNodeReq.setUuid(deleteDirMetadataInfo.getRelatedResourceUuid()); + delNodeReq.setUuidOwnType(deleteDirMetadataInfo.getRelatedResourceUuidOwnType()); simulationNodeFeignClient.delteNode(delNodeReq); } } catch (Exception e) { @@ -1009,6 +1009,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService { fileStorage.setFileSuffix(getSuffixWithoutDot(fileInfo.getOriginalName())); fileStorage.setFileSize(req.getFile().getSize()); while (parentDirId != null) { + fileStorage.setId(null); fileStorage.setDirId(parentDirId); fileStorageService.save(fileStorage); parentDirId = fileMetadataInfoService.lambdaQuery().eq(FileMetadataInfo::getId, parentDirId).oneOpt() diff --git a/data/src/main/resources/application-dev.yml b/data/src/main/resources/application-dev.yml index 82547bc4..73ba7815 100644 --- a/data/src/main/resources/application-dev.yml +++ b/data/src/main/resources/application-dev.yml @@ -33,34 +33,6 @@ spring: group: DEV_GROUP # server-addr: 127.0.0.1:8848 enabled: true - # username: nacos - # password: ENC(+QKYnI6gAYu1SbLaZQTkZA==) - data: - redis: - # Redis默认情况下有16个分片(库),这里配置具体使用的分片,默认是0 - database: 0 - # redis服务器地址(填写自己的服务器地址) - host: 192.168.2.166 - # redis端口(默认6379) - port: 6379 - #redis连接超时等待,10秒 - timeout: PT10S - # redis访问密码(默认为空) - password: - lettuce: - pool: - # 连接池最大连接数(使用负值表示没有限制) 默认 8 - max-active: 50 - # 连接池中的最大空闲连接 默认 8 - max-idle: 20 - # 连接池中的最小空闲连接 默认 0 - min-idle: 1 - # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1,这里配置10s - max-wait: PT10S - # password: - # sentinel: - # master: mymaster - # nodes: 10.18.109.50:26379,10.18.109.51:26379,10.18.109.52:26379 servlet: multipart: # 单个文件的最大值 @@ -76,6 +48,14 @@ management: endpoint: health: show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false mybatis-plus: configuration: diff --git a/data/src/main/resources/application-local.yml b/data/src/main/resources/application-local.yml index 7bf9d8f1..f3089bd8 100644 --- a/data/src/main/resources/application-local.yml +++ b/data/src/main/resources/application-local.yml @@ -29,38 +29,9 @@ spring: cloud: nacos: discovery: - server-addr: 192.168.65.161:8848/nacos + server-addr: 192.168.65.161:8848 group: LOCAL_GROUP -# server-addr: 127.0.0.1:8848 enabled: true -# username: nacos -# password: ENC(+QKYnI6gAYu1SbLaZQTkZA==) - data: - redis: - # Redis默认情况下有16个分片(库),这里配置具体使用的分片,默认是0 - database: 0 - # redis服务器地址(填写自己的服务器地址) - host: 192.168.2.166 - # redis端口(默认6379) - port: 6379 - #redis连接超时等待,10秒 - timeout: PT10S - # redis访问密码(默认为空) - password: - lettuce: - pool: - # 连接池最大连接数(使用负值表示没有限制) 默认 8 - max-active: 50 - # 连接池中的最大空闲连接 默认 8 - max-idle: 20 - # 连接池中的最小空闲连接 默认 0 - min-idle: 1 - # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1,这里配置10s - max-wait: PT10S -# password: -# sentinel: -# master: mymaster -# nodes: 10.18.109.50:26379,10.18.109.51:26379,10.18.109.52:26379 servlet: multipart: # 单个文件的最大值 @@ -124,4 +95,22 @@ minio: access-key: minioadmin secret-key: minioadmin secure: false - bucket-name: spdm \ No newline at end of file + bucket-name: spdm + + +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false \ No newline at end of file diff --git a/gateway2/src/main/java/com/sdm/gateway2/health/DownstreamServicesHealthIndicator.java b/gateway2/src/main/java/com/sdm/gateway2/health/DownstreamServicesHealthIndicator.java index 6e1cb9e5..33add235 100644 --- a/gateway2/src/main/java/com/sdm/gateway2/health/DownstreamServicesHealthIndicator.java +++ b/gateway2/src/main/java/com/sdm/gateway2/health/DownstreamServicesHealthIndicator.java @@ -1,8 +1,9 @@ -/* package com.sdm.gateway2.health; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.cloud.client.loadbalancer.reactive.ReactorLoadBalancerExchangeFilterFunction; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClientRequestException; @@ -13,26 +14,28 @@ import java.time.Duration; import java.util.HashMap; import java.util.Map; -*/ /** + * /actuator/health 查看整体健康状态 * 下游服务健康检查指示器 * 检查关键下游服务的可达性 - *//* + */ @Component public class DownstreamServicesHealthIndicator implements HealthIndicator { // 服务名称列表 private static final String[] SERVICE_NAMES = { - "approve", "capability", "data", "pbs", - "performance", "project", "system", "task" + "data", "project","system","task" }; + @Autowired + private ReactorLoadBalancerExchangeFilterFunction loadBalancerExchangeFilterFunction; + @Override public Health health() { Map servicesStatus = new HashMap<>(); boolean allServicesUp = true; - + // 检查各个关键服务的状态 for (String serviceName : SERVICE_NAMES) { boolean serviceUp = checkServiceStatus(serviceName); @@ -41,7 +44,7 @@ public class DownstreamServicesHealthIndicator implements HealthIndicator { allServicesUp = false; } } - + if (allServicesUp) { return Health.up() .withDetail("downstreamServices", servicesStatus) @@ -54,27 +57,28 @@ public class DownstreamServicesHealthIndicator implements HealthIndicator { .build(); } } - - */ -/** + + + /** * 检查特定服务的状态 * 通过调用服务的 /actuator/health 端点来检查服务的健康状况 - *//* + */ private boolean checkServiceStatus(String serviceName) { try { WebClient webClient = WebClient.builder() + .filter(loadBalancerExchangeFilterFunction) .baseUrl("http://" + serviceName) .build(); - + // 设置较短的超时时间,避免健康检查阻塞太久 String response = webClient.get() .uri("/actuator/health") .retrieve() .bodyToMono(String.class) - .timeout(Duration.ofSeconds(5)) // 5秒超时 + .timeout(Duration.ofSeconds(25)) // 25秒超时 .block(); - + // 如果能成功获取响应,则认为服务是可达的 return response != null && !response.isEmpty(); } catch (WebClientResponseException e) { @@ -88,4 +92,4 @@ public class DownstreamServicesHealthIndicator implements HealthIndicator { return false; } } -}*/ +} \ No newline at end of file diff --git a/gateway2/src/main/resources/application-dev.yml b/gateway2/src/main/resources/application-dev.yml index 97d34332..aed8fa3f 100644 --- a/gateway2/src/main/resources/application-dev.yml +++ b/gateway2/src/main/resources/application-dev.yml @@ -85,18 +85,18 @@ management: endpoints: web: exposure: - include: health,info,metrics,logfile + include: health,info endpoint: health: show-details: always - enabled: true - probes: - enabled: true - info: - enabled: true - info: - env: - enabled: true + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false logging: level: diff --git a/gateway2/src/main/resources/application-local.yml b/gateway2/src/main/resources/application-local.yml index 7ea83cdd..a7a308be 100644 --- a/gateway2/src/main/resources/application-local.yml +++ b/gateway2/src/main/resources/application-local.yml @@ -85,18 +85,18 @@ management: endpoints: web: exposure: - include: health,info,metrics,logfile + include: health,info endpoint: health: show-details: always - enabled: true - probes: - enabled: true - info: - enabled: true - info: - env: - enabled: true + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false logging: level: diff --git a/project/src/main/resources/application-dev.yml b/project/src/main/resources/application-dev.yml index 7048fa61..526caa83 100644 --- a/project/src/main/resources/application-dev.yml +++ b/project/src/main/resources/application-dev.yml @@ -75,6 +75,14 @@ management: endpoint: health: show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false mybatis-plus: configuration: diff --git a/project/src/main/resources/application-local.yml b/project/src/main/resources/application-local.yml index 9c44bd24..4fe4e937 100644 --- a/project/src/main/resources/application-local.yml +++ b/project/src/main/resources/application-local.yml @@ -95,4 +95,21 @@ file: rootPath: /data/home/sdm #logging: -# config: ./config/logback.xml \ No newline at end of file +# config: ./config/logback.xml + +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false \ No newline at end of file diff --git a/system/src/main/resources/application-dev.yml b/system/src/main/resources/application-dev.yml index 5ce4f346..ee33099c 100644 --- a/system/src/main/resources/application-dev.yml +++ b/system/src/main/resources/application-dev.yml @@ -74,6 +74,14 @@ management: endpoint: health: show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false mybatis-plus: configuration: diff --git a/system/src/main/resources/application-local.yml b/system/src/main/resources/application-local.yml index b414de35..a81395ff 100644 --- a/system/src/main/resources/application-local.yml +++ b/system/src/main/resources/application-local.yml @@ -66,6 +66,23 @@ spring: # 上传文件总的最大值 max-request-size: 10240MB +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false + mybatis-plus: configuration: map-underscore-to-camel-case: true @@ -134,4 +151,10 @@ cid: listRoles: /spdm-role/listRoles tenant: getTenantDetailById: /spdm-tenant/getTenantDetailById - listTenant: /spdm-tenant/listTenant \ No newline at end of file + listTenant: /spdm-tenant/listTenant + flow: + launchApprove: /spdm-flow/startFlow + queryFlowTemplate: /spdm-flow/listProcessByGroup + queryApproveDetail: /spdm-flow/queryFlowNodeDetail + stopApproveFlow: /spdm-flow/stopFlow + group: SPDM \ No newline at end of file diff --git a/task/src/main/resources/application-dev.yml b/task/src/main/resources/application-dev.yml index 3c0a24a4..7291c0bf 100644 --- a/task/src/main/resources/application-dev.yml +++ b/task/src/main/resources/application-dev.yml @@ -77,6 +77,14 @@ management: endpoint: health: show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false mybatis-plus: configuration: diff --git a/task/src/main/resources/application-local.yml b/task/src/main/resources/application-local.yml index 1c474bf3..19077206 100644 --- a/task/src/main/resources/application-local.yml +++ b/task/src/main/resources/application-local.yml @@ -1,5 +1,5 @@ server: - port: 8080 + port: 7102 spring: application: @@ -31,10 +31,8 @@ spring: discovery: server-addr: 192.168.65.161:8848 group: LOCAL_GROUP -# server-addr: 127.0.0.1:8848 - enabled: false - # username: nacos -# password: ENC(+QKYnI6gAYu1SbLaZQTkZA==) + enabled: true + data: redis: # Redis默认情况下有16个分片(库),这里配置具体使用的分片,默认是0 @@ -68,6 +66,23 @@ spring: # 上传文件总的最大值 max-request-size: 10240MB +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + show-details: always + group: + readiness: + include: discoveryComposite,ping,refreshScope + health: + redis: + enabled: false + db: + enabled: false + mybatis-plus: configuration: map-underscore-to-camel-case: true