Browse Source

修改 用地统计功能完善

huZhiHao 5 năm trước cách đây
mục cha
commit
dc63baa005

+ 1 - 0
src/main/java/platform/modules/company/dao/StockLandDao.java

@@ -58,6 +58,7 @@ public interface StockLandDao extends BaseMapper<StockLand>{
 	Integer insertAutoEasyProcessDataToStockLand(@Param("applyid") String applyid);
 
 	Integer updateEasyProcessData(@Param("applyNoList") List<String> applyNoList);
+
 	List<StockLandStatistic> findListByStreetId(@Param("street_id") String street_id, @Param("apply_user_type") Integer applyUserType);
 
 	List<StockLandStatistic> findListByStreetIdAndTime(@Param("street_id") String street_id, @Param("start_time") String startTime ,@Param("end_time") String endTime);

+ 6 - 5
src/main/java/platform/modules/government/service/LandStatisticsService.java

@@ -154,6 +154,7 @@ public class LandStatisticsService {
         map.put("pending", pending);
         map.put("processing", processing);
         map.put("processed", processed);
+
         return map;
     }
 
@@ -1028,12 +1029,12 @@ public class LandStatisticsService {
         int[] applyNum = new int[mounthCount], passNum = new int[mounthCount], notPassNum = new int[mounthCount], rejectNum = new int[mounthCount];
         for (int i = 0; i < mounthCount; i++) {
             String[] timeArray = timeMorning[i].split(" ")[0].split("-");
-            applyNum[i]++;
             xAxisName.add(timeArray[1] + "月" + timeArray[2] + "日");
             for (StockLandStatistic stockLand : stockLandList) {
                 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
                 if (dateFormat.parse(timeMorning[i]).getTime() <= dateFormat.parse(stockLand.getCreate_time()).getTime()
                         && dateFormat.parse(timeEvening[i]).getTime() >= dateFormat.parse(stockLand.getCreate_time()).getTime()) {
+                    applyNum[i]++;
                     if (Objects.equals(stockLand.getApprove_status(), Constant.LandApproveStatus.PASSED)
                             || Objects.equals(stockLand.getApprove_status(), Constant.LandApproveStatus.NOTPASSED)
                             || Objects.equals(stockLand.getApprove_status(), Constant.LandApproveStatus.APPROVED)) {
@@ -1094,11 +1095,11 @@ public class LandStatisticsService {
             Date dateTwo = sdf.parse(dateEnd);
 
             Calendar calendar = Calendar.getInstance();
-            calendar.setTime(dateTwo);
+            calendar.setTime(dateOne);
 
-            dateList.add(dateEnd);
-            while (calendar.getTime().after(dateOne)) { //倒序时间,顺序after改before其他相应的改动。
-                calendar.add(Calendar.DAY_OF_MONTH, -1);
+            dateList.add(dateStart);
+            while (calendar.getTime().before(dateTwo)) { //倒序时间,顺序after改before其他相应的改动。
+                calendar.add(Calendar.DAY_OF_MONTH, 1);
                 dateList.add(sdf.format(calendar.getTime()));
             }
         } catch (Exception e) {

+ 16 - 16
src/main/resources/mapper/company/StockLandDao.xml

@@ -437,7 +437,6 @@ order by a.create_time desc
 		</if>
 	</select>
 
-
 	<!-- 所有存量用地数据 -->
 	<select id="findListByStreetId" resultType="platform.modules.company.dto.StockLandStatistic">
 		SELECT
@@ -448,23 +447,24 @@ order by a.create_time desc
 			stockland.approve_status,
 			stockland.process_status,
 			zuser.user_type AS apply_user_type,
-			(
-				SELECT
-					approval_round
-				FROM
-					z_approval
-				WHERE
-					apply_id = stockland.id
-				AND type = "存量用地"
-				AND del_flag = 0
-				AND is_withdraw IS NULL
-				ORDER BY id DESC
-				LIMIT 0,1
-			) approval_round
+			t.approval_round
 		FROM
 			c_stock_land_apply stockland
-		LEFT JOIN
-			z_user zuser ON zuser.id = stockland.create_by
+		LEFT JOIN z_user zuser ON zuser.id = stockland.create_by
+		LEFT JOIN (
+			SELECT
+				APPLY_ID,
+				max( APPROVAL_ROUND ) APPROVAL_ROUND,
+				max( id ) AS id
+			FROM
+				z_approval
+			WHERE
+				type = "存量用地"
+			AND del_flag = 0
+			AND is_withdraw IS NULL
+			GROUP BY
+				APPLY_ID
+		) t ON t.APPLY_ID = stockland.id
 		WHERE
 			stockland.del_flag = '0'
 		<if test="street_id != null and street_id != ''">

+ 80 - 35
src/main/resources/templates/admin/government/land_statistic/plate.html

@@ -186,17 +186,17 @@
     <span class="c-gray en">&gt;</span>
     板块统计
 </nav>
-<div class="plate_tab_list clearfix">
-    <span class="plate_tab_item active_plate">全部</span>
-    <span class="plate_tab_item">狮山街道(含横塘)</span>
-    <span class="plate_tab_item">枫桥街道</span>
-    <span class="plate_tab_item">浒墅关镇</span>
-    <span class="plate_tab_item">通安镇</span>
-    <span class="plate_tab_item">浒墅关经开区</span>
-    <span class="plate_tab_item">科技城(含东渚)</span>
-    <span class="plate_tab_item">综合保税区</span>
-    <span class="plate_tab_item">度假区(含镇湖)</span>
-    <span class="plate_tab_item">区外</span>
+<div class="plate_tab_list clearfix" id="streetList">
+    <!--    <span class="plate_tab_item active_plate">全部</span>-->
+    <!--    <span class="plate_tab_item">狮山街道(含横塘)</span>-->
+    <!--    <span class="plate_tab_item">枫桥街道</span>-->
+    <!--    <span class="plate_tab_item">浒墅关镇</span>-->
+    <!--    <span class="plate_tab_item">通安镇</span>-->
+    <!--    <span class="plate_tab_item">浒墅关经开区</span>-->
+    <!--    <span class="plate_tab_item">科技城(含东渚)</span>-->
+    <!--    <span class="plate_tab_item">综合保税区</span>-->
+    <!--    <span class="plate_tab_item">度假区(含镇湖)</span>-->
+    <!--    <span class="plate_tab_item">区外</span>-->
 </div>
 <div class="chartContent">
 
@@ -210,9 +210,9 @@
     </div>
 </div>
 <div class="date_tab_list clearfix">
-    <span class="date_tab_item">7天</span>
-    <span class="date_tab_item">14天</span>
-    <span class="date_tab_item" style="border-right: 1px solid #e2e3e3;">30天</span>
+    <span class="date_tab_item" data-type="-7">7天</span>
+    <span class="date_tab_item" data-type="-14">14天</span>
+    <span class="date_tab_item" style="border-right: 1px solid #e2e3e3;" data-type="-30">30天</span>
     <input type="text" name="starttime" class="form-control" id="starttime">
 </div>
 <div class="chartContent">
@@ -292,13 +292,14 @@
 
 <script th:inline="javascript">
 
+    var streetId = "", startTime = "", endTime = "";
     var streetList = [[${streetList}]]
-    console.log([[${streetList}]])
+    // console.log([[${streetList}]])
 
-    getApproveStatus(streetList[3].id);
-    getDailyStatistic(streetList[3].id, "2018-04-20", "2018-04-30");
-    getTypeStatistic(streetList[3].id, "", "");
-    getMontylyApproveStatistic(streetList[3].id);
+    getApproveStatus(streetId);
+    // getDailyStatistic(streetId, "2018-04-20", "2018-04-30");
+    // getTypeStatistic(streetId, "", "");
+    getMontylyApproveStatistic(streetId);
 
     //当前审核状态统计
     function getApproveStatus(streedId) {
@@ -371,7 +372,7 @@
     //周期分类统计
     function getTypeStatistic(streedId, startTime, endTime) {
         $.ajax({
-            url: pagePath + "/land_statistic/approve/type?street_id=" + streedId + "&start_time" + startTime + "&end_time" + endTime,
+            url: pagePath + "/land_statistic/approve/type?street_id=" + streedId + "&start_time=" + startTime + "&end_time=" + endTime,
             type: "get",
             dataType: "json",
             data: {
@@ -686,8 +687,8 @@
     }
 
     //月度审核统计表
-    function getMontylyApproveStatistic(streetId) {
-        streetId = 28
+    function getMontylyApproveStatistic() {
+
         var url = pagePath + "/land_statistic/approve/statistic/monthly"
 
         var start_time = $('#monthly_start_time').val();
@@ -699,26 +700,70 @@
         $('#monthly_approve_statistic').load(url);
     }
 
-    // 点击板块
-    $('.plate_tab_list .plate_tab_item').click(function(){
-        console.log('当前点击板块', $(this).html())
-        $(this).addClass('active_plate').siblings().removeClass("active_plate")
-    })
-
-    // 点击日期
-    $('.date_tab_list .date_tab_item').click(function(){
-        console.log('当前点击日期', $(this).html())
-        $(this).addClass('active_date').siblings().removeClass("active_date")
-    })
-
     //导出月度统计
     function exportMonthlyStatistic() {
-        streetId = 28;
         var start_time = $('#monthly_start_time').val();
         var end_time = $('#monthly_end_time').val();
         window.open(pagePath + "/land_statistic/approve/statistic/monthly/export?start_time="
             + start_time + "&end_time=" + end_time + "&street_id=" + streetId);
     }
+
+    //全局修改时间
+    function renderTime() {
+        getDailyStatistic(streetId, startTime, endTime);
+        getTypeStatistic(streetId, startTime, endTime);
+    }
+
+    $(function () {
+        /*街道初始化*/
+        var str = "<span class='plate_tab_item active_plate' data-id=''>全部</span>"
+        for (var i = 0; i < streetList.length; i++) {
+            str += "<span class='plate_tab_item' data-id='" + streetList[i].id + "'>" + streetList[i].name + "</span>";
+        }
+        $("#streetList").append(str);
+
+        // 点击板块
+        $('.plate_tab_list .plate_tab_item').click(function () {
+            // console.log('当前点击板块', $(this).html())
+            // console.log('当前点击板块id', $(this).data("id"))
+            $(this).addClass('active_plate').siblings().removeClass("active_plate")
+
+            streetId = $(this).data("id");
+            getApproveStatus(streetId);
+            getDailyStatistic(streetId, startTime, endTime);
+            getTypeStatistic(streetId, startTime, endTime);
+            getMontylyApproveStatistic(streetId);
+        })
+
+        /*时间初始化*/
+        function fun_date(num) {
+            num = num + 1
+            var date1 = new Date();
+            //今天时间
+            var time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate()
+            // console.log(time1);
+            endTime = time1;
+            var date2 = new Date(date1);
+            date2.setDate(date1.getDate() + num);
+            //num是正数表示之后的时间,num负数表示之前的时间,0表示今天
+            var time2 = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
+            // console.log(time2);
+            startTime = time2;
+
+            renderTime()
+            return time2;
+        }
+
+        fun_date(-7)
+
+        // 点击日期
+        $('.date_tab_list .date_tab_item').click(function () {
+            // console.log('当前点击日期', $(this).html())
+            // console.log('当前点击板块id', $(this).data("type"))
+            fun_date($(this).data("type"))
+            $(this).addClass('active_date').siblings().removeClass("active_date")
+        })
+    })
 </script>
 </body>
 </html>

+ 113 - 86
src/main/resources/templates/admin/government/land_statistic/region.html

@@ -87,7 +87,7 @@
         }
 
         .chartContent .date_line > i {
-            z-index:5;
+            z-index: 5;
             position: absolute;
             top: 0;
             padding: 10px;
@@ -103,6 +103,7 @@
         .chartContent .date_line .next_month {
             right: -8px;
         }
+
         .chartContent .date_line .date_tab_list {
             border-bottom: 1px solid #e2e3e4;
             width: 6000px;
@@ -110,10 +111,11 @@
             left: 0;
             top: 0;
         }
+
         .chartContent .date_line .date_tab_list .date_tab_item {
             display: inline-block;
             float: left;
-            width:58px;
+            width: 58px;
             text-align: center;
             margin-left: 15px;
             margin-right: 15px;
@@ -124,9 +126,11 @@
             cursor: pointer;
             margin-bottom: -1px;
         }
+
         .chartContent .date_line .date_tab_list .date_tab_item:first-child {
             margin-left: 30px;
         }
+
         .chartContent .date_line .date_tab_list .active_month {
             background-color: #ffffff;
             color: #00a0e9;
@@ -204,26 +208,20 @@
     <div class="date_line">
         <i class="pre_month Hui-iconfont Hui-iconfont-slider-left"></i>
         <i class="next_month Hui-iconfont Hui-iconfont-slider-right"></i>
-        <ul class="date_tab_list clearfix">
-            <li class="active_month date_tab_item">2019-05</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-06</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
-            <li class="date_tab_item">2019-07</li>
+        <ul class="date_tab_list clearfix" id="date_line">
+<!--            <li class="date_tab_item">2019-01</li>-->
+<!--            <li class="date_tab_item">2019-02</li>-->
+<!--            <li class="date_tab_item">2019-03</li>-->
+<!--            <li class="date_tab_item">2019-04</li>-->
+<!--            <li class="active_month date_tab_item">2019-05</li>-->
+<!--            <li class="date_tab_item">2019-06</li>-->
+<!--            <li class="date_tab_item">2019-07</li>-->
+<!--            <li class="date_tab_item">2019-08</li>-->
+<!--            <li class="date_tab_item">2019-09</li>-->
+<!--            <li class="date_tab_item">2019-11</li>-->
+<!--            <li class="date_tab_item">2019-12</li>-->
+<!--            <li class="date_tab_item">2020-01</li>-->
+<!--            <li class="date_tab_item">2020-02</li>-->
         </ul>
     </div>
     <div id="monthly_type_bar" style="width: 1200px; height: 400px"></div>
@@ -353,7 +351,7 @@
 <script th:inline="javascript">
 
     getApproveStatus("");
-    getTypeStatistic("", "", "");
+    // getTypeStatistic("", "", "");
     getMontylyApproveStatus();
     getMontylyApproveStatistic();
     getPlateStatistic();
@@ -399,7 +397,7 @@
     //月度分类统计
     function getTypeStatistic(streedId, startTime, endTime) {
         $.ajax({
-            url: pagePath + "/land_statistic/approve/type?street_id=" + streedId + "&start_time" + startTime + "&end_time" + endTime,
+            url: pagePath + "/land_statistic/approve/type?street_id=" + streedId + "&start_time=" + startTime + "&end_time=" + endTime,
             type: "get",
             dataType: "json",
             data: {
@@ -437,7 +435,7 @@
             },
             success: function (result) {
                 if (result.success) {
-                    console.log(result.obj)
+                    // console.log(result.obj)
                     var data = result.obj.data
                     var xAxisName = result.obj.xAxisName;
                     var legendData = new Array();
@@ -664,8 +662,8 @@
         var date = new Date(), y = date.getFullYear(), m = date.getMonth();
         var firstDay = new Date(y, m, 1);
         var lastDay = new Date(y, m + 1, 0);
-        console.log(firstDay.format('yyyy-MM-dd') + " 00:00:00")
-        console.log(lastDay.format('yyyy-MM-dd') + " 23:59:59")
+        // console.log(firstDay.format('yyyy-MM-dd') + " 00:00:00")
+        // console.log(lastDay.format('yyyy-MM-dd') + " 23:59:59")
         return dataArr;
     }
 
@@ -675,7 +673,7 @@
         var charts = echarts.init(document.getElementById('monthly_type_bar'));
 
         charts.on('timelinechanged', function (timeLineIndex) {
-            console.log(timeLineIndex.currentIndex)
+            // console.log(timeLineIndex.currentIndex)
         });
 
         // 指定图表的配置项和数据
@@ -810,7 +808,7 @@
     }
 
     $(document).on("click", ".liHead", function () {
-        console.log("点击了", $(this).next().is(":hidden"))
+        // console.log("点击了", $(this).next().is(":hidden"))
         if (!$(this).next().is(":hidden")) {
             $(this).next().slideUp(200)
             $(this).children(":first").children(":first").attr("class", "ifont-youx-copy-copy close")
@@ -821,66 +819,95 @@
 
     })
 
-    // 点击前一页
-    $('.date_line .pre_month').click(function(){
-        let offsetNum = $('.date_tab_list').position().left
-        // console.log('父元素偏移量', Math.abs(offsetNum))
-        if (Math.abs(offsetNum) > 0) {
-            $('.date_line .pre_month').css('display', 'none')
-            let offsetLeft = (offsetNum + 1170 + 'px')
-            $(".date_tab_list").animate({left: offsetLeft}, 1000)
-            setTimeout(function(){
-                $('.date_line .pre_month').css('display', 'block')
-            },1000)
-        } else {
-            console.log('已到头')
+    $(function () {
+        var dataArr = [];
+        var data = new Date();
+        var year = data.getFullYear();
+        data.setMonth(data.getMonth() + 1, 1)           //获取到当前月份,设置月份
+        for (var i = 0; i < 24; i++) {
+            data.setMonth(data.getMonth() - 1);     //每次循环一次 月份值减1
+            var m = data.getMonth() + 1;
+            m = m < 10 ? "0" + m : m;
+            dataArr.unshift(data.getFullYear() + "-" + (m));
         }
-    })
-
-    // 点击后一页
-    $('.date_line .next_month').click(function(){
-        let offsetNum = $('.date_tab_list').position().left
-        let childrenNum = $('.date_tab_list').children('.date_tab_item').length
-        let maxOffset = (Math.ceil(childrenNum/9) - 1) * 1170
-        // console.log('父元素偏移量', offsetNum)
-        // console.log('子元素数量', childrenNum)
-        // console.log('最大偏移量', maxOffset)
-        if (Math.abs(offsetNum) < maxOffset) {
-            $('.date_line .next_month').css('display', 'none')
-            let offsetLeft = (offsetNum - 1170 + 'px')
-            $(".date_tab_list").animate({left: offsetLeft}, 1000)
-            setTimeout(function(){
-                $('.date_line .next_month').css('display', 'block')
-            },1000)
-        } else {
-            console.log('已到达最大距离')
+        // console.log(dataArr)
+        var str = "";
+        for (var i = 0; i < dataArr.length; i++) {
+            if (i < dataArr.length - 1) {
+                str += "<li class='date_tab_item'>" + dataArr[i] + "</li>";
+            } else {
+                str += "<li class='active_month date_tab_item'>" + dataArr[i] + "</li>";
+                var startTime = dataArr[i] + "-01 00:00:00";
+                var endTime = dataArr[i] + "-31 23:59:59";
+                getTypeStatistic("", startTime, endTime);
+            }
+        }
+        $("#date_line").append(str);
+
+        // 点击前一页
+        $('.date_line .pre_month').click(function () {
+            let offsetNum = $('.date_tab_list').position().left
+            // console.log('父元素偏移量', Math.abs(offsetNum))
+            if (Math.abs(offsetNum) > 0) {
+                $('.date_line .pre_month').css('display', 'none')
+                let offsetLeft = (offsetNum + 1170 + 'px')
+                $(".date_tab_list").animate({left: offsetLeft}, 1000)
+                setTimeout(function () {
+                    $('.date_line .pre_month').css('display', 'block')
+                }, 1000)
+            } else {
+                // console.log('已到头')
+            }
+        })
+
+        // 点击后一页
+        $('.date_line .next_month').click(function () {
+            let offsetNum = $('.date_tab_list').position().left
+            let childrenNum = $('.date_tab_list').children('.date_tab_item').length
+            let maxOffset = (Math.ceil(childrenNum / 9) - 1) * 1170
+            // console.log('父元素偏移量', offsetNum)
+            // console.log('子元素数量', childrenNum)
+            // console.log('最大偏移量', maxOffset)
+            if (Math.abs(offsetNum) < maxOffset) {
+                $('.date_line .next_month').css('display', 'none')
+                let offsetLeft = (offsetNum - 1170 + 'px')
+                $(".date_tab_list").animate({left: offsetLeft}, 1000)
+                setTimeout(function () {
+                    $('.date_line .next_month').css('display', 'block')
+                }, 1000)
+            } else {
+                // console.log('已到达最大距离')
+            }
+        })
+
+        // 点击统计日期
+        $('.date_tab_list .date_tab_item').click(function () {
+            // console.log('当前点击日期', $(this).html())
+            var startTime = $(this).html() + "-01 00:00:00";
+            var endTime = $(this).html() + "-31 23:59:59";
+            getTypeStatistic("", startTime, endTime)
+            $(this).addClass('active_month').siblings().removeClass("active_month")
+        })
+
+        Date.prototype.format = function (format) {
+            var o = {
+                "M+": this.getMonth() + 1, //month
+                "d+": this.getDate(),    //day
+                "h+": this.getHours(),   //hour
+                "m+": this.getMinutes(), //minute
+                "s+": this.getSeconds(), //second
+                "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter
+                "S": this.getMilliseconds() //millisecond
+            }
+            if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
+                (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+            for (var k in o) if (new RegExp("(" + k + ")").test(format))
+                format = format.replace(RegExp.$1,
+                    RegExp.$1.length == 1 ? o[k] :
+                        ("00" + o[k]).substr(("" + o[k]).length));
+            return format;
         }
     })
-
-    // 点击统计日期
-    $('.date_tab_list .date_tab_item').click(function(){
-        console.log('当前点击日期', $(this).html())
-        $(this).addClass('active_month').siblings().removeClass("active_month")
-    })
-
-    Date.prototype.format = function (format) {
-        var o = {
-            "M+": this.getMonth() + 1, //month
-            "d+": this.getDate(),    //day
-            "h+": this.getHours(),   //hour
-            "m+": this.getMinutes(), //minute
-            "s+": this.getSeconds(), //second
-            "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter
-            "S": this.getMilliseconds() //millisecond
-        }
-        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
-            (this.getFullYear() + "").substr(4 - RegExp.$1.length));
-        for (var k in o) if (new RegExp("(" + k + ")").test(format))
-            format = format.replace(RegExp.$1,
-                RegExp.$1.length == 1 ? o[k] :
-                    ("00" + o[k]).substr(("" + o[k]).length));
-        return format;
-    }
 </script>
 </body>
 </html>