Compare commits
No commits in common. "20e91b50d47f042ca6af21413c32233cd8ee932b" and "1c563154e20583496b252e6e54ecc1a84d45c562" have entirely different histories.
20e91b50d4
...
1c563154e2
|
@ -60,4 +60,3 @@ nbdist/
|
|||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
||||
|
|
|
@ -177,8 +177,6 @@
|
|||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
|
@ -64,11 +64,7 @@
|
|||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
<!--thymeleaf启动器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
package com.ruoyi.web.controller.chart;
|
||||
|
||||
import com.ruoyi.app.system.domain.ChatDomain;
|
||||
import com.ruoyi.app.system.mapper.ChatMapper;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@Anonymous
|
||||
@RequestMapping("/chat")
|
||||
public class chat {
|
||||
|
||||
@Resource
|
||||
private ChatMapper chatMapper;
|
||||
|
||||
|
||||
@GetMapping("/PolylineChat")
|
||||
// @ResponseBody
|
||||
public String Polyline(Model model){
|
||||
List<ChatDomain> dataList = chatMapper.pyline();
|
||||
List<BigDecimal> moneyList = new ArrayList<>();
|
||||
List<Integer> monthList = new ArrayList<>();
|
||||
for (ChatDomain chatDomain:dataList){
|
||||
moneyList.add(chatDomain.getTotal_money());
|
||||
monthList.add(chatDomain.getMonth());
|
||||
}
|
||||
model.addAttribute("moneyList",moneyList);
|
||||
model.addAttribute("monthList",monthList);
|
||||
return "/polyline";
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ spring:
|
|||
master:
|
||||
url: jdbc:mysql://localhost:3306/jizhang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: 336699
|
||||
password: jieyi123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
@ -60,18 +60,11 @@ spring:
|
|||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 20MB
|
||||
thymeleaf:
|
||||
cache: false
|
||||
prefix: classpath:/templates/
|
||||
encoding: UTF-8 #编码
|
||||
suffix: .html #模板后缀
|
||||
mode: HTML #模板
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Line Chart</title>
|
||||
<style>
|
||||
canvas {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="line-chart" width="400" height="300"></canvas>
|
||||
|
||||
<script src="
|
||||
https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js
|
||||
"></script>
|
||||
<script th:inline="javascript">
|
||||
// 获取 canvas 元素
|
||||
var myChart = echarts.init(document.getElementById("line-chart"));
|
||||
|
||||
// 定义从后端传递过来的数据
|
||||
var monthList = /*[[${monthList}]]*/ [];
|
||||
var moneyList = /*[[${moneyList}]]*/ [];
|
||||
|
||||
// 指定图表的配置项和数据
|
||||
option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: monthList // 使用从后端传递过来的月份数据
|
||||
},
|
||||
yAxis: {},
|
||||
series: [
|
||||
{
|
||||
data: moneyList, // 使用从后端传递过来的金额数据
|
||||
type: 'line'
|
||||
}
|
||||
]
|
||||
};
|
||||
// 使用刚指定的配置项和数据显示图表。
|
||||
myChart.setOption(option);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -24,6 +24,5 @@
|
|||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
package com.ruoyi.app.system.domain;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
public class ChatDomain {
|
||||
private Integer id;
|
||||
|
||||
private BigDecimal total_money;
|
||||
|
||||
private Integer month;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal_money() {
|
||||
return total_money;
|
||||
}
|
||||
|
||||
public void setTotal_money(BigDecimal total_money) {
|
||||
this.total_money = total_money;
|
||||
}
|
||||
|
||||
public Integer getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(Integer month) {
|
||||
this.month = month;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.ruoyi.app.system.mapper;
|
||||
|
||||
import com.ruoyi.app.system.domain.ChatDomain;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface ChatMapper {
|
||||
|
||||
@Select("SELECT SUM(money) AS total_money, month \n" +
|
||||
"FROM accounttb \n" +
|
||||
"WHERE `month` IS NOT NULL\n" +
|
||||
"GROUP BY month \n" +
|
||||
"ORDER BY month;\n")
|
||||
public List<ChatDomain> pyline();
|
||||
}
|
Loading…
Reference in New Issue