瀏覽代碼

客流量

lchao 6 月之前
父節點
當前提交
a95fd1faee

+ 112 - 0
songhua-admin/src/main/java/com/songhua/web/controller/system/ShhTouristFlowOfScenicSpotsController.java

@@ -0,0 +1,112 @@
+package com.songhua.system.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.songhua.common.annotation.Log;
+import com.songhua.common.core.controller.BaseController;
+import com.songhua.common.core.domain.AjaxResult;
+import com.songhua.common.enums.BusinessType;
+import com.songhua.system.domain.ShhTouristFlowOfScenicSpots;
+import com.songhua.system.service.IShhTouristFlowOfScenicSpotsService;
+import com.songhua.common.utils.poi.ExcelUtil;
+import com.songhua.common.core.page.TableDataInfo;
+
+/**
+ * 景区客流量Controller
+ * 
+ * @author ruoyi
+ * @date 2024-12-02
+ */
+@RestController
+@RequestMapping("/system/spots")
+public class ShhTouristFlowOfScenicSpotsController extends BaseController
+{
+    @Autowired
+    private IShhTouristFlowOfScenicSpotsService shhTouristFlowOfScenicSpotsService;
+
+    /**
+     * 查询景区客流量列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        startPage();
+        List<ShhTouristFlowOfScenicSpots> list = shhTouristFlowOfScenicSpotsService.selectShhTouristFlowOfScenicSpotsList(shhTouristFlowOfScenicSpots);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出景区客流量列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:export')")
+    @Log(title = "景区客流量", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        List<ShhTouristFlowOfScenicSpots> list = shhTouristFlowOfScenicSpotsService.selectShhTouristFlowOfScenicSpotsList(shhTouristFlowOfScenicSpots);
+        ExcelUtil<ShhTouristFlowOfScenicSpots> util = new ExcelUtil<ShhTouristFlowOfScenicSpots>(ShhTouristFlowOfScenicSpots.class);
+        util.exportExcel(response, list, "景区客流量数据");
+    }
+
+    /**
+     * 获取景区客流量详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(shhTouristFlowOfScenicSpotsService.selectShhTouristFlowOfScenicSpotsById(id));
+    }
+
+    /**
+     * 新增景区客流量
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:add')")
+    @Log(title = "景区客流量", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        return toAjax(shhTouristFlowOfScenicSpotsService.insertShhTouristFlowOfScenicSpots(shhTouristFlowOfScenicSpots));
+    }
+
+    /**
+     * 修改景区客流量
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:edit')")
+    @Log(title = "景区客流量", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        return toAjax(shhTouristFlowOfScenicSpotsService.updateShhTouristFlowOfScenicSpots(shhTouristFlowOfScenicSpots));
+    }
+
+    /**
+     * 删除景区客流量
+     */
+    @PreAuthorize("@ss.hasPermi('system:spots:remove')")
+    @Log(title = "景区客流量", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(shhTouristFlowOfScenicSpotsService.deleteShhTouristFlowOfScenicSpotsByIds(ids));
+    }
+
+    /**
+     * 查询客流量可视化
+     */
+    @GetMapping("/passengerFlowList")
+    public AjaxResult passengerFlowList() {
+        return success(shhTouristFlowOfScenicSpotsService.passengerFlowList());
+    }
+}

+ 135 - 0
songhua-system/src/main/java/com/songhua/system/domain/ShhTouristFlowOfScenicSpots.java

@@ -0,0 +1,135 @@
+package com.songhua.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+
+/**
+ * 景区客流量对象 shh_tourist_flow_of_scenic_spots
+ * 
+ * @author ruoyi
+ * @date 2024-12-02
+ */
+public class ShhTouristFlowOfScenicSpots extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    private Long id;
+
+    /** 船客流量 */
+    @Excel(name = "船客流量")
+    private String shipGuest;
+
+    /** 观光车客流量 */
+    @Excel(name = "观光车客流量")
+    private String sightseeingCarGuest;
+
+    /** 五虎岛客流量 */
+    @Excel(name = "五虎岛客流量")
+    private String wuhuIslandGuest;
+
+    /** 西海浪客流量 */
+    @Excel(name = "西海浪客流量")
+    private String seaWaveGuest;
+
+    /** 卧龙潭客流量 */
+    @Excel(name = "卧龙潭客流量")
+    private String wolongLakeGuest;
+
+    /** 景区客流量 */
+    @Excel(name = "景区客流量")
+    private String scenicSpotGuest;
+
+    /** 月份 */
+    @Excel(name = "月份")
+    private String month;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setShipGuest(String shipGuest) 
+    {
+        this.shipGuest = shipGuest;
+    }
+
+    public String getShipGuest() 
+    {
+        return shipGuest;
+    }
+    public void setSightseeingCarGuest(String sightseeingCarGuest) 
+    {
+        this.sightseeingCarGuest = sightseeingCarGuest;
+    }
+
+    public String getSightseeingCarGuest() 
+    {
+        return sightseeingCarGuest;
+    }
+    public void setWuhuIslandGuest(String wuhuIslandGuest) 
+    {
+        this.wuhuIslandGuest = wuhuIslandGuest;
+    }
+
+    public String getWuhuIslandGuest() 
+    {
+        return wuhuIslandGuest;
+    }
+    public void setSeaWaveGuest(String seaWaveGuest) 
+    {
+        this.seaWaveGuest = seaWaveGuest;
+    }
+
+    public String getSeaWaveGuest() 
+    {
+        return seaWaveGuest;
+    }
+    public void setWolongLakeGuest(String wolongLakeGuest) 
+    {
+        this.wolongLakeGuest = wolongLakeGuest;
+    }
+
+    public String getWolongLakeGuest() 
+    {
+        return wolongLakeGuest;
+    }
+    public void setScenicSpotGuest(String scenicSpotGuest) 
+    {
+        this.scenicSpotGuest = scenicSpotGuest;
+    }
+
+    public String getScenicSpotGuest() 
+    {
+        return scenicSpotGuest;
+    }
+    public void setMonth(String month) 
+    {
+        this.month = month;
+    }
+
+    public String getMonth() 
+    {
+        return month;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("shipGuest", getShipGuest())
+            .append("sightseeingCarGuest", getSightseeingCarGuest())
+            .append("wuhuIslandGuest", getWuhuIslandGuest())
+            .append("seaWaveGuest", getSeaWaveGuest())
+            .append("wolongLakeGuest", getWolongLakeGuest())
+            .append("scenicSpotGuest", getScenicSpotGuest())
+            .append("month", getMonth())
+            .toString();
+    }
+}

+ 63 - 0
songhua-system/src/main/java/com/songhua/system/mapper/ShhTouristFlowOfScenicSpotsMapper.java

@@ -0,0 +1,63 @@
+package com.songhua.system.mapper;
+
+import java.util.List;
+import com.songhua.system.domain.ShhTouristFlowOfScenicSpots;
+
+/**
+ * 景区客流量Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-12-02
+ */
+public interface ShhTouristFlowOfScenicSpotsMapper 
+{
+    /**
+     * 查询景区客流量
+     * 
+     * @param id 景区客流量主键
+     * @return 景区客流量
+     */
+    public ShhTouristFlowOfScenicSpots selectShhTouristFlowOfScenicSpotsById(Long id);
+
+    /**
+     * 查询景区客流量列表
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 景区客流量集合
+     */
+    public List<ShhTouristFlowOfScenicSpots> selectShhTouristFlowOfScenicSpotsList(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 新增景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    public int insertShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 修改景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    public int updateShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 删除景区客流量
+     * 
+     * @param id 景区客流量主键
+     * @return 结果
+     */
+    public int deleteShhTouristFlowOfScenicSpotsById(Long id);
+
+    /**
+     * 批量删除景区客流量
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteShhTouristFlowOfScenicSpotsByIds(Long[] ids);
+
+    List<ShhTouristFlowOfScenicSpots> passengerFlowList();
+}

+ 65 - 0
songhua-system/src/main/java/com/songhua/system/service/IShhTouristFlowOfScenicSpotsService.java

@@ -0,0 +1,65 @@
+package com.songhua.system.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.songhua.system.domain.ShhTouristFlowOfScenicSpots;
+
+/**
+ * 景区客流量Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-12-02
+ */
+public interface IShhTouristFlowOfScenicSpotsService 
+{
+    /**
+     * 查询景区客流量
+     * 
+     * @param id 景区客流量主键
+     * @return 景区客流量
+     */
+    public ShhTouristFlowOfScenicSpots selectShhTouristFlowOfScenicSpotsById(Long id);
+
+    /**
+     * 查询景区客流量列表
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 景区客流量集合
+     */
+    public List<ShhTouristFlowOfScenicSpots> selectShhTouristFlowOfScenicSpotsList(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 新增景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    public int insertShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 修改景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    public int updateShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots);
+
+    /**
+     * 批量删除景区客流量
+     * 
+     * @param ids 需要删除的景区客流量主键集合
+     * @return 结果
+     */
+    public int deleteShhTouristFlowOfScenicSpotsByIds(Long[] ids);
+
+    /**
+     * 删除景区客流量信息
+     * 
+     * @param id 景区客流量主键
+     * @return 结果
+     */
+    public int deleteShhTouristFlowOfScenicSpotsById(Long id);
+
+    Map<String,List> passengerFlowList();
+}

+ 111 - 0
songhua-system/src/main/java/com/songhua/system/service/impl/ShhTouristFlowOfScenicSpotsServiceImpl.java

@@ -0,0 +1,111 @@
+package com.songhua.system.service.impl;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.songhua.system.mapper.ShhTouristFlowOfScenicSpotsMapper;
+import com.songhua.system.domain.ShhTouristFlowOfScenicSpots;
+import com.songhua.system.service.IShhTouristFlowOfScenicSpotsService;
+
+/**
+ * 景区客流量Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-12-02
+ */
+@Service
+public class ShhTouristFlowOfScenicSpotsServiceImpl implements IShhTouristFlowOfScenicSpotsService 
+{
+    @Autowired
+    private ShhTouristFlowOfScenicSpotsMapper shhTouristFlowOfScenicSpotsMapper;
+
+    /**
+     * 查询景区客流量
+     * 
+     * @param id 景区客流量主键
+     * @return 景区客流量
+     */
+    @Override
+    public ShhTouristFlowOfScenicSpots selectShhTouristFlowOfScenicSpotsById(Long id)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.selectShhTouristFlowOfScenicSpotsById(id);
+    }
+
+    /**
+     * 查询景区客流量列表
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 景区客流量
+     */
+    @Override
+    public List<ShhTouristFlowOfScenicSpots> selectShhTouristFlowOfScenicSpotsList(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.selectShhTouristFlowOfScenicSpotsList(shhTouristFlowOfScenicSpots);
+    }
+
+    /**
+     * 新增景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    @Override
+    public int insertShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.insertShhTouristFlowOfScenicSpots(shhTouristFlowOfScenicSpots);
+    }
+
+    /**
+     * 修改景区客流量
+     * 
+     * @param shhTouristFlowOfScenicSpots 景区客流量
+     * @return 结果
+     */
+    @Override
+    public int updateShhTouristFlowOfScenicSpots(ShhTouristFlowOfScenicSpots shhTouristFlowOfScenicSpots)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.updateShhTouristFlowOfScenicSpots(shhTouristFlowOfScenicSpots);
+    }
+
+    /**
+     * 批量删除景区客流量
+     * 
+     * @param ids 需要删除的景区客流量主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShhTouristFlowOfScenicSpotsByIds(Long[] ids)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.deleteShhTouristFlowOfScenicSpotsByIds(ids);
+    }
+
+    /**
+     * 删除景区客流量信息
+     * 
+     * @param id 景区客流量主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShhTouristFlowOfScenicSpotsById(Long id)
+    {
+        return shhTouristFlowOfScenicSpotsMapper.deleteShhTouristFlowOfScenicSpotsById(id);
+    }
+
+    @Override
+    public Map<String, List> passengerFlowList() {
+        Map<String, List> map = new HashMap();
+        List<ShhTouristFlowOfScenicSpots> list = shhTouristFlowOfScenicSpotsMapper.passengerFlowList();
+        map.put("labelData", list.stream().map(ShhTouristFlowOfScenicSpots::getMonth).collect(Collectors.toList()));
+        map.put("valueShipGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getShipGuest).collect(Collectors.toList()));
+        map.put("valueSightseeingCarGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getSightseeingCarGuest).collect(Collectors.toList()));
+        map.put("valueWolongLakeGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getWolongLakeGuest).collect(Collectors.toList()));
+        map.put("valueSeaWaveGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getSeaWaveGuest).collect(Collectors.toList()));
+        map.put("valueWuhuIslandGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getWuhuIslandGuest).collect(Collectors.toList()));
+        map.put("valueScenicSpotGuest", list.stream().map(ShhTouristFlowOfScenicSpots::getScenicSpotGuest).collect(Collectors.toList()));
+        return map;
+    }
+}

+ 104 - 0
songhua-system/src/main/resources/mapper/system/ShhTouristFlowOfScenicSpotsMapper.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.songhua.system.mapper.ShhTouristFlowOfScenicSpotsMapper">
+    
+    <resultMap type="ShhTouristFlowOfScenicSpots" id="ShhTouristFlowOfScenicSpotsResult">
+        <result property="id"    column="id"    />
+        <result property="shipGuest"    column="ship_guest"    />
+        <result property="sightseeingCarGuest"    column="sightseeing_car_guest"    />
+        <result property="wuhuIslandGuest"    column="wuhu_Island_guest"    />
+        <result property="seaWaveGuest"    column="sea_wave_guest"    />
+        <result property="wolongLakeGuest"    column="wolong_Lake_guest"    />
+        <result property="scenicSpotGuest"    column="scenic_spot_guest"    />
+        <result property="month"    column="month"    />
+    </resultMap>
+
+    <sql id="selectShhTouristFlowOfScenicSpotsVo">
+        select id, ship_guest, sightseeing_car_guest, wuhu_Island_guest, sea_wave_guest, wolong_Lake_guest, scenic_spot_guest, `month` from shh_tourist_flow_of_scenic_spots
+    </sql>
+
+    <select id="selectShhTouristFlowOfScenicSpotsList" parameterType="ShhTouristFlowOfScenicSpots" resultMap="ShhTouristFlowOfScenicSpotsResult">
+        <include refid="selectShhTouristFlowOfScenicSpotsVo"/>
+        <where>  
+            <if test="shipGuest != null  and shipGuest != ''"> and ship_guest = #{shipGuest}</if>
+            <if test="sightseeingCarGuest != null  and sightseeingCarGuest != ''"> and sightseeing_car_guest = #{sightseeingCarGuest}</if>
+            <if test="wuhuIslandGuest != null  and wuhuIslandGuest != ''"> and wuhu_Island_guest = #{wuhuIslandGuest}</if>
+            <if test="seaWaveGuest != null  and seaWaveGuest != ''"> and sea_wave_guest = #{seaWaveGuest}</if>
+            <if test="wolongLakeGuest != null  and wolongLakeGuest != ''"> and wolong_Lake_guest = #{wolongLakeGuest}</if>
+            <if test="scenicSpotGuest != null  and scenicSpotGuest != ''"> and scenic_spot_guest = #{scenicSpotGuest}</if>
+            <if test="month != null  and month != ''"> and month = #{month}</if>
+        </where>
+    </select>
+    
+    <select id="selectShhTouristFlowOfScenicSpotsById" parameterType="Long" resultMap="ShhTouristFlowOfScenicSpotsResult">
+        <include refid="selectShhTouristFlowOfScenicSpotsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertShhTouristFlowOfScenicSpots" parameterType="ShhTouristFlowOfScenicSpots">
+        insert into shh_tourist_flow_of_scenic_spots
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="shipGuest != null">ship_guest,</if>
+            <if test="sightseeingCarGuest != null">sightseeing_car_guest,</if>
+            <if test="wuhuIslandGuest != null">wuhu_Island_guest,</if>
+            <if test="seaWaveGuest != null">sea_wave_guest,</if>
+            <if test="wolongLakeGuest != null">wolong_Lake_guest,</if>
+            <if test="scenicSpotGuest != null">scenic_spot_guest,</if>
+            <if test="month != null">month,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="shipGuest != null">#{shipGuest},</if>
+            <if test="sightseeingCarGuest != null">#{sightseeingCarGuest},</if>
+            <if test="wuhuIslandGuest != null">#{wuhuIslandGuest},</if>
+            <if test="seaWaveGuest != null">#{seaWaveGuest},</if>
+            <if test="wolongLakeGuest != null">#{wolongLakeGuest},</if>
+            <if test="scenicSpotGuest != null">#{scenicSpotGuest},</if>
+            <if test="month != null">#{month},</if>
+         </trim>
+    </insert>
+
+    <update id="updateShhTouristFlowOfScenicSpots" parameterType="ShhTouristFlowOfScenicSpots">
+        update shh_tourist_flow_of_scenic_spots
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="shipGuest != null">ship_guest = #{shipGuest},</if>
+            <if test="sightseeingCarGuest != null">sightseeing_car_guest = #{sightseeingCarGuest},</if>
+            <if test="wuhuIslandGuest != null">wuhu_Island_guest = #{wuhuIslandGuest},</if>
+            <if test="seaWaveGuest != null">sea_wave_guest = #{seaWaveGuest},</if>
+            <if test="wolongLakeGuest != null">wolong_Lake_guest = #{wolongLakeGuest},</if>
+            <if test="scenicSpotGuest != null">scenic_spot_guest = #{scenicSpotGuest},</if>
+            <if test="month != null">month = #{month},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteShhTouristFlowOfScenicSpotsById" parameterType="Long">
+        delete from shh_tourist_flow_of_scenic_spots where id = #{id}
+    </delete>
+
+    <delete id="deleteShhTouristFlowOfScenicSpotsByIds" parameterType="String">
+        delete from shh_tourist_flow_of_scenic_spots where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="passengerFlowList" parameterType="ShhTouristFlowOfScenicSpots" resultMap="ShhTouristFlowOfScenicSpotsResult">
+        SELECT
+            id,
+            ship_guest,
+            sightseeing_car_guest,
+            wuhu_Island_guest,
+            sea_wave_guest,
+            wolong_Lake_guest,
+            scenic_spot_guest,
+            `month`
+        FROM
+            shh_tourist_flow_of_scenic_spots
+        GROUP BY
+            `month`
+    </select>
+</mapper>

+ 3 - 1
songhua-ui/package.json

@@ -40,14 +40,16 @@
     "axios": "^1.1.3",
     "clipboard": "2.0.8",
     "core-js": "3.25.3",
-    "echarts": "5.4.0",
+    "echarts": "^5.5.1",
     "element-ui": "2.15.14",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
+    "html2canvas": "^1.4.1",
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
+    "jspdf": "^2.5.2",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
     "screenfull": "5.0.2",

+ 51 - 0
songhua-ui/src/api/system/spots.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询景区客流量列表
+export function listSpots(query) {
+  return request({
+    url: '/system/spots/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询景区客流量详细
+export function getSpots(id) {
+  return request({
+    url: '/system/spots/' + id,
+    method: 'get'
+  })
+}
+
+// 新增景区客流量
+export function addSpots(data) {
+  return request({
+    url: '/system/spots',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改景区客流量
+export function updateSpots(data) {
+  return request({
+    url: '/system/spots',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除景区客流量
+export function delSpots(id) {
+  return request({
+    url: '/system/spots/' + id,
+    method: 'delete'
+  })
+}
+//客流量可视化
+export function passengerFlowList() {
+  return request({
+    url: '/system/spots/passengerFlowList',
+    method: 'get',
+  })
+}

+ 6 - 0
songhua-ui/src/router/index.js

@@ -41,6 +41,12 @@ export const constantRoutes = [
       }
     ]
   },
+
+  {
+    path: '/VisitorFlowChart',
+    component: () => import('@/views/system/spots/VisitorFlowChart.vue'),
+    hidden: true
+  },
   {
     path: '/login',
     component: () => import('@/views/login'),

+ 245 - 0
songhua-ui/src/views/system/spots/VisitorFlowChart.vue

@@ -0,0 +1,245 @@
+<template>
+  <div style=" height: 100vh; display: grid; place-content: center;">
+    <div style="width: 1000px; " id="echarts-container"></div>
+  </div>
+</template>
+
+<script>
+// import echarts from 'echarts';
+import * as echarts from 'echarts'
+import html2canvas from 'html2canvas';
+import jsPDF from 'jspdf';
+import { passengerFlowList} from "@/api/system/spots";
+export default {
+  data() {
+    return {
+      Public1: {},
+    };
+    // 可根据实际情况添加更多设备列表
+  },
+ created() {
+    this.last1();
+  },
+  methods: {
+    last1() {
+      passengerFlowList().then(response => {
+        this.Public1 = response.data;
+        this.$nextTick(() => {
+          this.initEcharts(this.Public1);
+        });
+      });
+    },
+    initEcharts(val) {
+      let myChart = echarts.init(document.getElementById('echarts-container'));
+      // 从后端数据中获取x轴数据(月份)
+      let xAxisData = val.labelData;
+      // 从后端数据中获取各种客流量数据
+      let shipGuestData = val.valueShipGuest;
+      let sightseeingCarGuestData = val.valueSightseeingCarGuest;
+      let wuhuIslandGuestData = val.valueWolongLakeGuest;
+      let seaWaveGuestData = val.valueSeaWaveGuest;
+      let wolongLakeGuestData = val.valueWuhuIslandGuest;
+      // 折线图总流量
+      let scenicSpotGuestData = val.valueScenicSpotGuest;
+
+      // 配置Echarts选项
+      let option = {
+        title: {
+          text: '2024年松花湖景区客流量矢量图',
+          left: 'center',
+          textStyle: {
+            fontSize: 30, // 设置字体大小,可根据需要调整数值
+            // color: 'red' // 设置字体颜色,这里设置为蓝色,可替换为你想要的其他颜色
+          }
+        },
+        subtitle: {
+          text: '(单位:万人次)',
+          left: 'center',
+          top: '10%'
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: { // 坐标轴指示器,坐标轴触发有效
+            type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+          }
+        },
+        grid: {
+          left: '2%',
+          right: '4%',
+          bottom: '14%',
+          top: '16%',
+          containLabel: true
+        },
+        xAxis: {
+          data: xAxisData,
+          type: 'category',
+        },
+        yAxis: {
+          splitLine: {show: false},
+          axisLine: {
+            lineStyle: {
+              color: '#ccc'
+            }
+          }
+        },
+        legend: {
+          top: '95%',
+          left: 'center',
+          orient: 'horizontal'
+        },
+        series: [
+          {
+            name: '船客流量',
+            type: 'bar',
+            barWidth: 15,
+            data: shipGuestData,
+            itemStyle: {
+              normal: {
+                color: "red",
+                label: {
+                  show: true,
+                  textStyle: {
+                    color: '#ccc'
+                  },
+                  position: "inside",
+                  formatter: function(p) {
+                    return p.value > 0 ? (p.value) : '';
+                  }
+                }
+              }
+            },
+          },
+          {
+            name: '观光车客流量',
+            type: 'bar',
+            barWidth: 15,
+            data: sightseeingCarGuestData,
+            itemStyle: {
+              normal: {
+                color: 'yellow',
+                label: {
+                  show: true,
+                  textStyle: {
+                    color: '#ccc'
+                  },
+                  position: "inside",
+                  formatter: function(p) {
+                    return p.value > 0 ? (p.value) : '';
+                  }
+                }
+              }
+            },
+          },
+          {
+            name: '五虎岛客流量',
+            type: 'bar',
+            barWidth: 15,
+            data: wuhuIslandGuestData,
+            itemStyle: {
+              normal: {
+                color: "green",
+                label: {
+                  show: true,
+                  textStyle: {
+                    color: '#ccc'
+                  },
+                  position: "inside",
+                  formatter: function(p) {
+                    return p.value > 0 ? (p.value) : '';
+                  }
+                }
+              }
+            },
+          },
+          {
+            name: '西海浪客流量',
+            type: 'bar',
+            barWidth: 15,
+            data: seaWaveGuestData,
+            itemStyle: {
+              normal: {
+                color: "blue",
+                label: {
+                  show: true,
+                  textStyle: {
+                    color: '#ccc'
+                  },
+                  position: "inside",
+                  formatter: function(p) {
+                    return p.value > 0 ? (p.value) : '';
+                  }
+                }
+              }
+            },
+          },
+          {
+            name: '卧龙潭客流量',
+            type: 'bar',
+            barWidth: 15,
+            data: wolongLakeGuestData,
+            itemStyle: {
+              normal: {
+                color: "purple",
+                label: {
+                  show: true,
+                  textStyle: {
+                    color: '#ccc'
+                  },
+                  position: "inside",
+                  formatter: function(p) {
+                    return p.value > 0 ? (p.value) : '';
+                  }
+                }
+              }
+            },
+          },
+
+          {
+            name: "总客流量",
+            type: "line",
+            symbolSize: 10,
+            symbol: 'circle',
+            itemStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: '#0000ff'
+                }, {
+                  offset: 1,
+                  color: '#00ffff'
+                }]),
+                barBorderRadius: 0,
+                label: {
+                  show: true,
+                  position: "top",
+                  formatter: function (p) {
+                    console.log("======================",p)
+                    return p.value > 0 ? (p.name+p.seriesName+p.value+"万人次") : '';
+                  }
+                }
+              }
+            },
+            data: scenicSpotGuestData
+          },
+        ]
+      };
+      myChart.setOption(option);
+    },
+    downloadChart() {
+      html2canvas(document.querySelector('#echarts-container')).then(canvas => {
+        let imgData = canvas.toDataURL('image/png');
+        let pdf = new jsPDF();
+        pdf.addImage(imgData, 'PNG', 0, 0);
+        pdf.save('visitor_flow_chart.jpg');
+      });
+    }
+  }
+};
+</script>
+
+<style>
+#echarts-container {
+  width: 100%;
+  height: 400px;
+}
+</style>

+ 284 - 0
songhua-ui/src/views/system/spots/index.vue

@@ -0,0 +1,284 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="月份" prop="month">
+        <el-input
+          v-model="queryParams.month"
+          placeholder="请输入月份"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:spots:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:spots:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:spots:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:spots:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="spotsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+<!--      <el-table-column label="主键id" align="center" prop="id" />-->
+      <el-table-column label="船客流量" align="center" prop="shipGuest" />
+      <el-table-column label="观光车客流量" align="center" prop="sightseeingCarGuest" />
+      <el-table-column label="五虎岛客流量" align="center" prop="wuhuIslandGuest" />
+      <el-table-column label="西海浪客流量" align="center" prop="seaWaveGuest" />
+      <el-table-column label="卧龙潭客流量" align="center" prop="wolongLakeGuest" />
+      <el-table-column label="总客流量" align="center" prop="scenicSpotGuest" />
+      <el-table-column label="月份" align="center" prop="month" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:spots:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:spots:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改景区客流量对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="船客流量" prop="shipGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.shipGuest" placeholder="请输入船客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="观光车客流量" prop="sightseeingCarGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.sightseeingCarGuest" placeholder="请输入观光车客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="五虎岛客流量" prop="wuhuIslandGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.wuhuIslandGuest" placeholder="请输入五虎岛客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="西海浪客流量" prop="seaWaveGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.seaWaveGuest" placeholder="请输入西海浪客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="卧龙潭客流量" prop="wolongLakeGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.wolongLakeGuest" placeholder="请输入卧龙潭客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="总客流量" prop="scenicSpotGuest">
+          <el-input-number :min="0" :max="1000000" v-model="form.scenicSpotGuest" placeholder="请输入景区客流量" maxlength="10"/>
+        </el-form-item>
+        <el-form-item label="月份" prop="month">
+          <el-input v-model="form.month" placeholder="请输入月份" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSpots, getSpots, delSpots, addSpots, updateSpots } from "@/api/system/spots";
+
+export default {
+  name: "Spots",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 景区客流量表格数据
+      spotsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        shipGuest: null,
+        sightseeingCarGuest: null,
+        wuhuIslandGuest: null,
+        seaWaveGuest: null,
+        wolongLakeGuest: null,
+        scenicSpotGuest: null,
+        month: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        shipGuest: [
+          { required: true, message: "船客流量不能为空", trigger: "change" },
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询景区客流量列表 */
+    getList() {
+      this.loading = true;
+      listSpots(this.queryParams).then(response => {
+        this.spotsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        shipGuest: null,
+        sightseeingCarGuest: null,
+        wuhuIslandGuest: null,
+        seaWaveGuest: null,
+        wolongLakeGuest: null,
+        scenicSpotGuest: null,
+        month: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加景区客流量";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getSpots(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改景区客流量";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateSpots(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSpots(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除景区客流量编号为"' + ids + '"的数据项?').then(function() {
+        return delSpots(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/spots/export', {
+        ...this.queryParams
+      }, `spots_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>