Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
aroad_aqsc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
许言琪
aroad_aqsc
Commits
6c3d9c8c
提交
6c3d9c8c
authored
3月 14, 2019
作者:
张龙发
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
技术等级情况柱状图代码提交
上级
acdd7cf2
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
91 行增加
和
1 行删除
+91
-1
ZhtjGljsdjqkController.java
.../aroad/module/zhtj/controller/ZhtjGljsdjqkController.java
+12
-0
ZhtjGljsdjqkService.java
...galaxy/aroad/module/zhtj/service/ZhtjGljsdjqkService.java
+7
-1
ZhtjGljsdjqkServiceImpl.java
...oad/module/zhtj/service/impl/ZhtjGljsdjqkServiceImpl.java
+72
-0
没有找到文件。
src/main/java/com/elephant/framework/galaxy/aroad/module/zhtj/controller/ZhtjGljsdjqkController.java
浏览文件 @
6c3d9c8c
...
...
@@ -79,4 +79,16 @@ public class ZhtjGljsdjqkController extends BaseController {
return
new
R
<>(
zhtjGljsdjqkService
.
removeById
(
id
));
}
/**
* 公路技术等级情况Echarts信息
* @param year 年份
* @return
*/
@GetMapping
(
"/chartinfo"
)
public
R
getZhtjGljsdjqkztqkChartInfo
(
String
year
,
String
type
)
{
System
.
out
.
print
(
"year :"
+
year
+
", type: "
+
type
);
year
=
"2017"
;
type
=
"1"
;
return
new
R
<>(
zhtjGljsdjqkService
.
getZhtjGljsdjqkztqkEchartData
(
year
,
type
));
}
}
src/main/java/com/elephant/framework/galaxy/aroad/module/zhtj/service/ZhtjGljsdjqkService.java
浏览文件 @
6c3d9c8c
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
zhtj
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.elephant.framework.galaxy.aroad.module.system.vo.echarts.BarEchartsVo
;
import
com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjGljsdjqk
;
/**
...
...
@@ -10,5 +11,10 @@ import com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjGljsdjqk;
* @date 2019-03-11 17:24:55
*/
public
interface
ZhtjGljsdjqkService
extends
IService
<
ZhtjGljsdjqk
>
{
/**
* 根据年份查询公路通车/养护里程列表
*
* @return Echarts格式数据
*/
BarEchartsVo
getZhtjGljsdjqkztqkEchartData
(
String
year
,
String
type
);
}
src/main/java/com/elephant/framework/galaxy/aroad/module/zhtj/service/impl/ZhtjGljsdjqkServiceImpl.java
浏览文件 @
6c3d9c8c
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
zhtj
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.elephant.framework.galaxy.aroad.module.system.vo.echarts.BarEchartsVo
;
import
com.elephant.framework.galaxy.aroad.module.system.vo.echarts.BarSeriesVo
;
import
com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjGljsdjqk
;
import
com.elephant.framework.galaxy.aroad.module.zhtj.mapper.ZhtjGljsdjqkMapper
;
import
com.elephant.framework.galaxy.aroad.module.zhtj.service.ZhtjGljsdjqkService
;
import
lombok.AllArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* 综合统计_公路技术等级情况
*
...
...
@@ -13,6 +22,69 @@ import org.springframework.stereotype.Service;
* @date 2019-03-11 17:24:55
*/
@Service
@AllArgsConstructor
public
class
ZhtjGljsdjqkServiceImpl
extends
ServiceImpl
<
ZhtjGljsdjqkMapper
,
ZhtjGljsdjqk
>
implements
ZhtjGljsdjqkService
{
private
final
ZhtjGljsdjqkMapper
zgtjgljsdjqkMapper
;
/**
* 根据年份查询公路通车/养护里程列表
*
* @return Echarts格式数据
*/
@Override
public
BarEchartsVo
getZhtjGljsdjqkztqkEchartData
(
String
year
,
String
type
)
{
BarEchartsVo
echartsVo
=
new
BarEchartsVo
();
List
<
ZhtjGljsdjqk
>
dataList
=
zgtjgljsdjqkMapper
.
selectList
(
Wrappers
.<
ZhtjGljsdjqk
>
query
().
lambda
().
eq
(
ZhtjGljsdjqk:
:
getYear
,
year
).
eq
(
ZhtjGljsdjqk:
:
getType
,
type
));
echartsVo
.
setTitle
(
"各市技术等级情况图"
);
echartsVo
.
setSubTitle
(
"计量单位:公里"
);
List
<
String
>
legend
=
new
ArrayList
<>(
Arrays
.
asList
(
"高速"
,
"一级"
,
"二级"
,
"三级"
,
"四级"
,
"等外"
));
echartsVo
.
setLegendData
(
legend
);
List
<
String
>
xAxis
=
new
ArrayList
<>();
List
<
BarSeriesVo
>
series
=
new
ArrayList
<>();
for
(
String
leg
:
legend
)
{
BarSeriesVo
barSeriesVo
=
new
BarSeriesVo
();
barSeriesVo
.
setName
(
leg
);
barSeriesVo
.
setType
(
"bar"
);
barSeriesVo
.
setStack
(
"总量"
);
JSONObject
json
=
new
JSONObject
();
JSONObject
json_in
=
new
JSONObject
();
json_in
.
put
(
"show"
,
false
);
json_in
.
put
(
"position"
,
"insideRight"
);
json
.
put
(
"normal"
,
json_in
);
barSeriesVo
.
setLabel
(
json
);
List
<
Double
>
data
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
dataList
.
size
();
i
++)
{
ZhtjGljsdjqk
temp
=
dataList
.
get
(
i
);
if
(
"合计"
.
equals
(
temp
.
getArea
())){
continue
;
}
if
(
xAxis
.
size
()<
17
){
xAxis
.
add
(
temp
.
getArea
());
}
if
(
"高速"
.
equals
(
leg
)){
data
.
add
(
temp
.
getHighRoad
());
}
else
if
(
"一级"
.
equals
(
leg
))
{
data
.
add
(
temp
.
getFirstRoad
());
}
else
if
(
"二级"
.
equals
(
leg
))
{
data
.
add
(
temp
.
getSecondRoad
());
}
else
if
(
"三级"
.
equals
(
leg
))
{
data
.
add
(
temp
.
getThreeRoad
());
}
else
if
(
"四级"
.
equals
(
leg
))
{
data
.
add
(
temp
.
getFourRoad
());
}
else
if
(
"等外"
.
equals
(
leg
))
{
data
.
add
(
temp
.
getOtherRoad
());
}
barSeriesVo
.
setData
(
data
);
}
series
.
add
(
barSeriesVo
);
}
echartsVo
.
setXAxisData
(
xAxis
);
echartsVo
.
setSeries
(
series
);
return
echartsVo
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论