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); // 响应数据