|
|
|
@ -2,13 +2,13 @@ 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; |
|
|
|
|
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.station.dto.StationPushConfigDTO; |
|
|
|
@ -33,7 +33,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
@ -63,11 +62,11 @@ import java.util.stream.Collectors;
|
|
|
|
|
public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEntity> 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; |
|
|
|
|
private final IQuestionClient questionClient; |
|
|
|
|
private final UserDeptService userDeptService; |
|
|
|
|
private final IStationAttributeService stationAttributeService; |
|
|
|
|
private final IStationPushConfigService stationPushConfigService; |
|
|
|
|
|
|
|
|
@ -231,6 +230,34 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean updateById(StationEntity req) { |
|
|
|
|
return super.update(Wrappers.<StationEntity>lambdaUpdate() |
|
|
|
|
.set(StationEntity::getCode, req.getCode()) |
|
|
|
|
.set(StationEntity::getName, req.getName()) |
|
|
|
|
.set(StationEntity::getType, req.getType()) |
|
|
|
|
.set(StationEntity::getCommissionTime, req.getCommissionTime()) |
|
|
|
|
.set(StationEntity::getEnableControl, req.getEnableControl()) |
|
|
|
|
.set(StationEntity::getLgtd, req.getLgtd()) |
|
|
|
|
.set(StationEntity::getLttd, req.getLttd()) |
|
|
|
|
.set(StationEntity::getRefDept, req.getRefDept()) |
|
|
|
|
.set(StationEntity::getAreaCode, req.getAreaCode()) |
|
|
|
|
.set(StationEntity::getRefDomain, req.getRefDomain()) |
|
|
|
|
.set(StationEntity::getRefBasin, req.getRefBasin()) |
|
|
|
|
.set(StationEntity::getRefArea, req.getRefArea()) |
|
|
|
|
.set(StationEntity::getRemark, req.getRemark()) |
|
|
|
|
.set(StationEntity::getPic, req.getPic()) |
|
|
|
|
.set(StationEntity::getContact, req.getContact()) |
|
|
|
|
.set(StationEntity::getContactor, req.getContactor()) |
|
|
|
|
.set(StationEntity::getAddress, req.getAddress()) |
|
|
|
|
.set(StationEntity::getCompany, req.getCompany()) |
|
|
|
|
.set(StationEntity::getCreateDept, req.getCreateDept()) |
|
|
|
|
.set(StationEntity::getServeType, req.getServeType()) |
|
|
|
|
.set(StationEntity::getLimitWaterLevel, req.getLimitWaterLevel()) |
|
|
|
|
.eq(StationEntity::getId, req.getId())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<StationEntity> getInRefDept(List<Long> depeIds, String stationType, List<String> types) { |
|
|
|
|
return this.baseMapper.selectInRefDept(depeIds, stationType, types); |
|
|
|
|
} |
|
|
|
@ -501,7 +528,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
|
|
|
|
|
// 传入机构为区域、省子公司、集团
|
|
|
|
|
} else { |
|
|
|
|
// 递归权限机构获取站点级机构
|
|
|
|
|
refDepList = this.getStationDeptList(authList, dept.getId(), new ArrayList<>()); |
|
|
|
|
refDepList = this.getStationDeptList(authList, types,dept.getId(), new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
// 获取水利站点(过滤其他站点类型)
|
|
|
|
|
return this.getWaterList(refDepList, types, servrType,make); |
|
|
|
@ -515,7 +542,20 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
|
|
|
|
|
* @param list |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<Long> getStationDeptList(List<Dept> departList, Long deptId, List<Long> list) { |
|
|
|
|
private List<Long> getStationDeptList(List<Dept> departList, List<Integer> types,Long deptId, List<Long> list) { |
|
|
|
|
List<UserDeptEntity> configs = userDeptService.list(new LambdaQueryWrapper<UserDeptEntity>(){{ |
|
|
|
|
eq(UserDeptEntity::getUserId, AuthUtil.getUserId()); |
|
|
|
|
}}); |
|
|
|
|
if(CollectionUtil.isNotEmpty(configs)){ |
|
|
|
|
List<StationEntity> stations =this.list(new LambdaQueryWrapper<StationEntity>(){{ |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
@ -524,7 +564,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
|
|
|
|
|
if (dept.getDeptCategory().equals(4)) { |
|
|
|
|
list.add(dept.getId()); |
|
|
|
|
} |
|
|
|
|
getStationDeptList(departList, dept.getId(), list); |
|
|
|
|
getStationDeptList(departList,types, dept.getId(), list); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return list; |
|
|
|
|