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)); }