From a8045dc76c621e029bcd8877c07cc4d69d90e135 Mon Sep 17 00:00:00 2001
From: liyansheng <1761724207@qq.com>
Date: Mon, 29 Apr 2024 19:49:30 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=89=93?=
=?UTF-8?q?=E5=8C=85=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 40b2d6c..bc51610 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,8 +5,8 @@
com.cn.travel
travel
- 0.0.1-SNAPSHOT
- war
+ v1
+
travel
Demo project for Spring Boot
--
Gitee
From 225e292b5747f903db51d878300da91e5f2b79ff Mon Sep 17 00:00:00 2001
From: liyansheng <1761724207@qq.com>
Date: Mon, 29 Apr 2024 20:13:17 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=8C=87?=
=?UTF-8?q?=E5=AE=9A=E8=BF=9C=E7=A8=8B=E4=BB=93=E5=BA=93=E5=9C=B0=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index bc51610..030289f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -187,7 +187,33 @@
-
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public
+
+ true
+
+
+
+
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public
+
+ true
+
+
+ false
+
+
+
+
+
+
--
Gitee
From 810dd3937f813bc13c197b397ce27164ce72ffb9 Mon Sep 17 00:00:00 2001
From: liyansheng <1761724207@qq.com>
Date: Tue, 30 Apr 2024 23:04:23 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=99=AF?=
=?UTF-8?q?=E7=82=B9=E8=AE=A2=E5=8D=95=E5=8D=A0=E6=AF=94?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/cn/travel/base/entity/Item.java | 24 +++
.../cn/travel/cms/product/dao/ProductDao.java | 13 ++
.../cn/travel/web/manager/DataController.java | 11 ++
.../templates/data/scenicSpotData.html | 142 +++++++++++-------
4 files changed, 138 insertions(+), 52 deletions(-)
create mode 100644 src/main/java/com/cn/travel/base/entity/Item.java
diff --git a/src/main/java/com/cn/travel/base/entity/Item.java b/src/main/java/com/cn/travel/base/entity/Item.java
new file mode 100644
index 0000000..16372bb
--- /dev/null
+++ b/src/main/java/com/cn/travel/base/entity/Item.java
@@ -0,0 +1,24 @@
+package com.cn.travel.base.entity;
+
+public class Item {
+
+ private String name;
+
+ private Integer value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getValue() {
+ return value;
+ }
+
+ public void setValue(Integer value) {
+ this.value = value;
+ }
+}
diff --git a/src/main/java/com/cn/travel/cms/product/dao/ProductDao.java b/src/main/java/com/cn/travel/cms/product/dao/ProductDao.java
index f83de9d..0fa4111 100644
--- a/src/main/java/com/cn/travel/cms/product/dao/ProductDao.java
+++ b/src/main/java/com/cn/travel/cms/product/dao/ProductDao.java
@@ -1,5 +1,6 @@
package com.cn.travel.cms.product.dao;
+import com.cn.travel.base.entity.Item;
import com.cn.travel.cms.product.entity.Product;
import org.apache.ibatis.annotations.*;
@@ -39,4 +40,16 @@ public interface ProductDao {
@Update("update t_product set name=#{name}, description=#{description},image_url=#{imageUrl},price=#{price} where id=#{id} ")
void update(Product product);
+
+ @Select("SELECT s.SPOT_NAME AS name, COUNT(*) AS count " +
+ "FROM t_yw_order tyo " +
+ "JOIN t_product tp ON tyo.product_id = tp.id " +
+ "LEFT JOIN t_cms_scenic_spot s ON s.ID = tp.spot_id " +
+ "GROUP BY tp.spot_id")
+ @Results({
+ @Result(property = "name", column = "name"),
+ @Result(property = "value", column = "count")
+ })
+ List- getProductsCount();
+
}
diff --git a/src/main/java/com/cn/travel/web/manager/DataController.java b/src/main/java/com/cn/travel/web/manager/DataController.java
index 0ab4862..ba17b02 100644
--- a/src/main/java/com/cn/travel/web/manager/DataController.java
+++ b/src/main/java/com/cn/travel/web/manager/DataController.java
@@ -1,9 +1,12 @@
package com.cn.travel.web.manager;
+import com.cn.travel.base.entity.Item;
import com.cn.travel.cms.car.service.imp.CarService;
import com.cn.travel.cms.hotel.service.imp.HotelService;
import com.cn.travel.cms.insurance.service.imp.InsuranceService;
import com.cn.travel.cms.order.service.imp.OrderService;
+import com.cn.travel.cms.product.dao.ProductDao;
+import com.cn.travel.cms.product.entity.Product;
import com.cn.travel.cms.scenicSpot.service.imp.ScenicSpotService;
import com.cn.travel.cms.strategy.service.imp.StrategyService;
import com.cn.travel.cms.travelRoute.service.imp.TravelRouteService;
@@ -14,6 +17,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
+import java.util.List;
+
@Controller
@RequestMapping("/manager")
public class DataController extends BaseController {
@@ -34,6 +39,9 @@ public class DataController extends BaseController {
@Autowired
InsuranceService insuranceService;
+ @Autowired
+ ProductDao productDao;
+
@RequestMapping("/userData")
public ModelAndView userDate()throws Exception{
@@ -63,6 +71,9 @@ public class DataController extends BaseController {
mv.addObject("state0",scenicSpotService.state0count());
mv.addObject("state1",scenicSpotService.state1count());
mv.addObject("state2",scenicSpotService.state2count());
+// 销售量
+ List
- items = productDao.getProductsCount();
+ mv.addObject("items",items);
mv.setViewName("data/scenicSpotData");
return mv;
}
diff --git a/src/main/resources/templates/data/scenicSpotData.html b/src/main/resources/templates/data/scenicSpotData.html
index 8e128c9..540f6fc 100644
--- a/src/main/resources/templates/data/scenicSpotData.html
+++ b/src/main/resources/templates/data/scenicSpotData.html
@@ -1,67 +1,105 @@
+
-
+
首页--晋游天地运营平台
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // 创建一个 echarts 实例,并指定容器
+ var myChart = echarts.init(document.getElementById('pieChart'));
+
+ // 配置项
+ var option = {
+ title: {
+ text: '各景点文创订单占比',
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b}: {c} ({d}%)'
+ },
+ series: [
+ {
+ name: '订单数',
+ type: 'pie',
+ radius: '50%',
+ data: [[${ items }]]
+ }
+ ]
+ };
+
+ // 使用配置项设置图表
+ myChart.setOption(option);
+
+ });
+
+
+
\ No newline at end of file
--
Gitee
From 0a212b3e829edff18be5a6473825ce665f180b22 Mon Sep 17 00:00:00 2001
From: liyansheng <1761724207@qq.com>
Date: Tue, 30 Apr 2024 23:08:16 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E6=95=88=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/resources/templates/data/scenicSpotData.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/templates/data/scenicSpotData.html b/src/main/resources/templates/data/scenicSpotData.html
index 540f6fc..845c383 100644
--- a/src/main/resources/templates/data/scenicSpotData.html
+++ b/src/main/resources/templates/data/scenicSpotData.html
@@ -29,7 +29,7 @@
--
Gitee