From 83442076ac9d938ea60ae10cb5010b5821825e77 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 27 Sep 2023 14:52:25 +0800 Subject: [PATCH] =?UTF-8?q?#=E6=B0=B4=E7=94=B5=E7=AB=99bug=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/service/impl/HydropowerServiceImpl.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index e4369a1..adf3cb8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -51,6 +51,7 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.Dept; +import org.springblade.system.feign.ISysClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springframework.beans.factory.annotation.Value; @@ -107,6 +108,8 @@ public class HydropowerServiceImpl implements HydropowerService { private final ISoeClient soeClient; + private final ISysClient sysClient; + private final ITicketInfoClient ticketInfoClient; private final IPlanGenertionClient planGenertionClient; @@ -1610,10 +1613,22 @@ public class HydropowerServiceImpl implements HydropowerService { */ @Override public AppAreaDutyVo areaDuty(Long deptId) { + if(ObjectUtil.isEmpty(deptId)){ + R> result = sysClient.getDeptByCurrentUser(); + if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ + return new AppAreaDutyVo(); + } + List depts = result.getData().stream().filter(o->HomePageConstant.AREA.equals(o.getDeptCategory())).collect(Collectors.toList()); + if(CollectionUtil.isEmpty(depts)){ + return new AppAreaDutyVo(); + } + deptId = depts.get(0).getId(); + } + // 获取当班列表数据 List dutys = this.dutyMainService.getDutyDataV2(deptId); if(CollectionUtil.isEmpty(dutys)){ - return null; + return new AppAreaDutyVo(); } DutyMainInfoVo duty = dutys.get(0); // 响应数据