wangzhe 4 rokov pred
rodič
commit
255c54ef5d

+ 8 - 0
mybusiness/src/main/java/com/business/slfh/manager/forestdevicemanager/domain/TResForestdevice.java

@@ -22,6 +22,14 @@ public class TResForestdevice extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    /** 经度 */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /** 纬度 */
+    @Excel(name = "纬度")
+    private String latitude;
+
     /** $column.columnComment */
     private String id;
     private List depts;

+ 22 - 9
mybusiness/src/main/java/com/business/slfh/manager/stationfiremanager/controller/TResStationfireController.java

@@ -12,6 +12,8 @@ import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.page.TableDataInfo;
 import com.sooka.common.enums.BusinessType;
 import com.sooka.common.utils.poi.ExcelUtil;
+import com.sooka.system.service.ISysConfigService;
+import com.sooka.system.service.ISysDictDataService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
@@ -37,6 +39,10 @@ public class TResStationfireController extends BaseController
 
     @Resource
     private ITResStationfireService tResStationfireService;
+    @Resource
+    private ISysConfigService iSysConfigService;
+    @Resource
+    private ISysDictDataService iSysDictDataService;
 
     //@RequiresPermissions("system:stationfire:view")
     @GetMapping()
@@ -118,15 +124,22 @@ public class TResStationfireController extends BaseController
     }
 
     /**
-     * 详情【请填写功能名称】
-     */
-    @GetMapping("/detail/{id}")
-    public String detail(@PathVariable("id") String id, ModelMap mmap)
-    {
-        TResStationfire tResStationfire = tResStationfireService.selectTResStationfireById(id);
-        mmap.put("tResStationfire", tResStationfire);
-        return prefix + "/detail";
-    }
+ * 详情【请填写功能名称】
+ */
+@GetMapping("/detail/{id}")
+public String detail(@PathVariable("id") String id, ModelMap mmap)
+{
+    TResStationfire tResStationfire = tResStationfireService.selectTResStationfireById(id);
+    mmap.put("tResStationfire", tResStationfire);
+    String basepath = iSysConfigService.selectConfigByKey("supmap_service_path");
+    String datapath = iSysConfigService.selectConfigByKey("supmap_service_data_path");
+    String centerPoint = iSysDictDataService.selectDictLabel("supermap_centerpoint", "supermap_centerpoint_7");
+    mmap.put("basepath", basepath);
+    mmap.put("datapath", datapath);
+    mmap.put("centerPoint", centerPoint);
+
+    return prefix + "/detail";
+}
 
     /**
      * 删除【请填写功能名称】

+ 36 - 0
mybusiness/src/main/resources/templates/business/manager/forestdevicemanager/add.html

@@ -41,6 +41,18 @@
                     <input maxlength="100" name="name" class="form-control" type="text">
                 </div>
             </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label" style="cursor: pointer" onclick="choseLatLng()">经度:</label>
+                <div class="col-sm-8">
+                    <input maxlength="100" name="longitude" id="longitude" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label" style="cursor: pointer" onclick="choseLatLng()">纬度:</label>
+                <div class="col-sm-8">
+                    <input maxlength="100" name="latitude" id="latitude" class="form-control" type="text" required>
+                </div>
+            </div>
             <div class="form-group">    
                 <label class="col-sm-3 control-label">所属部门:</label>
                 <div class="col-sm-8">
@@ -144,6 +156,30 @@
             minView: "month",
             autoclose: true
         });
+
+        function choseLatLng() {
+            var options = {
+                url: ctx + "business/manager/superMap/choseLatLng",
+                callBack: doLatLngSubmit
+            };
+            $.modal.openOptions(options);
+        }
+        function doLatLngSubmit(index, layero){
+
+            var body = layer.getChildFrame('body', index);
+            var longitude = body.find('#longitude').val();
+            var latitude = body.find('#latitude').val();
+
+            if (longitude.length === 0 || latitude.length === 0) {
+                $.modal.alertWarning("请选择坐标点");
+                return;
+            }
+
+            $("#longitude").val(longitude);
+            $("#latitude").val(latitude);
+
+            layer.close(index);
+        }
     </script>
 </body>
 </html>

+ 37 - 1
mybusiness/src/main/resources/templates/business/manager/forestdevicemanager/edit.html

@@ -30,8 +30,20 @@
                     <input maxlength="100" name="name" th:field="*{name}" class="form-control" type="text">
                 </div>
             </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label" style="cursor: pointer" onclick="choseLatLng()">经度:</label>
+                <div class="col-sm-8">
+                    <input maxlength="100" name="longitude" id="longitude" th:field="*{longitude}" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label" style="cursor: pointer" onclick="choseLatLng()">纬度:</label>
+                <div class="col-sm-8">
+                    <input maxlength="100" name="latitude" id="latitude" th:field="*{latitude}" class="form-control" type="text" required>
+                </div>
+            </div>
             <div class="form-group">    
-                <label class="col-sm-3 control-label">所属部门id:</label>
+                <label class="col-sm-3 control-label">所属部门:</label>
                 <div class="col-sm-8">
                     <!--<input name="deptId" th:field="*{deptId}" class="form-control" type="text">-->
                     <select name="deptId" class="form-control m-b" th:with="type=${sysDeptList}">
@@ -133,6 +145,30 @@
             minView: "month",
             autoclose: true
         });
+
+        function choseLatLng() {
+            var options = {
+                url: ctx + "business/manager/superMap/choseLatLng",
+                callBack: doLatLngSubmit
+            };
+            $.modal.openOptions(options);
+        }
+        function doLatLngSubmit(index, layero){
+
+            var body = layer.getChildFrame('body', index);
+            var longitude = body.find('#longitude').val();
+            var latitude = body.find('#latitude').val();
+
+            if (longitude.length === 0 || latitude.length === 0) {
+                $.modal.alertWarning("请选择坐标点");
+                return;
+            }
+
+            $("#longitude").val(longitude);
+            $("#latitude").val(latitude);
+
+            layer.close(index);
+        }
     </script>
 </body>
 </html>