From fc9d39ae4e7b06de546a771d0a907ecb9ebe160c Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 9 Jun 2022 14:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=91=E7=8A=B6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/controller/PowerAxisStructController.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index 250a4f8..c65f523 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -1,9 +1,12 @@ package com.epmet.plugin.power.modules.axis.controller; +import com.alibaba.excel.util.StringUtils; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -97,7 +100,14 @@ public class PowerAxisStructController { * @date 2022/4/19/0019 14:17 */ @PostMapping("list4Tree") - public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { + public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto,@LoginUser TokenDto tokenDto) { + String agencyId = formDto.getAgencyId(); + if (StringUtils.isBlank(agencyId)) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null != staffInfo && StringUtils.isNotBlank(staffInfo.getAgencyId())) { + formDto.setAgencyId(staffInfo.getAgencyId()); + } + } return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); }