Browse Source

Merge remote-tracking branch 'origin/prod'

# Conflicts:
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainWorkBenchServiceImpl.java
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
zhongwei
yang_shj 1 year ago
parent
commit
54896c960e
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaServiceImpl.java
  2. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  3. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java
  4. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java
  5. 49
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

2
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)){ if(CollectionUtil.isNotEmpty(configs)){
List<StationEntity> stations =stationService.list(new LambdaQueryWrapper<StationEntity>(){{ List<StationEntity> stations =stationService.list(new LambdaQueryWrapper<StationEntity>(){{
eq(StationEntity::getType,HomePageConstant.HYDROPOWER); in(StationEntity::getType,types);
eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE); eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE);
}}); }});
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -1594,7 +1594,7 @@ public class HydropowerServiceImpl implements HydropowerService {
* @return * @return
*/ */
private String intervalTemp(Map<String, HeWeatherWeatherDailyResponse> week, String code,boolean flag) { private String intervalTemp(Map<String, HeWeatherWeatherDailyResponse> 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"; return "21";
} }
if(flag){ if(flag){

12
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<HzimsAnalyzeModelStationEntity> getModelStationList() { private List<HzimsAnalyzeModelStationEntity> getModelStationList() {
// 水利站点(All) // 水利站点(All)
List<StationEntity> stationList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, null, null,true); List<StationEntity> stationList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, null, null,false);
if(CollectionUtil.isEmpty(stationList)){ if(CollectionUtil.isEmpty(stationList)){
return null; return null;
} }
@ -827,7 +827,7 @@ public class WaterServiceImpl implements IWaterService {
@Override @Override
public WaterConservancyVo waterConservancy(Long deptId) { public WaterConservancyVo waterConservancy(Long deptId) {
// 查询水利站点 // 查询水利站点
List<StationEntity> stations = stationService.getHomeStationList(deptId, HomePageConstant.waterList, HomePageConstant.HYDROPOWER_SERVETYPE,true); List<StationEntity> stations = stationService.getHomeStationList(deptId, HomePageConstant.waterList, HomePageConstant.HYDROPOWER_SERVETYPE,false);
if (CollectionUtil.isEmpty(stations)) { if (CollectionUtil.isEmpty(stations)) {
return new WaterConservancyVo(); return new WaterConservancyVo();
} }
@ -888,7 +888,7 @@ public class WaterServiceImpl implements IWaterService {
public List<WaterDetailsVo> waterDetails(Long deptId) { public List<WaterDetailsVo> waterDetails(Long deptId) {
// 获取区域map : key-区域机构 value-水利站点集合 // 获取区域map : key-区域机构 value-水利站点集合
// 获取区域或者站点map结构 // 获取区域或者站点map结构
Map<Dept,List<StationEntity>> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,true); Map<Dept,List<StationEntity>> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,false);
if(MapUtils.isEmpty(map)){ if(MapUtils.isEmpty(map)){
return null; return null;
} }
@ -933,7 +933,7 @@ public class WaterServiceImpl implements IWaterService {
@Override @Override
public List<WaterRankingVo> waterUseEleRanking(Long deptId) { public List<WaterRankingVo> waterUseEleRanking(Long deptId) {
// 获取区域map : key-区域机构 value-水利站点集合 // 获取区域map : key-区域机构 value-水利站点集合
Map<Dept,List<StationEntity>> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,true); Map<Dept,List<StationEntity>> map = areaService.areaOrStaion(deptId,HomePageConstant.waterList,false);
if(MapUtils.isEmpty(map)){ if(MapUtils.isEmpty(map)){
return null; return null;
} }
@ -1002,7 +1002,7 @@ public class WaterServiceImpl implements IWaterService {
return null; return null;
} }
// 获取水利站点 // 获取水利站点
List<StationEntity> stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,true); List<StationEntity> stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,false);
if(CollectionUtil.isEmpty(stationList)){ if(CollectionUtil.isEmpty(stationList)){
return null; return null;
} }
@ -1062,7 +1062,7 @@ public class WaterServiceImpl implements IWaterService {
return null; return null;
} }
// 获取水利站点 // 获取水利站点
List<StationEntity> stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,true); List<StationEntity> stationList = stationService.getStationList(R.getData(),deptId,HomePageConstant.waterList,HomePageConstant.HYDROPOWER_SERVETYPE,false);
if(CollectionUtil.isEmpty(stationList)){ if(CollectionUtil.isEmpty(stationList)){
return null; return null;
} }

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java

@ -208,7 +208,7 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity
if(HomePageConstant.WATER_CONSERVANCY.equals(stationType)){ if(HomePageConstant.WATER_CONSERVANCY.equals(stationType)){
type = HomePageConstant.waterList; type = HomePageConstant.waterList;
} }
List<StationEntity> stationEntityList = stationService.getStationType(serveType, type ,value,true); List<StationEntity> stationEntityList = stationService.getStationType(serveType, type ,value,false);
if(CollectionUtil.isEmpty(stationEntityList)){ if(CollectionUtil.isEmpty(stationEntityList)){
return null; return null;
} }
@ -319,21 +319,13 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity
if(!R.isSuccess() || CollectionUtil.isEmpty(R.getData())){ if(!R.isSuccess() || CollectionUtil.isEmpty(R.getData())){
return null; return null;
} }
Dept dept = waterService.getTitleDetp(deptId);
if(ObjectUtil.isEmpty(dept)){
return null;
}
List<Long> paramIdList = this.getParamIdList(R.getData(),dept);
if(CollectionUtil.isEmpty(paramIdList)){
return null;
}
// 所有站点 // 所有站点
List<Long> value = R.getData().stream().filter(o->o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList()); List<Long> value = R.getData().stream().filter(o->o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList());
List<Integer> type = ObjectUtil.isNotEmpty(typeArea) ? Collections.singletonList(typeArea) : null; List<Integer> type = ObjectUtil.isNotEmpty(typeArea) ? Collections.singletonList(typeArea) : null;
if(HomePageConstant.WATER_CONSERVANCY.equals(typeArea)){ if(HomePageConstant.WATER_CONSERVANCY.equals(typeArea)){
type = HomePageConstant.waterList; type = HomePageConstant.waterList;
} }
List<StationEntity> stationEntityList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, type ,value,true); List<StationEntity> stationEntityList = stationService.getStationType(HomePageConstant.HYDROPOWER_SERVETYPE, type ,value,false);
if(CollectionUtil.isEmpty(stationEntityList)){ if(CollectionUtil.isEmpty(stationEntityList)){
return null; return null;
} }
@ -344,8 +336,10 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity
return null; return null;
} }
// 区域级机构获取 // 区域级机构获取
List<Dept> areaList = validList.stream().filter(o->paramIdList.contains(o.getId()) && o.getDeptCategory().equals(3)).collect(Collectors.toList()); if(ObjectUtil.isNotEmpty(deptId)){
return areaList.stream().map(o-> new AreaTypeVo(o.getId(),o.getDeptName())).collect(Collectors.toList()); 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());
} }
/** /**

49
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -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;

Loading…
Cancel
Save