当前位置:网站首页>Internship: changed the requirements
Internship: changed the requirements
2022-08-04 19:02:00 【ahyo】
The change of requirements is finally over…
public Map<String, Object> peopleStatGraph(Integer tunnelId) {
Map<String, Integer> statMap = peopleStat(tunnelId);
BizTunnel tunnel=tunnelMapper.selectById(tunnelId);
Map<String, Object> res = new LinkedHashMap<>(3);
//横坐标 两端各三个区域
List<String> xAxis = new ArrayList();
//纵坐标 六个区域的人数 分进出口端
List<Integer> values = new ArrayList<>();
if(tunnel.getType()==2) {
for (Duan normal : Duan.values()) {
for (Position position : Position.values()) {
//添加横坐标
xAxis.add(tunnel.getName() + normal.getValue() + position.getValue());
//添加纵坐标
Integer count = statMap.get(normal.getKey() + "_" + position.getKey());
values.add(count == null ? 0 : count);
}
}
}
else
{
for (Duan normally :Duan.values()) {
for (Position position : Position.values()) {
//添加横坐标
if(normally.getValue().equals("进口")) {
xAxis.add(tunnel.getName() + "small mileage" + position.getValue());
//添加纵坐标
Integer count = statMap.get(normally.getKey() + "_" + position.getKey());
values.add(count == null ? 0 : count);
}
else
{
xAxis.add(tunnel.getName() + "大里程" + position.getValue());
//添加纵坐标
Integer count = statMap.get(normally.getKey() + "_" + position.getKey());
values.add(count == null ? 0 : count);
}
}
}
}
//TODO Subsequent to real warning data
res.put("alarm", 0);
res.put("xAxis", xAxis);
res.put("values", values);
return res;
}
Perform functional optimization updates Code changes will be made to the original interface 值得注意的一点是 To interface with the originaljsonThe data structure corresponds This is also the field name that needs special attention when interacting with the front end.
边栏推荐
猜你喜欢
随机推荐
win10 uwp 修改Pivot Header 颜色
直播回顾|7 月 Pulsar 中文开发者与用户组会议
PHP代码审计7—文件上传漏洞
八一建军节 | 致敬中国人民解放军
网络运维管理从基础到实战-自用笔记(1)构建综合园区网、接入互联网
JS: 数组和树的相互转换
ERC721标准与加密猫
Homework 8.3 Thread Synchronization Mutex Condition Variables
ELECTRA:Pre-training Text Encoders as Discriminators Rather Than Generators
【web自动化测试】Playwright快速入门,5分钟上手
ATF中断处理的设计模型
MMDetection 使用示例:从入门到出门
实验室专利书写指南
作业8.3 线程同步互斥机制条件变量
当前最快的实例分割模型:YOLACT 和 YOLACT++
Kubernetes之list-watch机制
Regardless of whether you are a public, professional or non-major class, I have been sorting out the learning route for a long time here, and the learning route I have summarized is not yet rolled up
JS 问号?妙用
零基础做出高端堆叠极环图
【web自动化测试】playwright安装失败怎么办