Переглянути джерело

Merge remote-tracking branch 'origin/master'

wangzhe 4 роки тому
батько
коміт
6d30e91752

+ 23 - 0
mybusiness/src/main/java/com/business/slfh/visualization/event/controller/Visualization_Event_Controller.java

@@ -6,7 +6,11 @@ import com.business.slfh.app.appbase.controller.AppBaseController;
 import com.business.slfh.app.appbase.domain.AppPageModel;
 import com.business.slfh.manager.cameramanager.domain.TResCamera;
 import com.business.slfh.manager.cameramanager.service.ITResCameraService;
+import com.business.slfh.manager.forestdevicemanager.domain.TResForestdevice;
+import com.business.slfh.manager.forestdevicemanager.service.ITResForestdeviceService;
 import com.business.slfh.manager.levelmanager.domain.TResLevel;
+import com.business.slfh.manager.sourcewatermanager.domain.TResSourcewater;
+import com.business.slfh.manager.sourcewatermanager.service.ITResSourcewaterService;
 import com.business.slfh.tools.DistanceRad;
 import com.business.slfh.tools.GetUAVPreviewURL;
 import com.business.slfh.tools.UUID_Tools;
@@ -23,6 +27,7 @@ import com.sooka.system.service.ISysConfigService;
 import com.sooka.system.service.ISysDictDataService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Controller;
@@ -62,6 +67,10 @@ public class Visualization_Event_Controller extends AppBaseController {
     SysConfigMapper sysConfigMapper;
     @Resource
     UserInfoUtil userInfoUtil;
+    @Autowired
+    private ITResSourcewaterService tResSourcewaterService;
+    @Autowired
+    private ITResForestdeviceService itResForestdeviceService;
 
     @RequestMapping("/getVisualizationEvent")
     public String getVisualizationEvent(ModelMap map, HttpServletRequest request) {
@@ -572,4 +581,18 @@ public class Visualization_Event_Controller extends AppBaseController {
         return visualization_event_service.getXfResources(types,userInfoUtil.getLoginUserInfo().getDeptId().toString());
     }
 
+    @RequestMapping("/getSourcesWater")
+    @ResponseBody
+    public List<TResSourcewater> getSourcesWater(TResSourcewater tResSourcewater) {
+        tResSourcewater.setDeptId(userInfoUtil.getLoginUserInfo().getDeptId());
+        return tResSourcewaterService.selectTResSourcewaterList(tResSourcewater);
+    }
+
+    @RequestMapping("/getForestDevice")
+    @ResponseBody
+    public List<TResForestdevice> getForestDevice(TResForestdevice forestdevice) {
+        forestdevice.setDeptId(userInfoUtil.getLoginUserInfo().getDeptId());
+        return itResForestdeviceService.selectTResForestdeviceList(forestdevice);
+    }
+
 }

+ 2 - 0
mybusiness/src/main/resources/templates/business/visualization/event.html

@@ -301,6 +301,8 @@
     <label><input type="checkbox" checked name="leftNav" id="fhjcz" />防火检查站</label>
     <label><input type="checkbox" checked name="leftNav" id="lyj" />林业局</label>
     <label><input type="checkbox" checked name="leftNav" id="lc" />林场</label>
+    <label><input type="checkbox" checked name="leftNav" id="sy" />水源</label>
+    <label><input type="checkbox" checked name="leftNav" id="jywz" />救援物资</label>
 </div>
 <!--事件 左侧导航 结束-->
 <!--森林 左侧导航 开始-->

+ 110 - 1
mybusiness/src/main/resources/templates/business/visualization/map.html

@@ -67,7 +67,8 @@
         clearLayers();
         getSxtMarkers();
         getLwtMarkers();
-
+        getSyMarkers();
+        getJywzMarkers();
         getXfResources(["fhjcz","lyj","lc","jjd","phd","qxz"]);
         var eventName = parent.$("#qt_iframe")[0].contentWindow.getFrameElementValue("eventName");
         var deptId = parent.$("#qt_iframe")[0].contentWindow.getFrameElementValue("treeId");
@@ -552,6 +553,108 @@
     }
 
     /**
+     * 查询所有水源
+     * */
+    function getSyMarkers(){
+        $.post("[[@{/visualization/event/getSourcesWater}]]",function (res) {
+            console.log(res);
+            for(let i=0;i<res.length;i++) {
+                let json = {
+                    id: res[i].id,
+                    name: res[i].name,
+                    size: res[i].size,
+                    quantity: res[i].quantity,
+                    deptName: res[i].deptName,
+                    latitude: res[i].latitude,
+                    longitude: res[i].longitude
+                };
+                syMarker(json);
+            }
+        });
+    }
+    function syMarker(option){
+        let iconUrl = '[[@{/visualization/images/xfjcz.gif}]]';
+        let icon = L.icon({
+            iconUrl: iconUrl,
+            iconSize: [65, 67],
+            iconAnchor: [37, 57]
+        });
+        let markName="sy"+option.id;
+        markName = L.marker(
+            [option.latitude , option.longitude],
+            {icon: icon}
+        );
+        resultLayer.addLayer(markName);
+
+        markName.on("mousemove", function () {
+            pop = L.popup({className:'div_tittle'})
+                .setLatLng([option.latitude,option.longitude])
+                .setContent(
+                    "<span class='slfh_tit'>水源</span>"+
+                    "<h4>水源名称:"+option.name+"</h4>"+
+                    "<p>水源面积(平方米):"+option.size+"</p>"+
+                    "<p>水量(平方米):"+option.quantity+"</p>"+
+                    "<p>所属林场:"+option.deptName+"</p>"
+                ).openOn(map);
+        });
+        markName.on("mouseout", function () {
+            map.closePopup(pop);
+        });
+    }
+    /**
+     * 查询所有救援物资
+     * */
+    function getJywzMarkers(){
+        $.post("[[@{/visualization/event/getForestDevice}]]",function (res) {
+            console.log(res);
+            for(let i=0;i<res.length;i++) {
+                let json = {
+                    id: res[i].id,
+                    code: res[i].code,
+                    name: res[i].name,
+                    manager: res[i].manager,
+                    purchase: res[i].purchase,
+                    maintenance: res[i].maintenance,
+                    latitude: res[i].latitude,
+                    longitude: res[i].longitude
+                };
+                jywzMarker(json);
+            }
+        });
+    }
+
+    function jywzMarker(option){
+        let iconUrl = '[[@{/visualization/images/xfjcz.gif}]]';
+        let icon = L.icon({
+            iconUrl: iconUrl,
+            iconSize: [65, 67],
+            iconAnchor: [37, 57]
+        });
+        let markName="jywz"+option.id;
+        markName = L.marker(
+            [option.latitude , option.longitude],
+            {icon: icon}
+        );
+        resultLayer.addLayer(markName);
+
+        markName.on("mousemove", function () {
+            pop = L.popup({className:'div_tittle'})
+                .setLatLng([option.latitude,option.longitude])
+                .setContent(
+                    "<span class='slfh_tit'>救援物资</span>"+
+                    "<h4>设备编号:"+option.code+"</h4>"+
+                    "<p>物资名称:"+option.name+"</p>"+
+                    "<p>管理人:"+option.manager+"</p>"+
+                    "<p>采购人:"+option.purchase+"</p>"+
+                    "<p>保养周期:"+option.maintenance+"</p>"
+                ).openOn(map);
+        });
+        markName.on("mouseout", function () {
+            map.closePopup(pop);
+        });
+    }
+
+    /**
      * 查询所有瞭望塔mark
      * */
     function getLwtMarkers(){
@@ -647,6 +750,12 @@
                 case 'sxt':
                     getSxtMarkers();
                     break;
+                case 'sy':
+                    getSyMarkers();
+                    break;
+                case 'jywz':
+                    getJywzMarkers();
+                    break;
             }
         }
         //加载消防资源