jacksenma 7 éve
szülő
commit
08f7590865

+ 4 - 0
src/main/resources/static/css/adminStatistic.css

@@ -0,0 +1,4 @@
+.table-container {
+    width: 100%;
+    height:400px;
+}

+ 71 - 0
src/main/resources/static/js/adminCinemaStatistic.js

@@ -0,0 +1,71 @@
+$(document).ready(function() {
+
+
+    getScheduleRate();
+
+    function getScheduleRate() {
+
+        getRequest(
+            '/statistics/scheduleRate',
+            function (res) {
+                var data = res.content;
+                console.log(data);
+                var option = {
+                    title : {
+                        text: '南丁格尔玫瑰图',
+                        subtext: '纯属虚构',
+                        x:'center'
+                    },
+                    tooltip : {
+                        trigger: 'item',
+                        formatter: "{a} <br/>{b} : {c} ({d}%)"
+                    },
+                    legend: {
+                        x : 'center',
+                        y : 'bottom',
+                        data:['rose1','rose2','rose3','rose4','rose5','rose6','rose7','rose8']
+                    },
+                    toolbox: {
+                        show : true,
+                        feature : {
+                            mark : {show: true},
+                            dataView : {show: true, readOnly: false},
+                            magicType : {
+                                show: true,
+                                type: ['pie', 'funnel']
+                            },
+                            restore : {show: true},
+                            saveAsImage : {show: true}
+                        }
+                    },
+                    calculable : true,
+                    series : [
+                        {
+                            name:'面积模式',
+                            type:'pie',
+                            radius : [30, 110],
+                            center : ['75%', '50%'],
+                            roseType : 'area',
+                            data:[
+                                {value:10, name:'rose1'},
+                                {value:5, name:'rose2'},
+                                {value:15, name:'rose3'},
+                                {value:25, name:'rose4'},
+                                {value:20, name:'rose5'},
+                                {value:35, name:'rose6'},
+                                {value:30, name:'rose7'},
+                                {value:40, name:'rose8'}
+                            ]
+                        }
+                    ]
+                };
+                var scheduleRateChart = echarts.init($("#schedule-rate-container")[0]);
+                scheduleRateChart.setOption(option);
+            },
+            function (error) {
+                alert(JSON.stringify(error));
+            }
+        );
+    }
+
+});

+ 7 - 0
src/main/resources/templates/adminCinemaStatistic.html

@@ -6,10 +6,15 @@
     <link rel="stylesheet" type="text/css" href="/css/common.css"/>
     <link rel="stylesheet" type="text/css" href="/css/bootstrap.css"/>
     <link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css"/>
+    <link rel="stylesheet" type="text/css" href="/css/adminStatistic.css"/>
+
 
     <script src="/js/jquery.js"></script>
     <script src="/js/bootstrap.js"></script>
     <script src="/js/request.js"></script>
+    <script src="/js/echarts.js"></script>
+    <script src="/js/adminCinemaStatistic.js"></script>
+
 </head>
 <body>
 <div class="main-container">
@@ -30,7 +35,9 @@
         <div class="content-header">
             <span class="title gray-text">影院统计</span>
         </div>
+        <div class="card table-container" id="schedule-rate-container">
 
+        </div>
     </div>
 </div>
 </body>

BIN
target/classes/com/example/cinema/bl/ScheduleService.class


BIN
target/classes/com/example/cinema/controller/ScheduleController.class


BIN
target/classes/com/example/cinema/data/ScheduleMapper.class


+ 0 - 92
target/classes/com/example/cinema/data/ScheduleMapper.xml

@@ -1,92 +0,0 @@
-<?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.example.cinema.data.ScheduleMapper">
-    <insert id="insertOneSchedule" parameterType="com.example.cinema.vo.ScheduleForm"
-            useGeneratedKeys="true" keyProperty="id">
-        insert into schedule(hall_id, movie_id, start_time, end_time, fare)
-        values(#{hallId}, #{movieId}, #{startTime}, #{endTime}, #{fare})
-    </insert>
-
-    <select id="selectSchedule" resultMap="ScheduleItem">
-        select * from
-          (select * from schedule where hall_id = #{hallId} and start_time between #{startDate} and #{endDate}) s,
-          (select name as movie_name, id as movie_id from movie) m,
-          (select name as hall_name, id as hall_id from hall) h
-            where s.movie_id = m.movie_id and s.hall_id = h.hall_id
-    </select>
-
-    <select id="selectScheduleConflictByHallIdAndTime" resultMap="ScheduleItem">
-      select * from schedule
-        where hall_id = #{hallId}
-          <if test="#{id} != null">
-              and id != #{id}
-          </if>
-          and ((#{startTime} between start_time and end_time)
-          or (#{endTime} between start_time and end_time)
-          or (start_time between #{startTime} and #{endTime}))
-    </select>
-
-    <select id="selectScheduleByMovieIdList" resultMap="ScheduleItem" parameterType="java.util.List">
-        select * from schedule where movie_id in
-        <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <insert id="insertOneView" parameterType="com.example.cinema.vo.ScheduleViewForm"
-            useGeneratedKeys="true" keyProperty="id">
-        insert into view(day) values(#{day})
-    </insert>
-
-    <update id="updateOneView" parameterType="com.example.cinema.vo.ScheduleViewForm">
-        update view set day = #{day}
-    </update>
-
-    <select id="selectViewCount" resultType="int">
-      select count(*) as num from view
-    </select>
-
-    <delete id="deleteScheduleBatch" parameterType="java.util.List">
-        delete from schedule where id in
-        <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </delete>
-
-    <select id="selectScheduleBatch" parameterType="java.util.List" resultMap="ScheduleItem">
-        select * from schedule where id in
-        <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="selectView" resultType="int">
-        select day from view limit 1
-    </select>
-
-    <update id="updateScheduleById" parameterType="com.example.cinema.vo.ScheduleForm">
-        update schedule set hall_id = #{hallId}, movie_id = #{movieId}, start_time = #{startTime},
-          end_time = #{endTime}, fare = #{fare}
-          where id = #{id}
-
-    </update>
-
-    <select id="selectScheduleById" resultMap="ScheduleItem">
-        select * from
-          (select * from schedule where id = #{id}) s,
-          (select name as movie_name, id as movie_id from movie) m,
-          (select name as hall_name, id as hall_id from hall) h
-            where s.movie_id = m.movie_id and s.hall_id = h.hall_id
-    </select>
-
-    <resultMap id="ScheduleItem" type="com.example.cinema.vo.ScheduleItem">
-        <id column="id" property="id"></id>
-        <result column="hall_id" property="hallId"></result>
-        <result column="movie_id" property="movieId"></result>
-        <result column="start_time" property="startTime"></result>
-        <result column="end_time" property="endTime"></result>
-        <result column="movie_name" property="movieName"></result>
-        <result column="hall_name" property="hallName"></result>
-    </resultMap>
-
-</mapper>

BIN
target/classes/com/example/cinema/vo/ScheduleForm.class