From 208d516403f04203e452061e1731754fc501bd5b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 May 2023 16:49:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=A2=9E=E5=8A=A0pid,orgIdPath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/result/CustomerStaffInfoCacheResult.java | 9 +++++++++ .../tools/redis/common/bean/CustomerStaffInfoCache.java | 9 ++++++++- .../dto/epmetuser/result/CustomerStaffResultDTO.java | 9 ++++++++- .../epmet/dataaggre/controller/EpmetUserController.java | 2 +- .../service/epmetuser/impl/EpmetUserServiceImpl.java | 8 ++++---- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index 81c74a4c38..6e9944c316 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java @@ -22,6 +22,15 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String agencyId; + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; + /** * 工作人员所属组织ID的pids */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index 87e53edcb0..012d38321a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -21,7 +21,14 @@ public class CustomerStaffInfoCache implements Serializable { * 工作人员所属组织ID */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index 3269ebcb26..0bc9203d45 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java @@ -20,7 +20,14 @@ public class CustomerStaffResultDTO implements Serializable { * 工作人员所属组织ID */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 24d9c5a738..2498606f80 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -268,7 +268,7 @@ public class EpmetUserController { * remark: */ @PostMapping("getStaffInfo/{staffId}") - public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ + public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ return new Result().ok(epmetUserService.getStaffInfo(staffId)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 75f863dd58..ea9980e7af 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -18,10 +18,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.BadgeConstant; import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; @@ -650,6 +647,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { } result.setStaffId(staffEntity.getUserId()); result.setAgencyId(agencyDTO.getId()); + //新增pid,orgIdPath + result.setPid(agencyDTO.getPid()); + result.setOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyDTO.getId(),agencyDTO.getPids())); result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyPIds(agencyDTO.getPids()); result.setLevel(agencyDTO.getLevel()); From 965f109f363aaa0389c1168f01eccecef43c467c Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 11 May 2023 18:07:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B0=83=E9=94=99=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/NeighborHoodServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index a1cfc38328..ce476682a5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.enums.CollectUrlEnum; import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -134,6 +135,7 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl Date: Fri, 12 May 2023 09:08:00 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=86=99=E7=82=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/epmet-cloud.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/epmet-cloud.md b/doc/epmet-cloud.md index e47ddfc70e..e2a5d270cf 100644 --- a/doc/epmet-cloud.md +++ b/doc/epmet-cloud.md @@ -14,7 +14,23 @@ PS:目前正在测试通过负载均衡器和本地环境变量实现动态修 ## 私有化部署 -##### 需要开放哪些域名 +##### 需要对外访问哪些域名 -- epmet-cloud.elinkservice.cn 微信交互代理 -- dysmsapi.aliyuncs.com 阿里云短信 \ No newline at end of file +- epmet-cloud.elinkservice.cn 微信交互代理,第三方,客户等 +- dysmsapi.aliyuncs.com 阿里云短信 +- api.weixin.qq.com 微信直接交互(二维码等) +- oss-cn-qingdao.aliyuncs.com(如果需要用到oss) + + + +#### 腾讯云呼叫中心需要调用,需要开放 +- https://map.qq.com +- https://pr.map.qq.com +- https://webapi.amap.com +- https://tccc.qcloud.com +- https://aegis.qq.com +- https://api.tccc.qcloud.com +- wss://wss.im.qcloud.com +- https://tpstelemetry.tencent.com +- https://ccc.ap-shanghai.tencentcloudapi.com +- https://ccc.tencentcloudapi.com From bc27769823a34bd9ad08532493cf2632c9d4a139 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 12 May 2023 09:10:44 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=86=99=E7=82=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/epmet-cloud.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/epmet-cloud.md b/doc/epmet-cloud.md index e2a5d270cf..18928176dc 100644 --- a/doc/epmet-cloud.md +++ b/doc/epmet-cloud.md @@ -4,11 +4,11 @@ ``` 开发环境已经搭建好了 在最新的代码中: - 默认情况下,所有服务的pom.xml中应该启用dev环境,其他环境的active应该被注释掉(dev-local不再有用,可以删除) + 默认情况下,所有服务的pom.xml中启用local环境,其他环境的active应该被注释掉 根据dev环境中的配置,微服务会注册到nacos,并且调用其他微服务的时候会从nacos中取目标微服务的ip来发送请求 因此,本地电脑不再需要启动所有服务,只需要启动要开发的服务即可;默认情况下,本机的微服务在调用目标微服务的时候,都是调用的服务器,不再请求本地。 例如:有A、B2个服务,并且A调用B,如果我们只需要开发A服务,那本地只启动A服务即可,A调用B的时候,会调用服务器的B服务。 -如果需要开发AB2个服务,那么将A中的FeignClient的url属性指向localhost。 +如果需要开发AB2个服务,那么将A中的FeignClient的url属性指向localhost:[B的端口]。 PS:目前正在测试通过负载均衡器和本地环境变量实现动态修改目标服务IP,成功之后就不需要再修改FeignClient的url,配置一下环境变量即可,到时候具体说 ``` From 6bf9d9732d4f83c5b49bf5d371353119ebd76a5e Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 15 May 2023 14:05:38 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=85=B3=E6=A0=87=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=9A=84=E6=97=B6=E5=80=99=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9Etrue=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/ScanContentUtils.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index e04227d5dc..bf0bfb5ba5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -27,12 +27,59 @@ import java.util.stream.Collectors; **/ @Slf4j public class ScanContentUtils { + + // 内容审核是否可用。烟台是政务网,无法使用互联网,所以该功能不可用 + public static final Boolean USABLE = true; + + /** + * 模拟sync成功的结果(可以用来模拟,也可以适用于无法使用互联网的环境) + * @author wxz + * @date 2022/12/13 15:37 + * + * * @return Result + */ + public static Result mockSyncSuccessResult() { + Result tempRst = new Result<>(); + SyncScanResult syncScanResult = new SyncScanResult(); + syncScanResult.setAllPass(true); + tempRst.setData(syncScanResult); + return tempRst; + } + + /** + * 模拟async成功的结果(可以用来模拟,也可以适用于无法使用互联网的环境) + * @author wxz + * @date 2022/12/13 15:46 + * + * * @return Result + */ + public static Result mockAsyncSuccessResult() { + Result tempRst = new Result<>(); + AsyncScanResult asyncScanResult = new AsyncScanResult(); + asyncScanResult.setAllSuccess(true); + tempRst.setData(asyncScanResult); + return tempRst; + } + + public static Result mockVideoAsyncSuccessResult() { + Result tempRst = new Result<>(); + VideoAsyncScanResultDTO asyncScanResult = new VideoAsyncScanResultDTO(); + asyncScanResult.setIsAllPass(true); + tempRst.setData(asyncScanResult); + return tempRst; + } + /** * desc:图片同步扫描 * * @return */ public static Result imgSyncScan(String url, ImgScanParamDTO param) { + + if (!USABLE) { + return mockSyncSuccessResult(); + } + //start 测试环境停机了,先这样改试试 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ @@ -68,6 +115,11 @@ public class ScanContentUtils { * @return */ public static Result textSyncScan(String url, TextScanParamDTO param) { + + if (!USABLE) { + return mockSyncSuccessResult(); + } + //start 测试环境停机了,先这样改试试 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ @@ -104,6 +156,11 @@ public class ScanContentUtils { * @return 返回检测对象对应的任务id */ public static Result voiceAsyncScan(String url, VoiceScanParamDTO param){ + + if (!USABLE) { + return mockAsyncSuccessResult(); + } + log.debug("voiceAsyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); @@ -164,6 +221,11 @@ public class ScanContentUtils { * @description 异步检测-提交检测任务 **/ public static Result videoAsyncScan(String url, VideoScanParamDTO param){ + + if (!USABLE) { + return mockAsyncSuccessResult(); + } + log.debug("videoAsyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); @@ -194,6 +256,11 @@ public class ScanContentUtils { * @description 查询视频检测结果 **/ public static Result videoResults(String url, List taskIds) { + + if (!USABLE) { + return mockVideoAsyncSuccessResult(); + } + if (StringUtils.isBlank(url) || CollectionUtils.isEmpty(taskIds)) { throw new RenException("参数错误"); }