Browse Source

fix--视频督察地图涉及人数对齐、设置默认值

master
buaixuexideshitongxue 1 month ago
parent
commit
61d5a13bca
  1. 18
      src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java
  2. 25
      src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java

18
src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java

@ -172,15 +172,15 @@ public class DataVVideoSuperviseController {
List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getVideoSuperviseMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
List<EchartsVo> list = negativeMapper.selectRelativePer(beginTime,endTime);
videoSuperviseMapIconVoList.forEach(s->{
List<EchartsVo> echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList();
if(!echartsVoList.isEmpty()){
int relativePer = echartsVoList.get(0).getValue();
s.setRelativePer(relativePer);
}
});
videoSuperviseMapIconVoList.forEach(VideoSuperviseMapIconVo::initDefaultIfNull);
// List<EchartsVo> list = negativeMapper.selectRelativePer(beginTime,endTime);
// videoSuperviseMapIconVoList.forEach(s->{
// List<EchartsVo> echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList();
// if(!echartsVoList.isEmpty()){
// int relativePer = echartsVoList.get(0).getValue();
// s.setRelativePer(relativePer);
// }
// });
JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
return Result.success(data);
}

25
src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -15,13 +16,35 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@Builder
public class VideoSuperviseMapIconVo {
@Schema(description = "二级名称")
private String name;
@Schema(description = "单位代码")
private String departId;
@Schema(description = "查实问题数")
private Integer discoverProblem;
@Schema(description = "办结问题数")
private Integer completionProblem;
@Schema(description = "涉及单位数")
private Integer relativeOrg;
@Schema(description = "涉及人数")
private Integer relativePer;
private Integer completionRate;
public void initDefaultIfNull(){
this.discoverProblem = this.discoverProblem == null ? 0 : this.discoverProblem;
this.completionProblem = this.completionProblem == null ? 0 : this.completionProblem;
this.relativeOrg = this.relativeOrg == null ? 0 : this.relativeOrg;
this.relativePer = this.relativePer == null ? 0 : this.relativePer;
this.completionRate = this.completionRate == null ? 0 : this.completionRate;
}
}

Loading…
Cancel
Save