From 3d48696eee726bbee042f4ba553cb7d47e226211 Mon Sep 17 00:00:00 2001 From: guo Date: Tue, 8 Aug 2023 11:58:52 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sjmq/listener/UopModifyMessageReceiveListener.java | 10 +++++----- .../java/com/zhgd/xmgl/async/AsyncEnvironment.java | 6 +++--- .../java/com/zhgd/xmgl/async/AsyncSendAttendance.java | 6 +++--- src/main/java/com/zhgd/xmgl/call/SanjiangDataCall.java | 6 +++--- .../modules/project/controller/ProjectController.java | 5 +++-- .../project/service/impl/ProgressTaskServiceImpl.java | 10 +++++----- .../project/service/impl/ProjectServiceImpl.java | 4 ++-- .../impl/ProjectOperationsAnalysisServiceImpl.java | 6 +++--- .../service/impl/WorkerAttendanceServiceImpl.java | 10 +++++----- .../worker/service/impl/WorkerInfoServiceImpl.java | 8 ++++---- .../WorkerMonthAttendanceStatisticsServiceImpl.java | 6 +++--- .../yunlianwanwu/middle/service/MiddleService.java | 8 ++++---- .../modules/yunlianwanwu/middle/task/MiddleTask.java | 4 ++-- .../java/com/zhgd/xmgl/security/JwtTokenFilter.java | 6 +++--- .../java/com/zhgd/xmgl/security/WebSecurityConfig.java | 6 +++--- .../{ProfileJudgeUtil.java => EnvironmentUtil.java} | 2 +- src/main/resources/application-sjjt-gsx.properties | 2 +- 17 files changed, 53 insertions(+), 52 deletions(-) rename src/main/java/com/zhgd/xmgl/util/{ProfileJudgeUtil.java => EnvironmentUtil.java} (98%) diff --git a/src/main/java/com/zhgd/sjmq/listener/UopModifyMessageReceiveListener.java b/src/main/java/com/zhgd/sjmq/listener/UopModifyMessageReceiveListener.java index 1fac5dfe6..b81c57b75 100644 --- a/src/main/java/com/zhgd/sjmq/listener/UopModifyMessageReceiveListener.java +++ b/src/main/java/com/zhgd/sjmq/listener/UopModifyMessageReceiveListener.java @@ -2,7 +2,7 @@ package com.zhgd.sjmq.listener; import com.chinacreator.c2.uop.sync.receiver.UopMQMessageReceiverServiceImpl; import com.zhgd.sjmq.service.UopCustomMessageReceiverServiceImpl; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -27,11 +27,11 @@ public class UopModifyMessageReceiveListener { @Value("${c2_orguser_subscription:}") private String c2_orguser_subscription; @Autowired - private ProfileJudgeUtil profileJudgeUtil; + private EnvironmentUtil environmentUtil; @PostConstruct public void start() { - if (profileJudgeUtil.isSjjt()) { + if (environmentUtil.isSjjt()) { if (receiver != null) { receiver.stop(); } @@ -50,9 +50,9 @@ public class UopModifyMessageReceiveListener { @PreDestroy public void end() { - if (profileJudgeUtil.isSjjt()) { + if (environmentUtil.isSjjt()) { receiver.stop(); log.info("关闭mq"); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/zhgd/xmgl/async/AsyncEnvironment.java b/src/main/java/com/zhgd/xmgl/async/AsyncEnvironment.java index 064e822aa..50c11ae01 100644 --- a/src/main/java/com/zhgd/xmgl/async/AsyncEnvironment.java +++ b/src/main/java/com/zhgd/xmgl/async/AsyncEnvironment.java @@ -9,7 +9,7 @@ import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig; import com.zhgd.xmgl.modules.basicdata.entity.ThirdPartyPlatformService; import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper; import com.zhgd.xmgl.modules.basicdata.mapper.ThirdPartyPlatformServiceMapper; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -34,7 +34,7 @@ public class AsyncEnvironment { @Autowired private ThirdPartyPlatformServiceMapper thirdPartyPlatformServiceMapper; @Autowired - private ProfileJudgeUtil profileJudgeUtil; + private EnvironmentUtil environmentUtil; @Value("${govt.host:}") public String govtHost; @@ -47,7 +47,7 @@ public class AsyncEnvironment { @Async("environmentNoiseDataExecutor") public void sendEnvironmentNoiseData(DustNoiseData dustNoiseData, EnvironmentDev environmentDev) { try { - if (profileJudgeUtil.isJlwProd()) { + if (environmentUtil.isJlwProd()) { /*QueryWrapper queryWrapper =new QueryWrapper<>(); queryWrapper.lambda().eq(ProjectUfaceConfig::getProjectSn, environmentDev.getProjectSn()); ProjectUfaceConfig tempProjectUfaceConfig=projectUfaceConfigMapper.selectOne(queryWrapper); diff --git a/src/main/java/com/zhgd/xmgl/async/AsyncSendAttendance.java b/src/main/java/com/zhgd/xmgl/async/AsyncSendAttendance.java index 78ed3a32f..a9f6d1f88 100644 --- a/src/main/java/com/zhgd/xmgl/async/AsyncSendAttendance.java +++ b/src/main/java/com/zhgd/xmgl/async/AsyncSendAttendance.java @@ -13,7 +13,7 @@ import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper; import com.zhgd.xmgl.modules.worker.mapper.DepartmentInfoMapper; import com.zhgd.xmgl.modules.worker.mapper.TeamInfoMapper; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendancePresenceService; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; @@ -43,14 +43,14 @@ public class AsyncSendAttendance { @Autowired private WkServiceuCall wkServiceuCall; @Autowired - private ProfileJudgeUtil profileJudgeUtil; + private EnvironmentUtil environmentUtil; @Autowired private GovtOpenApiService govtOpenApiService; @Async("sendAttendanceExecutor") public void saveAndSendAttendance(WorkerAttendance workerAttendance, WorkerInfo info){ try { - if (profileJudgeUtil.isJlwProd()) { + if (environmentUtil.isJlwProd()) { // 向政务平台发送数据 govtOpenApiService.workerAttendanceSync(workerAttendance); } diff --git a/src/main/java/com/zhgd/xmgl/call/SanjiangDataCall.java b/src/main/java/com/zhgd/xmgl/call/SanjiangDataCall.java index 3b2ce5a44..38f8846dc 100644 --- a/src/main/java/com/zhgd/xmgl/call/SanjiangDataCall.java +++ b/src/main/java/com/zhgd/xmgl/call/SanjiangDataCall.java @@ -23,7 +23,7 @@ import com.zhgd.xmgl.modules.sanjiang.entity.SjImageProgress; import com.zhgd.xmgl.modules.sanjiang.entity.SjSendSjImageProgress; import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -50,7 +50,7 @@ public class SanjiangDataCall { @Value("${sj.business.gateway.api.key:}") String apiKey; @Autowired - ProfileJudgeUtil profileJudgeUtil; + EnvironmentUtil environmentUtil; @Value("${sj.upload.image.url.prefix:}") private String sjUploadUrlPrefix; @Autowired @@ -63,7 +63,7 @@ public class SanjiangDataCall { * 判断是三江环境 */ private boolean judgeSjEnvironment() { - boolean sjjt = profileJudgeUtil.isSjjt(); + boolean sjjt = environmentUtil.isSjjt(); return sjjt && StringUtils.isNotBlank(gateWayUrl) && StringUtils.isNotBlank(apiKey); } diff --git a/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java b/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java index 1fce8eea7..40fbe46ca 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java @@ -4,6 +4,7 @@ import cn.hutool.crypto.SecureUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gexin.fastjson.JSON; import com.zhgd.annotation.OperLog; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.mybatis.EntityMap; @@ -125,7 +126,7 @@ public class ProjectController { @ApiOperation(value = " 三江业务中台添加项目", notes = "三江业务中台添加项目", httpMethod = "POST") @PostMapping(value = "/sj/business/add") public Result addSjProject(@RequestBody @Validate SjProjectDto dto) { - log.info("addSjProject:{}", dto); + log.info("addSjProject:{}", JSON.toJSONString(dto)); Project project = new Project(); BeanUtils.copyProperties(dto, project); project.setCompanySn("B386480F85E84592B8E102224D090794"); @@ -143,7 +144,7 @@ public class ProjectController { @ApiOperation(value = " 三江业务中台更新项目(根据项目编号projectNumber更新)", notes = "三江业务中台更新项目(根据项目编号projectNumber更新)", httpMethod = "POST") @PostMapping(value = "/sj/business/update") public Result updateSjProject(@RequestBody @Validate SjProjectDto dto) { - log.info("updateSjProject:{}", dto); + log.info("updateSjProject:{}", JSON.toJSONString(dto)); Project project = new Project(); BeanUtils.copyProperties(dto, project); project.setCompanySn("B386480F85E84592B8E102224D090794"); diff --git a/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProgressTaskServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProgressTaskServiceImpl.java index 09f742b22..51e216e3b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProgressTaskServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/service/impl/ProgressTaskServiceImpl.java @@ -28,7 +28,7 @@ import com.zhgd.xmgl.modules.project.entity.vo.ActualProgressVO; import com.zhgd.xmgl.modules.project.enums.LevelNameEnum; import com.zhgd.xmgl.modules.project.mapper.ProgressTaskMapper; import com.zhgd.xmgl.modules.project.service.ProgressTaskService; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.extern.slf4j.Slf4j; import net.sf.mpxj.MPXJException; import net.sf.mpxj.ProjectFile; @@ -90,7 +90,7 @@ public class ProgressTaskServiceImpl extends ServiceImpl impl @Autowired private SystemAreasMapper systemAreasMapper; @Autowired - private ProfileJudgeUtil profileJudgeUtil; + private EnvironmentUtil environmentUtil; @Autowired private ProjectMapper projectMapper; @Autowired diff --git a/src/main/java/com/zhgd/xmgl/modules/realnamestatistics/service/impl/ProjectOperationsAnalysisServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/realnamestatistics/service/impl/ProjectOperationsAnalysisServiceImpl.java index ca640816c..af7185473 100644 --- a/src/main/java/com/zhgd/xmgl/modules/realnamestatistics/service/impl/ProjectOperationsAnalysisServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/realnamestatistics/service/impl/ProjectOperationsAnalysisServiceImpl.java @@ -21,7 +21,7 @@ import com.zhgd.xmgl.modules.worker.entity.WorkerType; import com.zhgd.xmgl.modules.worker.service.ITeamInfoService; import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; import com.zhgd.xmgl.modules.worker.service.IWorkerTypeService; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; @@ -55,7 +55,7 @@ public class ProjectOperationsAnalysisServiceImpl extends ServiceImpl sjUser = new ThreadLocal<>(); @@ -66,7 +66,7 @@ public class JwtTokenFilter extends OncePerRequestFilter { protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if (securityEnable) { //三江统一认证,3.登录:过滤器判断,回调地址获取code调用获取令牌,首页根据令牌获取登录数据信息 - if (profileJudgeUtil.isSjjt()) { + if (environmentUtil.isSjjt()) { try { validateSjProfile(request, response, filterChain); } catch (InvalidKeySpecException e) { diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 08d66d4f2..d9fa58355 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -1,6 +1,6 @@ package com.zhgd.xmgl.security; -import com.zhgd.xmgl.util.ProfileJudgeUtil; +import com.zhgd.xmgl.util.EnvironmentUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; @@ -44,7 +44,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { private boolean securityEnable; @Autowired - ProfileJudgeUtil profileJudgeUtil; + EnvironmentUtil environmentUtil; @Autowired public WebSecurityConfig(JwtAuthenticationEntryPoint unauthorizedHandler, @@ -70,7 +70,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { http.headers().frameOptions().disable(); if (securityEnable) { - if (profileJudgeUtil.isGxlt()) { + if (environmentUtil.isGxlt()) { http.authorizeRequests() //请求路径允许访问 .antMatchers("/xmgl/project/getProjectInfoBySn").permitAll(); diff --git a/src/main/java/com/zhgd/xmgl/util/ProfileJudgeUtil.java b/src/main/java/com/zhgd/xmgl/util/EnvironmentUtil.java similarity index 98% rename from src/main/java/com/zhgd/xmgl/util/ProfileJudgeUtil.java rename to src/main/java/com/zhgd/xmgl/util/EnvironmentUtil.java index df78ff19d..269874014 100644 --- a/src/main/java/com/zhgd/xmgl/util/ProfileJudgeUtil.java +++ b/src/main/java/com/zhgd/xmgl/util/EnvironmentUtil.java @@ -11,7 +11,7 @@ import java.util.stream.Stream; */ @Component @Slf4j -public class ProfileJudgeUtil { +public class EnvironmentUtil { @Value("${active.environment.name}") private String activeEnvironment; diff --git a/src/main/resources/application-sjjt-gsx.properties b/src/main/resources/application-sjjt-gsx.properties index e6bbadc42..1fc687004 100644 --- a/src/main/resources/application-sjjt-gsx.properties +++ b/src/main/resources/application-sjjt-gsx.properties @@ -95,4 +95,4 @@ sj.business.gateway.url=http://116.169.63.183:30867/ sj.business.gateway.api.key=nDmkHCxlQzCqE-xfYteXMw #\u4E09\u6C5F\u56FE\u7247\u8BBF\u95EE\u8DEF\u5F84\uFF08\u7528\u4E8E\u63A8\u9001\u4E1A\u52A1\u4E2D\u53F0\uFF09 sj.upload.image.url.prefix=http://192.168.34.221:11111/image/ - +active.environment.name=sjjt-dev