From 7b1725649a1442184f8329eafa48d785d2c57e55 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 14 Aug 2023 08:27:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?#=E6=99=BA=E8=83=BD=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E5=8F=91=E7=94=B5=E9=87=8Fbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/main/service/impl/SideHustleServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java index 3c0ae9a..9fe7989 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java @@ -1481,7 +1481,12 @@ public class SideHustleServiceImpl implements ISideHustleService { float power = 0f; // 遍历累计当月所有站点实际发电量 for(Map item : list){ - power += item.get(mon); + if(ObjectUtil.isEmpty(item.get(mon))){ + power += 0; + }else{ + power += item.get(mon); + } + } return power; } From 48ed6cb4272897cf96da9f8eec7db517f752c5ae Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 15 Aug 2023 10:12:46 +0800 Subject: [PATCH 2/6] =?UTF-8?q?#=E8=B7=AF=E7=94=B1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/MainWorkBenchServiceImpl.java | 34 +++++----------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java index 1bbc9bc..732f6ce 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java @@ -150,16 +150,17 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl stations = stationService.list(); + if(CollectionUtil.isEmpty(stations)){ + return null; + } + //根据用户权限获取机构 R> deptByCurrentUser = sysClient.getDeptByCurrentUser(); if (!deptByCurrentUser.isSuccess() || CollectionUtil.isEmpty(deptByCurrentUser.getData())) { return null; } - // 站点类型 - List typeList = this.getStationTypeList(deptByCurrentUser.getData()); - if (CollectionUtil.isEmpty(typeList)) { - return null; - } // 首页分类类型 : 集团、省子公司、区域、站点 Optional optionalDept = deptByCurrentUser.getData().stream().min(Comparator.comparing(Dept::getDeptCategory)); Integer deptCategory = optionalDept.isPresent() ? optionalDept.map(Dept::getDeptCategory).orElse(null) : null; @@ -172,7 +173,7 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl list = this.baseMapper.selectMainWorkBenchByType(deptCategory.toString(), null, vo.getRefTerminal(), typeList,deptList,dept.getId(),user.getUserId()); + List list = this.baseMapper.selectMainWorkBenchByType(deptCategory.toString(), null, vo.getRefTerminal(), stations.stream().map(StationEntity::getType).collect(Collectors.toList()), deptList,dept.getId(),user.getUserId()); // 路由列表包含指定用户,过滤非指定用户数据 boolean isDesign = CollectionUtil.isNotEmpty(list.stream().filter(o->StringUtils.isNotEmpty(o.getAscriptionUser())).collect(Collectors.toList())); if(isDesign){ @@ -183,25 +184,4 @@ public class MainWorkBenchServiceImpl extends BaseServiceImpl - */ - private List getStationTypeList(List list) { - // 站点类型 - List storage = Arrays.asList(HomePageConstant.HYDROPOWER, HomePageConstant.WIND_POWER, HomePageConstant.WATER_CONSERVANCY,HomePageConstant.PUMPING,HomePageConstant.GATE, HomePageConstant.ENERGY_STORAGE, - HomePageConstant.DISTRIBUTION_NETWORK, HomePageConstant.PHOTOVOLTAIC, HomePageConstant.WATER_AFFAIRS, HomePageConstant.CHARGE); - // 查询站点 - List stationEntityList = stationService.getStationList(list,null,storage,null,true); - if(CollectionUtil.isEmpty(stationEntityList)){ - return null; - } - Map> map = stationEntityList.stream().collect(Collectors.groupingBy(StationEntity::getType)); - if(MapUtils.isEmpty(map)){ - return null; - } - return new ArrayList<>(map.keySet()); - } } From d336c87860f631ff912a10c9b3e6d6f0ad133aeb Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 16 Aug 2023 14:48:05 +0800 Subject: [PATCH 3/6] =?UTF-8?q?#=E6=B0=B4=E5=88=A9=E5=B9=BF=E5=AE=81?= =?UTF-8?q?=E6=B0=B4=E5=88=A9=E5=B1=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/service/impl/AreaServiceImpl.java | 2 +- .../main/service/impl/WaterServiceImpl.java | 10 +++++----- .../station/service/impl/ImsDeptServiceImpl.java | 18 ++++++------------ .../station/service/impl/StationServiceImpl.java | 22 +++++++++++++++++++--- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaServiceImpl.java index 7b8f5f0..f00ff5b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaServiceImpl.java @@ -109,7 +109,7 @@ public class AreaServiceImpl implements AreaService { }}); if(CollectionUtil.isNotEmpty(configs)){ List stations =stationService.list(new LambdaQueryWrapper(){{ - eq(StationEntity::getType,HomePageConstant.HYDROPOWER); + in(StationEntity::getType,types); eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE); }}); if(CollectionUtil.isEmpty(stations)){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java index 72ee28a..632479a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java @@ -827,7 +827,7 @@ public class WaterServiceImpl implements IWaterService { @Override public WaterConservancyVo waterConservancy(Long deptId) { // 查询水利站点 - List stations = stationService.getHomeStationList(deptId, HomePageConstant.waterList, HomePageConstant.HYDROPOWER_SERVETYPE,true); + List stations = stationService.getHomeStationList(deptId, HomePageConstant.waterList, HomePageConstant.HYDROPOWER_SERVETYPE,false); if (CollectionUtil.isEmpty(stations)) { return new WaterConservancyVo(); } @@ -888,7 +888,7 @@ public class WaterServiceImpl implements IWaterService { public List waterDetails(Long deptId) { // 获取区域map : key-区域机构 value-水利站点集合 // 获取区域或者站点map结构 - Map> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,true); + Map> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,false); if(MapUtils.isEmpty(map)){ return null; } @@ -933,7 +933,7 @@ public class WaterServiceImpl implements IWaterService { @Override public List waterUseEleRanking(Long deptId) { // 获取区域map : key-区域机构 value-水利站点集合 - Map> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,true); + Map> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,false); if(MapUtils.isEmpty(map)){ return null; } @@ -1002,7 +1002,7 @@ public class WaterServiceImpl implements IWaterService { return null; } // 获取水利站点 - List stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,true); + List stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,false); if(CollectionUtil.isEmpty(stationList)){ return null; } @@ -1062,7 +1062,7 @@ public class WaterServiceImpl implements IWaterService { return null; } // 获取水利站点 - List stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,true); + List stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,false); if(CollectionUtil.isEmpty(stationList)){ return null; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java index b3d5b64..630b930 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java @@ -208,7 +208,7 @@ public class ImsDeptServiceImpl extends ServiceImpl stationEntityList = stationService.getStationType(serveType, type ,value,true); + List stationEntityList = stationService.getStationType(serveType, type ,value,false); if(CollectionUtil.isEmpty(stationEntityList)){ return null; } @@ -319,21 +319,13 @@ public class ImsDeptServiceImpl extends ServiceImpl paramIdList = this.getParamIdList(R.getData(),dept); - if(CollectionUtil.isEmpty(paramIdList)){ - return null; - } // 所有站点 List value = R.getData().stream().filter(o->o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList()); List type = ObjectUtil.isNotEmpty(typeArea) ? Collections.singletonList(typeArea) : null; if(HomePageConstant.WATER_CONSERVANCY.equals(typeArea)){ type = HomePageConstant.waterList; } - List stationEntityList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, type ,value,true); + List stationEntityList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, type ,value,false); if(CollectionUtil.isEmpty(stationEntityList)){ return null; } @@ -344,8 +336,10 @@ public class ImsDeptServiceImpl extends ServiceImpl areaList = validList.stream().filter(o->paramIdList.contains(o.getId()) && o.getDeptCategory().equals(3)).collect(Collectors.toList()); - return areaList.stream().map(o-> new AreaTypeVo(o.getId(),o.getDeptName())).collect(Collectors.toList()); + if(ObjectUtil.isNotEmpty(deptId)){ + return validList.stream().filter(o->deptId.equals(o.getId()) && o.getDeptCategory().equals(3)).map(o-> new AreaTypeVo(o.getId(),o.getDeptName())).collect(Collectors.toList()); + } + return validList.stream().filter(o->o.getDeptCategory().equals(3)).map(o-> new AreaTypeVo(o.getId(),o.getDeptName())).collect(Collectors.toList()); } /** diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 78b0091..0ebfdab 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -8,6 +8,8 @@ import com.hnac.hzims.common.service.UserAuthDataService; import com.hnac.hzims.fdp.feign.IQuestionClient; import com.hnac.hzims.hzimsweather.response.air.Station; import com.hnac.hzims.operational.OperationalConstants; +import com.hnac.hzims.operational.main.entity.UserDeptEntity; +import com.hnac.hzims.operational.main.service.UserDeptService; import com.hnac.hzims.operational.main.vo.StationCountVo; import com.hnac.hzims.operational.station.StationConstants; import com.hnac.hzims.operational.main.constant.HomePageConstant; @@ -70,6 +72,7 @@ public class StationServiceImpl extends BaseServiceImpl()); + refDepList = this.getStationDeptList(authList, types,dept.getId(), new ArrayList<>()); } // 获取水利站点(过滤其他站点类型) return this.getWaterList(refDepList, types, servrType,make); @@ -527,7 +530,20 @@ public class StationServiceImpl extends BaseServiceImpl getStationDeptList(List departList, Long deptId, List list) { + private List getStationDeptList(List departList, List types,Long deptId, List list) { + List configs = userDeptService.list(new LambdaQueryWrapper(){{ + eq(UserDeptEntity::getUserId, AuthUtil.getUserId()); + }}); + if(CollectionUtil.isNotEmpty(configs)){ + List stations =this.list(new LambdaQueryWrapper(){{ + in(StationEntity::getType,types); + eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE); + }}); + if(CollectionUtil.isEmpty(stations)){ + return new ArrayList<>(); + } + return stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()); + } if (null == deptId || CollectionUtil.isEmpty(departList)) { return null; } @@ -536,7 +552,7 @@ public class StationServiceImpl extends BaseServiceImpl Date: Fri, 18 Aug 2023 16:08:22 +0800 Subject: [PATCH 4/6] =?UTF-8?q?#=E6=B0=B4=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java index 632479a..99c71b8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java @@ -327,7 +327,7 @@ public class WaterServiceImpl implements IWaterService { */ private List getModelStationList() { // 水利站点(All) - List stationList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, null, null,true); + List stationList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, null, null,false); if(CollectionUtil.isEmpty(stationList)){ return null; } From 576536100a9ed2b3983a35222d3c98b0031ca247 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 23 Aug 2023 16:32:51 +0800 Subject: [PATCH 5/6] =?UTF-8?q?#=E5=8C=BA=E5=9F=9F=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 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 64689f0..e24f360 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 @@ -1593,7 +1593,7 @@ public class HydropowerServiceImpl implements HydropowerService { * @return */ private String intervalTemp(Map week, String code,boolean flag) { - if(MapUtils.isEmpty(week) || !week.containsKey(code)){ + if(MapUtils.isEmpty(week) || !week.containsKey(code) || ObjectUtil.isEmpty(week.get(code))){ return "21"; } if(flag){ From e8d1be1e77e01cba5ba66dabbdfbf80fb0835e58 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 4 Sep 2023 17:09:19 +0800 Subject: [PATCH 6/6] =?UTF-8?q?#=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/station/service/impl/StationServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 21d2d28..9e1a89f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -2,10 +2,8 @@ package com.hnac.hzims.operational.station.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hnac.hzims.common.service.UserAuthDataService; import com.hnac.hzims.fdp.feign.IQuestionClient; import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.main.constant.HomePageConstant; @@ -64,7 +62,6 @@ import java.util.stream.Collectors; public class StationServiceImpl extends BaseServiceImpl implements IStationService { private final ISysClient sysClient; private final IDeptClient deptClient; - private final UserAuthDataService userAuthDataService; private final IUserClient userClient; private final ProjectClient projectClient; private final BladeLogger logger; @@ -531,7 +528,7 @@ public class StationServiceImpl extends BaseServiceImpl()); + refDepList = this.getStationDeptList(authList, types,dept.getId(), new ArrayList<>()); } // 获取水利站点(过滤其他站点类型) return this.getWaterList(refDepList, types, servrType,make);