Browse Source

修改站类 1无节制电站 2流量计电站

遂昌项目
walton 4 months ago
parent
commit
3a434de432
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/ImsDeptController.java
  2. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/ImsDeptServiceImpl.java

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/ImsDeptController.java

@ -95,7 +95,7 @@ public class ImsDeptController {
@ApiLog @ApiLog
@ApiOperation(value = "获取水电站机构树") @ApiOperation(value = "获取水电站机构树")
@GetMapping(value = "/getHydropowerTree") @GetMapping(value = "/getHydropowerTree")
public R<List<DeptTreeVo>> getHydropowerTree(@ApiParam(value="站点类型: 水电、光伏、风电...") Integer stationType,@RequestParam(required = false) Integer serveType) { public R<List<DeptTreeVo>> getHydropowerTree(@ApiParam(value="站点类型: 无节制 流量计") Integer stationType,@RequestParam(required = false) Integer serveType) {
if(ObjectUtil.isEmpty(serveType)){ if(ObjectUtil.isEmpty(serveType)){
return R.data(imsDeptService.getHydropowerTree(stationType,null)); return R.data(imsDeptService.getHydropowerTree(stationType,null));
} }

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

@ -15,6 +15,7 @@ import com.hnac.hzims.operational.station.vo.AreaTypeVo;
import com.hnac.hzims.operational.station.vo.DeptTreeVo; import com.hnac.hzims.operational.station.vo.DeptTreeVo;
import com.hnac.hzims.operational.station.vo.WaterDeptTreeVo; import com.hnac.hzims.operational.station.vo.WaterDeptTreeVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
@ -199,7 +200,7 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity
@Override @Override
public List<DeptTreeVo> getHydropowerTree(Integer stationType, Integer serveType) { public List<DeptTreeVo> getHydropowerTree(Integer stationType, Integer serveType) {
// 获取所有机构 // 获取所有机构
R<List<Dept>> D = sysClient.getDeptByType("200000", null, null); R<List<Dept>> D = sysClient.getDeptByType(AuthUtil.getTenantId(), null, null);
if (!D.isSuccess() || CollectionUtil.isEmpty(D.getData())) { if (!D.isSuccess() || CollectionUtil.isEmpty(D.getData())) {
return null; return null;
} }
@ -210,10 +211,8 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity
} }
// 所有站点 // 所有站点
List<Long> value = D.getData().stream().filter(o -> o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList()); List<Long> value = D.getData().stream().filter(o -> o.getDeptCategory().equals(4)).map(Dept::getId).collect(Collectors.toList());
List<Integer> type = ObjectUtil.isNotEmpty(stationType) ? Collections.singletonList(stationType) : null; List<Integer> type = ObjectUtil.isNotEmpty(stationType) ? Collections.singletonList(stationType) : HomePageConstant.SERVETYPE_LIST;
if (HomePageConstant.WATER_CONSERVANCY.equals(stationType)) {
type = HomePageConstant.waterList;
}
List<StationEntity> stationEntityList = stationService.getStationType(serveType, type, value, true); List<StationEntity> stationEntityList = stationService.getStationType(serveType, type, value, true);
if (CollectionUtil.isEmpty(stationEntityList)) { if (CollectionUtil.isEmpty(stationEntityList)) {
return null; return null;

Loading…
Cancel
Save