From 626443cfc21e733ba8229f4aaa942854f4812092 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Nov 2021 15:57:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=AE=A2=E6=88=B7id=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=A2=84=E8=AD=A6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/OperCustomizeOpenFeignClient.java | 2 +- .../fallback/OperCustomizeOpenFeignClientFallback.java | 4 ++-- .../controller/ResiCategoryStatsConfigController.java | 9 +++------ .../com/epmet/service/impl/StatsResiWarnServiceImpl.java | 6 +++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index cb7f414587..2882f9977f 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -106,7 +106,7 @@ public interface OperCustomizeOpenFeignClient { Result> resiCategoryStatsListShowd(@RequestBody IcResiCategoryStatsConfigFormDTO formDTO); @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarnlist") - Result> resiCategoryWarnList(); + Result> resiCategoryWarnList(@RequestParam String customerId); @PostMapping("/oper/customize/resicategorystatsconfig/resicategorywarninfobyid") Result resiCategoryWarnInfoById(@RequestBody IcResiCategoryWarnConfigDTO dto); diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index a793685644..a75999eb0e 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -90,8 +90,8 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe } @Override - public Result> resiCategoryWarnList() { - return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList"); + public Result> resiCategoryWarnList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "resiCategoryWarnList",customerId); } @Override diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java index ef94b7b4ac..26f3537689 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -41,10 +41,7 @@ import com.epmet.service.IcResiCategoryStatsConfigService; import com.epmet.service.ResiCategoryStatsConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -148,11 +145,11 @@ public class ResiCategoryStatsConfigController { } @PostMapping("resicategorywarnlist") - public Result> resiCategoryWarnList(@LoginUser TokenDto tokenDTO){ + public Result> resiCategoryWarnList(@RequestParam String customerId){ //获取预警配置列表 List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper() .lambda() - .eq(IcResiCategoryWarnConfigEntity::getCustomerId,tokenDTO.getCustomerId()) + .eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId) .orderByAsc(IcResiCategoryWarnConfigEntity::getSort)); return new Result>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class)); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 60d355cbf4..3b12bcd10d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -56,7 +56,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { } List icResiCategoryStatsConfigDTOList = statsResult.getData(); //feign获取当前需要预警的配置信息以及阈值 - Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); if (!warnResult.success() || null == warnResult.getData()) { throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); @@ -200,7 +200,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { @Transactional(rollbackFor = Exception.class) public void resiWarn(String customerId) { // 获取预警配置项 - Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); if (!warnResult.success() || null == warnResult.getData()) { throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); } @@ -238,7 +238,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { @Override public void resiWarnByOne(String customerId, String userId) { // 获取预警配置项 - Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(); + Result> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList(customerId); if (!warnResult.success() || null == warnResult.getData()) { throw new RenException("预警配置查询失败:"+ warnResult.getMsg()); }