|
|
@ -9,6 +9,8 @@ import com.hnac.hzims.common.service.UserAuthDataService; |
|
|
|
import com.hnac.hzims.fdp.feign.IQuestionClient; |
|
|
|
import com.hnac.hzims.fdp.feign.IQuestionClient; |
|
|
|
import com.hnac.hzims.operational.OperationalConstants; |
|
|
|
import com.hnac.hzims.operational.OperationalConstants; |
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
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.main.vo.StationCountVo; |
|
|
|
import com.hnac.hzims.operational.station.StationConstants; |
|
|
|
import com.hnac.hzims.operational.station.StationConstants; |
|
|
|
import com.hnac.hzims.operational.station.dto.StationPushConfigDTO; |
|
|
|
import com.hnac.hzims.operational.station.dto.StationPushConfigDTO; |
|
|
@ -33,7 +35,6 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
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.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
@ -68,6 +69,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
private final ProjectClient projectClient; |
|
|
|
private final ProjectClient projectClient; |
|
|
|
private final BladeLogger logger; |
|
|
|
private final BladeLogger logger; |
|
|
|
private final IQuestionClient questionClient; |
|
|
|
private final IQuestionClient questionClient; |
|
|
|
|
|
|
|
private final UserDeptService userDeptService; |
|
|
|
private final IStationAttributeService stationAttributeService; |
|
|
|
private final IStationAttributeService stationAttributeService; |
|
|
|
private final IStationPushConfigService stationPushConfigService; |
|
|
|
private final IStationPushConfigService stationPushConfigService; |
|
|
|
|
|
|
|
|
|
|
@ -231,6 +233,34 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@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) { |
|
|
|
public List<StationEntity> getInRefDept(List<Long> depeIds, String stationType, List<String> types) { |
|
|
|
return this.baseMapper.selectInRefDept(depeIds, stationType, types); |
|
|
|
return this.baseMapper.selectInRefDept(depeIds, stationType, types); |
|
|
|
} |
|
|
|
} |
|
|
@ -515,7 +545,20 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
* @param list |
|
|
|
* @param list |
|
|
|
* @return |
|
|
|
* @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)) { |
|
|
|
if (null == deptId || CollectionUtil.isEmpty(departList)) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -524,7 +567,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
if (dept.getDeptCategory().equals(4)) { |
|
|
|
if (dept.getDeptCategory().equals(4)) { |
|
|
|
list.add(dept.getId()); |
|
|
|
list.add(dept.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
getStationDeptList(departList, dept.getId(), list); |
|
|
|
getStationDeptList(departList,types, dept.getId(), list); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
return list; |
|
|
|