当前位置:网站首页>internship:改了需求
internship:改了需求
2022-08-04 18:52:00 【ahyo】
需求的更改总算是彻底结束了…
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() + "小里程" + 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 后续改为真实预警数据
res.put("alarm", 0);
res.put("xAxis", xAxis);
res.put("values", values);
return res;
}
进行功能优化更新 会对原有接口进行代码更改 值得注意的一点是 要与原有接口json数据结构对应起来 这也是和前端在交互的时候需要特别注意的还有字段名称此类。
边栏推荐
猜你喜欢
随机推荐
The CPU suddenly soars and the system responds slowly, what is the cause?Is there any way to check?
SAP UI5 视图控制器 View Controller 的生命周期方法 - Lifecycle methods
八一建军节 | 致敬中国人民解放军
mq消息积压怎么对应
win10 uwp DataContext
路由懒加载
win10 uwp 使用 Geometry resources 在 xaml
ACP-Cloud Computing By Wakin自用笔记(2)CPU和内存虚拟化
win10 uwp xaml 绑定接口
阿里云国际版使用ROS搭建WordPress教程
LVS+Keepalived群集
C#爬虫之通过Selenium获取浏览器请求响应结果
Google AppSheet: 无需编程构建零代码应用
火灾报警联网FC18中CAN光端机常见问题解答和使用指导
A group of friends asked for help, but the needs that were not solved in a week were solved in 3 minutes?
Redis数据库—定义、特点、安装、如何启动与停止
How does the intelligent video surveillance platform EasyCVR use the interface to export iframe addresses in batches?
路由技术
如何让 JS 代码不可断点
vantui 组件 van-field 路由切换时,字体样式混乱问题









