From 850b3174a265a23905a2ac1976cce6d34f94b2c8 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 20 Apr 2026 13:43:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E5=89=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +- .../com/njcn/mq/constant/BusinessTopic.java | 23 + .../com/njcn/oss/utils/FileStorageUtil.java | 68 + .../njcn/redis/pojo/enums/AppRedisKey.java | 4 + pqs-gateway/src/main/resources/bootstrap.yml | 284 +- pqs-harmonic/harmonic-boot/pom.xml | 12 +- pqs.ipr | 4049 ++++++++--------- pqs.iws | 225 +- 8 files changed, 2547 insertions(+), 2124 deletions(-) diff --git a/pom.xml b/pom.xml index 6be466344..80860052b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,9 +44,9 @@ 192.168.1.103 - 192.168.2.130 + 192.168.2.124 - 192.168.1.22 + 192.168.1.103 ${middle.server.url}:18848 @@ -54,7 +54,7 @@ njcnpqs - hswbpm + cb3a03dd-47f6-4a83-9408-b3182b3d0619 diff --git a/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java b/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java index b2af5f19c..2c7ca0fee 100644 --- a/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java +++ b/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java @@ -81,6 +81,29 @@ public interface BusinessTopic { String RMP_EVENT_DETAIL_TOPIC = "rmpEventDetailTopic"; +// /** +// * 云前置文件信息请求主题 +// */ +// String FILE_INFO_REQUEST_TOPIC = "fileInfoRequestTopic"; +// +// /** +// * 云前置文件信息响应主题 +// */ +// String FILE_INFO_RESPONSE_TOPIC = "fileInfoResponseTopic"; +// +// /** +// * 云前置文件下载请求主题 +// */ +// String FILE_DOWNLOAD_REQUEST_TOPIC = "fileDownloadRequestTopic"; +// /** +// * 云前置文件下载响应主题 +// */ +// String FILE_DOWNLOAD_RESPONSE_TOPIC = "fileDownloadResponseTopic"; + + String CLOUD_TOPIC = "Cloud_Topic"; + + String CLOUD_REPLY_TOPIC = "Cloud_Reply_Topic"; + interface AppDataTag { diff --git a/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java b/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java index c68d55105..9b47aa793 100644 --- a/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java +++ b/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java @@ -2,9 +2,12 @@ package com.njcn.oss.utils; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.IdUtil; +import com.aliyun.oss.OSS; +import com.njcn.ali.oss.config.AliYunOssConfig; import com.njcn.ali.oss.util.AliYunOssUtils; import com.njcn.common.config.GeneralInfo; import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.huawei.obs.config.HuaweiObsProperties; import com.njcn.huawei.obs.util.OBSUtil; import com.njcn.minioss.bo.MinIoUploadResDTO; import com.njcn.minioss.config.MinIossProperties; @@ -12,6 +15,8 @@ import com.njcn.minioss.util.MinIoUtils; import com.njcn.oss.constant.GeneralConstant; import com.njcn.oss.constant.OssPath; import com.njcn.oss.enums.OssResponseEnum; +import com.obs.services.ObsClient; +import com.obs.services.model.PutObjectRequest; import io.minio.*; import io.minio.messages.Item; import lombok.RequiredArgsConstructor; @@ -70,6 +75,11 @@ public class FileStorageUtil { */ private final AliYunOssUtils aliYunOssUtils; + private final HuaweiObsProperties huaweiObsProperties; + + private final OSS ossClient; + private final AliYunOssConfig ossConfig; + /*** * 上传MultipartFile文件, @@ -442,4 +452,62 @@ public class FileStorageUtil { return file; } + public void mkdir(String directoryPath) { + if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { + this.createDirectoryHW(directoryPath); + } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) { + minIoUtils.createDirectory(minIossProperties.getBucket(), directoryPath); + } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) { + this.createDirectoryAli(directoryPath); + } else { + + } + } + + /** + * 华为文件服务器创建空目录 + * + * @param dirPath + */ + private void createDirectoryHW(String dirPath) { + ObsClient obsClient = null; + try { + obsClient = this.huaweiObsProperties.getInstance(); + String bucketName = this.huaweiObsProperties.getObs().getBucket(); + + // 确保路径以 / 结尾 + String directoryKey = dirPath.endsWith("/") ? dirPath : dirPath + "/"; + + // 创建空对象作为目录占位符 + InputStream emptyStream = new ByteArrayInputStream(new byte[0]); + PutObjectRequest request = new PutObjectRequest(bucketName, directoryKey, emptyStream); + obsClient.putObject(request); + + log.info("已创建目录占位符:" + directoryKey); + } catch (Exception e) { + throw new RuntimeException("创建目录失败" + dirPath, e); + } finally { + this.huaweiObsProperties.destroy(obsClient); + } + } + + + /** + * 阿里云文件服务器创建空目录 + * + * @param dirPath + */ + public void createDirectoryAli(String dirPath) { + try { + // 确保路径以 / 结尾,表示目录 + String directoryKey = dirPath.endsWith("/") ? dirPath : dirPath + "/"; + + // 创建空输入流作为目录占位符 + ByteArrayInputStream emptyStream = new ByteArrayInputStream(new byte[0]); + + this.ossClient.putObject(this.ossConfig.getBucket(), directoryKey, emptyStream); + } catch (Exception e) { + throw new RuntimeException("创建目录失败:" + dirPath, e); + } + } } diff --git a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java index 50b0b397c..715f249db 100644 --- a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java +++ b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java @@ -115,4 +115,8 @@ public interface AppRedisKey { * 补召文件 */ String MAKE_UP_FILES = "makeUpFilesKey:"; + + String COMMON_REQUEST = "commonRequestKey:"; + + String COMMON_RESOPNSE = "commonResponseKey:"; } diff --git a/pqs-gateway/src/main/resources/bootstrap.yml b/pqs-gateway/src/main/resources/bootstrap.yml index f724f8097..7ceb0bc24 100644 --- a/pqs-gateway/src/main/resources/bootstrap.yml +++ b/pqs-gateway/src/main/resources/bootstrap.yml @@ -1,3 +1,283 @@ +#当前服务的基本信息 +microservice: + ename: @artifactId@ + name: "@name@" + version: @version@ + sentinel: + url: @sentinel.url@ + gateway: + url: @gateway.url@ +server: + port: 10215 spring: - profiles: - active: @spring.profiles.active@ \ No newline at end of file + application: + name: @artifactId@ + main: + allow-bean-definition-overriding: true + #nacos注册中心以及配置中心的指定 + cloud: + nacos: + discovery: + ip: @service.server.url@ + server-addr: @nacos.url@ + username: @nacos.username@ + password: @nacos.password@ + namespace: @nacos.namespace@ + config: + server-addr: @nacos.url@ + username: @nacos.username@ + password: @nacos.password@ + namespace: @nacos.namespace@ + file-extension: yaml + shared-configs: + - data-id: share-config.yaml + refresh: true + - data-id: share-config-datasource-db.yaml + refresh: true + gateway: + globalcors: + corsConfigurations: + '[/**]': + allowCredentials: true + exposedHeaders: "Content-Disposition,Content-Type,Cache-Control" + allowedHeaders: "*" + allowedOrigins: "*" + allowedMethods: "*" + discovery: + locator: + # 开启自动代理 (自动装载从配置中心serviceId) + enabled: true + # 服务id为true --> 这样小写服务就可访问了 + lower-case-service-id: true + routes: + - id: pqs-auth + uri: lb://pqs-auth + predicates: + - Path=/pqs-auth/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: user-boot + uri: lb://user-boot + predicates: + - Path=/user-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: device-boot + uri: lb://device-boot + predicates: + - Path=/device-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: system-boot + uri: lb://system-boot + predicates: + - Path=/system-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: harmonic-boot + uri: lb://harmonic-boot + predicates: + - Path=/harmonic-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: energy-boot + uri: lb://energy-boot + predicates: + - Path=/energy-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: event-boot + uri: lb://event-boot + predicates: + - Path=/event-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: quality-boot + uri: lb://quality-boot + predicates: + - Path=/quality-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: harmonic-prepare + uri: lb://harmonic-prepare + predicates: + - Path=/harmonic-prepare/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: process-boot + uri: lb://process-boot + predicates: + - Path=/process-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: prepare-boot + uri: lb://prepare-boot + predicates: + - Path=/prepare-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: algorithm-boot + uri: lb://algorithm-boot + predicates: + - Path=/algorithm-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: access-boot + uri: lb://access-boot + predicates: + - Path=/access-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: cs-device-boot + uri: lb://cs-device-boot + predicates: + - Path=/cs-device-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: cs-system-boot + uri: lb://cs-system-boot + predicates: + - Path=/cs-system-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: cs-warn-boot + uri: lb://cs-warn-boot + predicates: + - Path=/cs-warn-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: cs-harmonic-boot + uri: lb://cs-harmonic-boot + predicates: + - Path=/cs-harmonic-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: advance-boot + uri: lb://advance-boot + predicates: + - Path=/advance-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: bpm-boot + uri: lb://bpm-boot + predicates: + - Path=/bpm-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: supervision-boot + uri: lb://supervision-boot + predicates: + - Path=/supervision-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + - id: cs-report-boot + uri: lb://cs-report-boot + predicates: + - Path=/cs-report-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + #河北国网总部调用省侧接口,路径总部统一规定 + - id: hb_pms_down + uri: lb://harmonic-boot + predicates: + - Path=/IndexAnalysis/** + - Path=/pms-tech-powerquality-start/** + - id: zl-event-boot + uri: lb://zl-event-boot + predicates: + - Path=/zl-event-boot/** + filters: + - SwaggerHeaderFilter + - StripPrefix=1 + +#项目日志的配置 +logging: + #config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml + level: + root: info + +whitelist: + urls: + - /user-boot/user/generateSm2Key + - /user-boot/theme/getTheme + - /user-boot/user/updateFirstPassword + - /user-boot/appUser/authCode + - /user-boot/appUser/register + - /user-boot/appUser/resetPsd + - /pqs-auth/oauth/logout + - /pqs-auth/oauth/token + - /pqs-auth/oauth/autoLogin + - /pqs-auth/auth/getImgCode + - /pqs-auth/oauth/getPublicKey + - /pqs-auth/judgeToken/heBei + - /pqs-auth/judgeToken/guangZhou + + - /webjars/** + - /actuator/** + - /doc.html + - /swagger-resources/** + - /*/v2/api-docs + - /favicon.ico + - /system-boot/theme/getTheme + - /system-boot/image/toStream + - /system-boot/file/download + - /cs-system-boot/appinfo/queryAppInfoByType + - /system-boot/dictType/dictDataCache + - /system-boot/file/** + - /system-boot/area/** + - /bpm-boot/** + - /harmonic-boot/comAccess/getComAccessData + - /harmonic-boot/harmonic/getHistoryResult + - /event-boot/transient/getTransientAnalyseWave +# - /** + #开始 +# - /advance-boot/** +# - /device-boot/** +# - /system-boot/** +# - /harmonic-boot/** +# - /energy-boot/** +# - /event-boot/** +# - /quality-boot/** +# - /harmonic-prepare/** +# - /process-boot/** +# - /bpm-boot/** +# - /system-boot/** +# - /supervision-boot/** +# - /user-boot/** +# - /harmonic-boot/** +# - /cs-device-boot/** + #结束 + - /user-boot/user/listAllUserByDeptId + - /IndexAnalysis/** +#mqtt: +# client-id: @artifactId@${random.value} + + + + + + + + + diff --git a/pqs-harmonic/harmonic-boot/pom.xml b/pqs-harmonic/harmonic-boot/pom.xml index 8efd6ebe4..ecf3c401b 100644 --- a/pqs-harmonic/harmonic-boot/pom.xml +++ b/pqs-harmonic/harmonic-boot/pom.xml @@ -99,12 +99,12 @@ joda-time 2.9.9 - + com.njcn advance-api diff --git a/pqs.ipr b/pqs.ipr index 619204534..aabf7065c 100644 --- a/pqs.ipr +++ b/pqs.ipr @@ -516,6 +516,7 @@ + @@ -554,6 +555,7 @@ + @@ -604,9 +606,7 @@ - - - + @@ -619,11 +619,12 @@ + + - @@ -633,6 +634,7 @@ + diff --git a/pqs.iws b/pqs.iws index d21ca99e5..054f1ef1c 100644 --- a/pqs.iws +++ b/pqs.iws @@ -6,13 +6,11 @@ - - - - - - - + + + + + @@ -274,9 +272,10 @@ @@ -315,6 +314,9 @@ + { + "associatedIndex": 6 +} - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "project.structure.last.edited": "Project", - "project.structure.proportion": "0.0", - "project.structure.side.proportion": "0.0", - "settings.editor.selected.configurable": "MavenSettings" + +}]]> @@ -458,6 +493,8 @@ @@ -470,15 +507,6 @@