Browse Source

#视频平台配置功能

zhongwei
yang_shj 7 months ago
parent
commit
07c8c742b7
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  2. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  3. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
  4. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/video/controller/VideoPlatformController.java

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -269,7 +269,6 @@ public class RealTargetServiceImpl implements RealTargetService {
// 水电站站点 // 水电站站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER) .eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
); );
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){
return; return;
@ -1227,9 +1226,6 @@ public class RealTargetServiceImpl implements RealTargetService {
public void loadPowerData(String param, List<Integer> types, Integer serveType, int year) { public void loadPowerData(String param, List<Integer> types, Integer serveType, int year) {
// 站点查询 // 站点查询
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
if (ObjectUtil.isNotEmpty(serveType)) {
eq(StationEntity::getServeType, serveType);
}
if (CollectionUtil.isNotEmpty(types)) { if (CollectionUtil.isNotEmpty(types)) {
in(StationEntity::getType, types); in(StationEntity::getType, types);
} }

21
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -1242,7 +1242,8 @@ public class TargetServiceImpl implements TargetService {
List<PowerMonthVo> powerMonths = generateService.fillPowerMon(station.getCode()); List<PowerMonthVo> powerMonths = generateService.fillPowerMon(station.getCode());
return powerMonths.stream().map(mon->{ return powerMonths.stream().map(mon->{
HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo(); HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo();
detail.setTime(mon.getStrMonth()); Date date = DateUtil.parse(mon.getStrMonth() + " 00:00:00",DateUtil.PATTERN_DATETIME);
detail.setTime(DateUtil.format(date,"yyyy-MM"));
if(MapUtils.isEmpty(powerMap)){ if(MapUtils.isEmpty(powerMap)){
detail.setElectric(Double.valueOf(mon.getPower())); detail.setElectric(Double.valueOf(mon.getPower()));
return detail; return detail;
@ -1264,26 +1265,16 @@ public class TargetServiceImpl implements TargetService {
return powerDays.stream().map(day->{ return powerDays.stream().map(day->{
HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo(); HydropowerTargetDetailVo detail = new HydropowerTargetDetailVo();
detail.setTime(day.getDate()); detail.setTime(day.getDate());
if(CollectionUtil.isEmpty(targets)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
List<HydropowerUnitTargetVo> stationTargets = targets.stream().filter(o->o.getDeptId().equals(station.getRefDept())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(stationTargets)){
detail.setElectric(Double.valueOf(day.getGenerate())); detail.setElectric(Double.valueOf(day.getGenerate()));
if(CollectionUtil.isEmpty(targets)){
return detail; return detail;
} }
List<GenerationPowerVo> generations = stationTargets.get(0).getGenerationPowerVoList(); // 设备指标数据
List<GenerationPowerVo> generations = targets.stream().filter(o-> CollectionUtil.isNotEmpty(o.getGenerationPowerVoList()) && o.getDeptId().equals(station.getRefDept())).flatMap(v -> v.getGenerationPowerVoList().stream()).collect(Collectors.toList());
if(CollectionUtil.isEmpty(generations)){ if(CollectionUtil.isEmpty(generations)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail;
}
List<GenerationPowerVo> dayGenerations = generations.stream().filter(generation -> generation.getDate().equals(day.getDate())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(dayGenerations)){
detail.setElectric(Double.valueOf(day.getGenerate()));
return detail; return detail;
} }
detail.setElectric((double) (day.getGenerate() + dayGenerations.get(0).getGenerate())); detail.setElectric(generations.stream().filter(o->o.getDate().equals(day.getDate())).mapToDouble(GenerationPowerVo::getGenerate).sum());
return detail; return detail;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
}else{ }else{

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java

@ -123,6 +123,8 @@ public class StationVideoTypeController extends BladeController {
return list.size() > 0 ? R.fail(400, "该名称已录入数据,请找到相应记录做修改处理") : R.status(stationVideoTypeService.save(req)); return list.size() > 0 ? R.fail(400, "该名称已录入数据,请找到相应记录做修改处理") : R.status(stationVideoTypeService.save(req));
} }
/** /**
* 修改 代码自定义代号 * 修改 代码自定义代号
*/ */
@ -328,4 +330,28 @@ public class StationVideoTypeController extends BladeController {
return R.data(stationVideoTypeService.getVideoPointByRegion(refDept,regionCode)); return R.data(stationVideoTypeService.getVideoPointByRegion(refDept,regionCode));
} }
@PostMapping("/saveBatch")
@ApiOperationSupport(order = 170)
@ApiOperation(value = "批量保存视频配置记录")
public R saveBatch(@RequestBody List<StationVideoTypeEntity> entitys) {
return R.status(stationVideoTypeService.saveBatch(entitys));
}
@GetMapping ("/checkSaveEntry")
@ApiOperationSupport(order = 180)
@ApiOperation(value = "监查保存记录")
public R checkSaveEntry(@RequestParam(value = "pointCode") String pointCode,
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "name") String name) {
StationVideoTypeEntity entity = stationVideoTypeService.getOne(Wrappers.<StationVideoTypeEntity>lambdaQuery()
.eq(StationVideoTypeEntity::getPointCode,pointCode)
.eq(StationVideoTypeEntity::getStationId,stationId)
.eq(StationVideoTypeEntity::getName,name)
);
if(ObjectUtil.isEmpty(entity)){
return R.data(true);
}
return R.data(false);
}
} }

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/video/controller/VideoPlatformController.java

@ -1,9 +1,9 @@
package com.hnac.hzims.operational.video.controller; package com.hnac.hzims.operational.video.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.common.invalid.Create; import com.hnac.hzims.common.invalid.Create;
import com.hnac.hzims.common.invalid.Update; import com.hnac.hzims.common.invalid.Update;
import com.hnac.hzims.common.support.constants.Order;
import com.hnac.hzims.common.support.utils.Condition; import com.hnac.hzims.common.support.utils.Condition;
import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.video.dto.VideoPlaybackDTO; import com.hnac.hzims.operational.video.dto.VideoPlaybackDTO;
@ -19,13 +19,16 @@ import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; /**
* @author ysj
*/
@RestController @RestController
@Api(value = "视频平台管理",tags = "视频平台管理") @Api(value = "视频平台管理",tags = "视频平台管理")
@RequestMapping("/video/platform") @RequestMapping("/video/platform")
@ -64,12 +67,13 @@ public class VideoPlatformController extends BladeController {
@ApiOperation("查询视频平台列表") @ApiOperation("查询视频平台列表")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@Operate(label = "查询视频平台列表",type = BusinessType.QUERY,ignore = false) @Operate(label = "查询视频平台列表",type = BusinessType.QUERY,ignore = false)
public R<List<VideoPlatformEntity>> list(VideoPlatformEntity req) { public R<IPage<VideoPlatformEntity>> list(Query query, VideoPlatformEntity req) {
HashMap<String, Order> sort = new HashMap<String, Order>() {{ LambdaQueryWrapper<VideoPlatformEntity> queryWrapper = new LambdaQueryWrapper<>();
put("create_time", Order.DESC); queryWrapper.orderByDesc(VideoPlatformEntity::getCreateTime);
}}; if(!StringUtil.isEmpty(req.getName())){
LambdaQueryWrapper<VideoPlatformEntity> queryWrapper = Condition.getQueryWrapper(req, VideoPlatformEntity.class, sort); queryWrapper.like(VideoPlatformEntity::getName,req.getName());
return R.data(videoPlatformService.list(queryWrapper)); }
return R.data(videoPlatformService.page(Condition.getPage(query),queryWrapper));
} }
@DeleteMapping("/remove") @DeleteMapping("/remove")

Loading…
Cancel
Save