Administrator 2 gadi atpakaļ
vecāks
revīzija
fea4fd9603

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 353 - 314
.idea/workspace.xml


+ 5 - 3
leiSP-admin/src/main/java/com/sooka/web/controller/system/SysIndexController.java

@@ -3,6 +3,7 @@ package com.sooka.web.controller.system;
 import java.util.List;
 
 import com.business.slfh.bigdata.inspection.domain.BigData_Inspection_TodayWindPower;
+import com.sooka.common.core.domain.BaseEntity;
 import com.sooka.system.domain.SysMain;
 import com.sooka.system.service.ISysMainService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +20,7 @@ import com.sooka.system.service.ISysMenuService;
 
 /**
  * 首页 业务处理
- * 
+ *
  * @author lei_wang
  */
 @Controller
@@ -62,14 +63,15 @@ public class SysIndexController extends BaseController
     @GetMapping("/system/main")
     public String main(ModelMap mmap)
     {
+        BaseEntity baseEntity = new BaseEntity();
         mmap.put("version", Global.getVersion());
         SysMain.SysMainTodayWindPower todayWindPower = mainService.getTodayWindPower();
         mmap.put("todayWindPower",todayWindPower == null?new SysMain.SysMainTodayWindPower():todayWindPower);//今日风力
         mmap.put("user",mainService.getUser());//用户数
         mmap.put("policies",mainService.getPolicies());//政策法规
         mmap.put("notice",mainService.getNotice());//通知公告
-        mmap.put("event",mainService.getEvent());//通知公告
-        mmap.put("task",mainService.getTask());//待办任务
+        mmap.put("event",mainService.getEvent(baseEntity));//通知公告
+        mmap.put("task",mainService.getTask(baseEntity));//待办任务
         mmap.put("weather",mainService.getWeather());//天气指数
         return "main";
     }

+ 2 - 2
leiSP-admin/src/main/resources/application-druid.yml

@@ -8,8 +8,8 @@ spring:
             master:
 
 #                url: jdbc:mysql://117.78.49.164:63306/hnly?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-#                url: jdbc:mysql://119.52.253.110:53306/hnly?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                url: jdbc:mysql://192.168.100.12:53306/hnly?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://119.52.253.110:53306/hnly?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                url: jdbc:mysql://192.168.100.12:53306/hnly?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
 #
 
 #                username: root

+ 4 - 2
leiSP-system/src/main/java/com/sooka/system/mapper/SysMainMapper.java

@@ -1,5 +1,6 @@
 package com.sooka.system.mapper;
 
+import com.sooka.common.core.domain.BaseEntity;
 import com.sooka.system.domain.SysMain;
 
 import java.util.List;
@@ -9,7 +10,8 @@ public interface SysMainMapper {
     public SysMain.SysMainUser selectUser();
     public SysMain.SysMainPolicies selectPolicies();
     public SysMain.SysMainNotice selectNotice();
-    public SysMain.SysMainEvent selectEvent();
-    public List<SysMain.SysMainTask> selectTask();
+    public List<SysMain.SysMainTask> selectTask(BaseEntity baseEntity);
     public List<SysMain.SysMainWeather> selectWeather();
+
+    public SysMain.SysMainEvent selectEvent(BaseEntity baseEntity);
 }

+ 5 - 3
leiSP-system/src/main/java/com/sooka/system/service/ISysMainService.java

@@ -1,12 +1,13 @@
 package com.sooka.system.service;
 
+import com.sooka.common.core.domain.BaseEntity;
 import com.sooka.system.domain.SysMain;
 
 import java.util.List;
 
 /**
  * 菜单 业务层
- * 
+ *
  * @author lei_wang
  */
 public interface ISysMainService {
@@ -14,7 +15,8 @@ public interface ISysMainService {
     public SysMain.SysMainUser getUser();
     public SysMain.SysMainPolicies getPolicies();
     public SysMain.SysMainNotice getNotice();
-    public SysMain.SysMainEvent getEvent();
-    public List<SysMain.SysMainTask> getTask();
+    public SysMain.SysMainEvent getEvent(BaseEntity baseEntity);
+    public List<SysMain.SysMainTask> getTask(BaseEntity baseEntity);
     public List<SysMain.SysMainWeather> getWeather();
+
 }

+ 30 - 11
leiSP-system/src/main/java/com/sooka/system/service/impl/SysMainServiceImpl.java

@@ -1,6 +1,8 @@
 package com.sooka.system.service.impl;
 
+import com.sooka.common.annotation.DataScope;
 import com.sooka.common.constant.UserConstants;
+import com.sooka.common.core.domain.BaseEntity;
 import com.sooka.common.core.domain.Ztree;
 import com.sooka.common.utils.StringUtils;
 import com.sooka.system.domain.SysMain;
@@ -20,22 +22,39 @@ import java.text.MessageFormat;
 import java.util.*;
 
 @Service
-public class SysMainServiceImpl implements ISysMainService
-{
+public class SysMainServiceImpl implements ISysMainService {
     @Resource
     private SysMainMapper mainMapper;
 
-    public SysMain.SysMainTodayWindPower getTodayWindPower(){
-        return  mainMapper.selectTodayWindPower();
+    public SysMain.SysMainTodayWindPower getTodayWindPower() {
+        return mainMapper.selectTodayWindPower();
     }
-    public SysMain.SysMainUser getUser(){ return  mainMapper.selectUser(); }
-    public SysMain.SysMainPolicies getPolicies(){ return  mainMapper.selectPolicies(); }
-    public SysMain.SysMainNotice getNotice(){
+
+    public SysMain.SysMainUser getUser() {
+        return mainMapper.selectUser();
+    }
+
+    public SysMain.SysMainPolicies getPolicies() {
+        return mainMapper.selectPolicies();
+    }
+
+    public SysMain.SysMainNotice getNotice() {
         SysMain.SysMainNotice sysMainNotice = mainMapper.selectNotice();
         SysMain.SysMainNotice newSysMainNotice = new SysMain.SysMainNotice();
         newSysMainNotice.setTitle("暂无公告");
-        return sysMainNotice == null?newSysMainNotice:sysMainNotice;  }
-    public SysMain.SysMainEvent getEvent(){ return  mainMapper.selectEvent(); }
-    public List<SysMain.SysMainTask> getTask(){ return  mainMapper.selectTask(); }
-    public List<SysMain.SysMainWeather> getWeather(){ return  mainMapper.selectWeather(); }
+        return sysMainNotice == null ? newSysMainNotice : sysMainNotice;
+    }
+
+    @DataScope(deptAlias = "d")
+    public SysMain.SysMainEvent getEvent(BaseEntity baseEntity) {
+        return mainMapper.selectEvent(baseEntity);
+    }
+
+    public List<SysMain.SysMainTask> getTask(BaseEntity baseEntity) {
+        return mainMapper.selectTask(baseEntity);
+    }
+
+    public List<SysMain.SysMainWeather> getWeather() {
+        return mainMapper.selectWeather();
+    }
 }

+ 51 - 10
leiSP-system/src/main/resources/mapper/system/SysMainMapper.xml

@@ -30,21 +30,62 @@
     <select id="selectNotice" resultType="com.sooka.system.domain.SysMain$SysMainNotice">
         select notice_title title, notice_content content from sys_notice order by create_time desc limit 1
     </select>
-    
-    <select id="selectEvent" resultType="com.sooka.system.domain.SysMain$SysMainEvent">
-        select (select count(*) from t_u_event_fire where event_status != 'event_status_1') +
-        (select count(*) from t_u_event_others where event_status != 'event_status_1') total,
-        (select count(*) from t_u_event_fire where event_status = 'event_status_3') +
-        (select count(*) from t_u_event_others where event_status = 'event_status_3') doing,
-        (select count(*) from t_u_event_fire where event_status in ('event_status_4','event_status_5')) +
-        (select count(*) from t_u_event_others where event_status in ('event_status_4','event_status_5')) done
+
+    <select id="selectEvent"
+            resultType="com.sooka.system.domain.SysMain$SysMainEvent"
+            parameterType="com.sooka.common.core.domain.BaseEntity">
+        select (
+        select count(*) from t_u_event_fire tf,sys_dept d where tf.dept_id= d.dept_id
+        and tf.event_status != 'event_status_1'
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        )
+         +
+        (
+        select count(*) from t_u_event_others ot,sys_dept d where ot.dept_id=d.dept_id
+        and event_status != 'event_status_1'
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+
+        ) total,
+        (
+
+        select count(*) from t_u_event_fire tf,sys_dept d where tf.dept_id=d.dept_id
+        and tf.event_status = 'event_status_3'
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+
+        ) +
+        (
+
+        select count(*) from t_u_event_others ot,sys_dept d where ot.dept_id=d.dept_id
+        and ot.event_status = 'event_status_3'
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+
+        ) doing,
+        (
+
+        select count(*) from t_u_event_fire tf,sys_dept d where tf.dept_id=d.dept_id
+        and tf.event_status in ('event_status_4','event_status_5')
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+
+
+        ) +
+        (
+        select count(*) from t_u_event_others ot,sys_dept d where ot.dept_id=d.dept_id
+        and event_status in ('event_status_4','event_status_5')
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        ) done
     </select>
 
-    <select id="selectTask" resultType="com.sooka.system.domain.SysMain$SysMainTask">
+    <select id="selectTask" resultType="com.sooka.system.domain.SysMain$SysMainTask" parameterType="com.sooka.common.core.domain.BaseEntity">
         select name title, content content, (select dict_label from sys_dict_data where dict_value = task_status) taskStatus, task_status taskStatusValue, charger_name chargerName, date_format(sender_time,'%Y-%m-%d') sendTime  from t_u_task
     </select>
 
     <select id="selectWeather" resultType="com.sooka.system.domain.SysMain$SysMainWeather">
         select date_format(rectime,'%Y') year, date_format(rectime,'%c') month, date_format(rectime,'%d') day, temperature, humidity from t_res_level order by rectime desc limit 31
     </select>
-</mapper>
+</mapper>

+ 8 - 2
mybusiness/src/main/java/com/business/slfh/manager/othersmanager/controller/TUEventOthersController.java

@@ -33,7 +33,7 @@ import java.util.List;
 
 /**
  * 【请填写功能名称】Controller
- * 
+ *
  * @author lei
  * @date 2020-11-25
  */
@@ -391,7 +391,13 @@ public class TUEventOthersController extends BaseController
 
 
 
-
+    @GetMapping("/quickClear")
+    @ResponseBody
+    public String quickClear(ModelMap mmap)
+    {
+        tUEventFireService.clearAllEvent();
+        return "处理所有事件为无异常状态";
+    }
 
 
 }

+ 1 - 2
mybusiness/src/main/resources/templates/business/manager/firemanager/confirm.html

@@ -119,7 +119,6 @@
 
     /* 添加用户-选择用户-提交 */
     function submitHandler() {
-        console.log(666);
         var rows_id = $.table.selectFirstColumns();
         $("#confirmIds").val(selectColumns(1));
         $("#confirmNames").val(selectColumns(3));
@@ -148,4 +147,4 @@
     }
 </script>
 </body>
-</html>
+</html>

+ 30 - 0
mybusiness/src/main/resources/templates/business/manager/othersmanager/index.html

@@ -102,6 +102,19 @@
             <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:fire:export">
                 <i class="fa fa-download"></i> 导出
             </a>-->
+
+            <a class="btn btn-warning" onclick="$.table.exportExcel('formId')" shiro:hasPermission="system:fire:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+            <a class="btn btn-primary" onclick="showHistoryFire()" shiro:hasPermission="system:fire:edit">
+                <i class="fa fa-edit"></i> 历史火情
+            </a>
+            <a class="btn btn-danger" onclick="quickClear()">
+                <i class="fa fa-edit"></i> 一键清理事件
+            </a>
+
+
+
         </div>
         <div class="col-sm-12 select-table table-striped">
             <table id="bootstrap-table"></table>
@@ -110,6 +123,23 @@
 </div>
 <th:block th:include="include :: footer" />
 <script th:inline="javascript">
+
+    function quickClear() {
+        $.ajax({
+            url: prefix + "/quickClear",
+            success: function (e) {
+                $.modal.msgSuccess(e);
+            }
+        });
+    }
+    function showHistoryFire() {
+        var url = prefix + "/showHistoryFire";
+        // window.open(url);
+        $.modal.openTab("查看【历史火情】详情", url);
+    }
+
+
+
     function openDetailsDia(eventId){
         //var prefix = ctx + "visualization/event/getVisualizationDetails?eventId="+eventId+"&reservePlanType=reserveplan_type_1";
         var prefix = ctx + "visualization/event/getVisualizationDetails?eventId="+eventId+"&reservePlanType=" + $("#reserveplanType").val();

+ 9 - 1
mybusiness/src/main/resources/templates/business/visualization/confirm.html

@@ -67,7 +67,16 @@
     var datas = [[${@dict.getType('sys_normal_disable')}]];
     var prefix = ctx + "business/manager/firemanager";
 
+    //定义一个函数来设置cookie,同时设置cookie的有效时间
+    function setCookie(key, value, t) {
+        var oDate = new Date();
+        oDate.setDate(oDate.getDate() + t);
+        //使用escape()对内容进行编码
+        document.cookie = key + '=' + escape(value) + ';expires=' + oDate.toGMTString();
+    }
     $(function() {
+        setCookie("flushpage_switch","false",1000000000000)
+        console.log("事件确认页面===="+flushpage_switch)
         var options = {
             url: prefix + "/confirmUserList",
             createUrl: prefix + "/add",
@@ -138,7 +147,6 @@
 
     /* 添加用户-选择用户-提交 */
     function submitHandler() {
-        console.log(666);
         var rows_id = $.table.selectFirstColumns();
         $("#confirmIds").val(selectColumns(1));
         $("#confirmNames").val(selectColumns(3));

+ 63 - 3
mybusiness/src/main/resources/templates/business/visualization/details.html

@@ -108,7 +108,7 @@
                             <button type="button" class="close" data-dismiss="modal"><span
                                     aria-hidden="true">×</span><span class="sr-only">Close</span>
                             </button>
-                            <!--<h4 class="modal-title">[[${visualization_plan.TITLE}]]</h4>-->
+                            <h4 class="modal-title">[[${visualization_plan.TITLE}]]</h4>
                         </div>
                         <small>
                             <div class="modal-body">
@@ -262,7 +262,25 @@
         },function(){
             $(this).css("border-color","#d8d8d8")
     });
+    function setCookie(key, value, t) {
+        var oDate = new Date();
+        oDate.setDate(oDate.getDate() + t);
+        //使用escape()对内容进行编码
+        document.cookie = key + '=' + escape(value) + ';expires=' + oDate.toGMTString();
+    }
+    function getCookie(key) {
+        var arr1 = document.cookie.split(';');
+        for (var i = 0; i < arr1.length; i++) {
+            var arr2 = arr1[i].split('=');
+            if (arr2[0] == key) {
+                return unescape(arr2[1]);//对编码后的内容进行解码
+            }
+        }
+    }
+
     $(function(){
+        setCookie("flushpage_switch","false",1000000000000)
+        console.log("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",getCookie("flushpage_switch"))
         $(".hq_tit2 span").on('click',function(){
             $(this).addClass('on').siblings('span').removeClass('on');
             $(".tit_div").eq($(this).index()).show().siblings('.tit_div').hide();
@@ -291,20 +309,29 @@
     }
 
     function drivingEvents(id,type,action){
-        type = "reserveplan_type_1"
+        // type = "reserveplan_type_1"
         confirmReport(id,type,action);
 
     }
     function confirmReport(eventId,eventType,action) {
+
+
         confirm_id = eventId;
         confirm_type = eventType;
         confirm_action = action;
+
+        console.log("1111111111111111",eventType)
+        debugger
         var options = {
             title: '消息通知',
             width: $(document).width(),
             url: "/visualization/confirm/selectUser",
             callBack: doSubmitConfirm
         };
+
+
+
+
         //无异常不弹窗
         if(confirm_action == "nomarl"){
             var obj = new Object();
@@ -320,6 +347,27 @@
             return;
         }
         $.modal.openOptions(options);
+        $(".layui-layer-btn0").click(function () {
+            setTimeout(function () {
+                parent.window.location.reload();//父页面刷新
+                window.location.reload();//页面刷新
+            }, 500);
+        })
+        $(".layui-layer-btn1").click(function () {
+            setTimeout(function () {
+                parent.window.location.reload();//父页面刷新
+                window.location.reload();//页面刷新
+            }, 500);
+        })
+        $(".layui-layer-close1").click(function () {
+            setTimeout(function () {
+                parent.window.location.reload();//父页面刷新
+                window.location.reload();//页面刷新
+            }, 500);
+        })
+
+
+
     }
 
 
@@ -327,6 +375,7 @@
 
 
     function doSubmitConfirm(index, layero){
+        setCookie("flushpage_switch","true",1000000000000)
         var body = layer.getChildFrame('body', index);
 
         var userIds = body.find('#selectorx').val();
@@ -339,7 +388,14 @@
         var obj = new Object();
         obj.id = confirm_id;
         obj.userIds = userIds.toString();
-        drivingFireEvents(confirm_action,obj);
+        console.log("^^^^^^^^^^^",confirm_action)
+        debugger;
+        if(confirm_type == 'reserveplan_type_1'){
+            drivingFireEvents(confirm_action,obj);
+        }else{
+            drivingOthersEvents(confirm_action,obj)
+        }
+
     }
 
     function drivingFireEvents(action,obj) {
@@ -350,6 +406,9 @@
         }else{
             url += "/confirmFireEvent";
         }
+
+        console.log("*************************",url)
+        debugger;
         ajaxPost(url,obj);
 
 
@@ -362,6 +421,7 @@
         }else{
             url += "/confirmOthersEvent";
         }
+        console.log("########",action)
         ajaxPost(url,obj);
     }
 

+ 50 - 8
mybusiness/src/main/resources/templates/business/visualization/event.html

@@ -21,9 +21,30 @@
     <script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
     <script th:src="@{/visualization/js/sj.js}"></script>
     <script>
+
+        function getCookie(key) {
+            var arr1 = document.cookie.split(';');
+            for (var i = 0; i < arr1.length; i++) {
+                var arr2 = arr1[i].split('=');
+                if (arr2[0] == key) {
+                    return unescape(arr2[1]);//对编码后的内容进行解码
+                }
+            }
+        }
+
+        //定义一个函数来设置cookie,同时设置cookie的有效时间
+        function setCookie(key, value, t) {
+            var oDate = new Date();
+            oDate.setDate(oDate.getDate() + t);
+            //使用escape()对内容进行编码
+            document.cookie = key + '=' + escape(value) + ';expires=' + oDate.toGMTString();
+        }
+        setCookie("flushpage_switch","true",1000000000000)
         var loginName = "[[${loginName}]]";
         $(function () {
-            openSocket(loginName);
+            window.setInterval(function (args) {
+                openSocket(loginName)
+            }, 10000);
             var action = "[[${action}]]";
             $("div[url='" + action + "']").click();
             $('input:checkbox').click(function () {
@@ -46,9 +67,6 @@
         });
 
 
-
-
-
         function reloadMarks(arr) {
             $("#map")[0].contentWindow.reloadMarks(arr);
         }
@@ -70,6 +88,27 @@
         function openDetailsDia(eventId, reservePlanType) {
             var prefix = "[[@{/visualization/event/getVisualizationDetails?eventId=}]]" + eventId + "&reservePlanType=" + reservePlanType;
             $.modal.open('警情信息', prefix, $(document).width(), $(document).height());
+
+            $(".layui-layer-btn0").click(function () {
+                setTimeout(function () {
+                    parent.window.location.reload();//父页面刷新
+                    window.location.reload();//页面刷新
+                }, 500);
+            })
+            $(".layui-layer-btn1").click(function () {
+                setTimeout(function () {
+                    parent.window.location.reload();//父页面刷新
+                    window.location.reload();//页面刷新
+                }, 500);
+            })
+            $(".layui-layer-close1").click(function () {
+                setTimeout(function () {
+                    parent.window.location.reload();//父页面刷新
+                    window.location.reload();//页面刷新
+                }, 500);
+            })
+
+
         }
 
         function revertMap() {
@@ -120,7 +159,7 @@
                 socket.onmessage = function (msg) {
                     // var text ='{"content":"String content","id":"0d44d0027e424e898f60a456ca8b8a6a","latitude":"5318807.94","longitude":"13874773.35","title":"String title"}';
                     var message = msg.data;
-                    console.log("message ===",message)
+                    console.log("message ===", message)
                     if (message != "" && message != null) {
 
                         // var json =  $.parseJSON(msg.data);
@@ -173,21 +212,24 @@
                             });
                         }
                         //刷新iframe
-                        if(message != undefined && message == "着火了"){
+                        if (message != undefined && message != "连接成功" && getCookie("flushpage_switch") == "true") {
                             window.location.reload(true)
+                            $('#qt_iframe').attr('src', $('#qt_iframe').attr('src'));
                         }
-                        $('#qt_iframe').attr('src', $('#qt_iframe').attr('src'));
                     }
                 };
                 //关闭事件
                 socket.onclose = function () {
                     console.log("websocket已关闭");
+
                 };
                 //发生了错误事件
                 socket.onerror = function () {
                     console.log("websocket发生了错误");
+
                 }
             }
+
         }
 
     </script>
@@ -385,7 +427,7 @@
     function setVisuSee() {
         alert("1111");
         var visuSee = "[[${visuSee}]]"
-        if(visuSee != undefined && visuSee != null && visuSee !=""){
+        if (visuSee != undefined && visuSee != null && visuSee != "") {
             var arr = visuSee.split(",");
             alert(arr);
             if (visuSee != "adminRole") {