فهرست منبع

派出所,摄像头

lchao 1 سال پیش
والد
کامیت
2f8663f6fc

+ 8 - 7
zhsq_qk-admin/src/main/java/zhsq_qk/web/controller/system/SysCameraController.java

@@ -18,6 +18,7 @@ import zhsq_qk.common.core.controller.BaseController;
 import zhsq_qk.common.core.domain.AjaxResult;
 import zhsq_qk.common.enums.BusinessType;
 import zhsq_qk.system.domain.SysCamera;
+import zhsq_qk.system.domain.SysCameraPolice;
 import zhsq_qk.system.service.ISysCameraService;
 import zhsq_qk.common.utils.poi.ExcelUtil;
 import zhsq_qk.common.core.page.TableDataInfo;
@@ -39,9 +40,9 @@ public class SysCameraController extends BaseController {
  */
 @PreAuthorize("@ss.hasPermi('system:camera:list')")
 @GetMapping("/list")
-    public TableDataInfo list(SysCamera sysCamera) {
+    public TableDataInfo list(SysCameraPolice sysCamera) {
         startPage();
-        List<SysCamera> list = sysCameraService.selectSysCameraList(sysCamera);
+        List<SysCameraPolice> list = sysCameraService.selectSysCameraList(sysCamera);
         return getDataTable(list);
     }
 
@@ -51,9 +52,9 @@ public class SysCameraController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:camera:export')")
     @Log(title = "摄像头", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysCamera sysCamera) {
-        List<SysCamera> list = sysCameraService.selectSysCameraList(sysCamera);
-        ExcelUtil<SysCamera> util = new ExcelUtil<SysCamera>(SysCamera. class);
+    public void export(HttpServletResponse response, SysCameraPolice sysCamera) {
+        List<SysCameraPolice> list = sysCameraService.selectSysCameraList(sysCamera);
+        ExcelUtil<SysCameraPolice> util = new ExcelUtil<SysCameraPolice>(SysCameraPolice. class);
         util.exportExcel(response, list, "摄像头数据");
     }
 
@@ -72,7 +73,7 @@ public class SysCameraController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:camera:add')")
     @Log(title = "摄像头", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody SysCamera sysCamera) {
+    public AjaxResult add(@RequestBody SysCameraPolice sysCamera) {
         return toAjax(sysCameraService.insertSysCamera(sysCamera));
     }
 
@@ -82,7 +83,7 @@ public class SysCameraController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:camera:edit')")
     @Log(title = "摄像头", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody SysCamera sysCamera) {
+    public AjaxResult edit(@RequestBody SysCameraPolice sysCamera) {
         return toAjax(sysCameraService.updateSysCamera(sysCamera));
     }
 

+ 107 - 0
zhsq_qk-admin/src/main/java/zhsq_qk/web/controller/system/SysPoliceStationController.java

@@ -0,0 +1,107 @@
+package zhsq_qk.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import zhsq_qk.common.annotation.Log;
+import zhsq_qk.common.core.controller.BaseController;
+import zhsq_qk.common.core.domain.AjaxResult;
+import zhsq_qk.common.enums.BusinessType;
+import zhsq_qk.system.domain.SysPoliceStation;
+import zhsq_qk.system.service.ISysPoliceStationService;
+import zhsq_qk.common.utils.poi.ExcelUtil;
+import zhsq_qk.common.core.page.TableDataInfo;
+
+/**
+ * 派出所管理Controller
+ *
+ * @author lc
+ * @date 2024-05-31
+ */
+@RestController
+@RequestMapping("/system/station")
+public class SysPoliceStationController extends BaseController {
+    @Autowired
+    private ISysPoliceStationService sysPoliceStationService;
+
+/**
+ * 查询派出所管理列表
+ */
+@PreAuthorize("@ss.hasPermi('system:station:list')")
+@GetMapping("/list")
+    public TableDataInfo list(SysPoliceStation sysPoliceStation) {
+        startPage();
+        List<SysPoliceStation> list = sysPoliceStationService.selectSysPoliceStationList(sysPoliceStation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出派出所管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:station:export')")
+    @Log(title = "派出所管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysPoliceStation sysPoliceStation) {
+        List<SysPoliceStation> list = sysPoliceStationService.selectSysPoliceStationList(sysPoliceStation);
+        ExcelUtil<SysPoliceStation> util = new ExcelUtil<SysPoliceStation>(SysPoliceStation. class);
+        util.exportExcel(response, list, "派出所管理数据");
+    }
+
+    /**
+     * 获取派出所管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:station:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(sysPoliceStationService.selectSysPoliceStationById(id));
+    }
+
+    /**
+     * 新增派出所管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:station:add')")
+    @Log(title = "派出所管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysPoliceStation sysPoliceStation) {
+        return toAjax(sysPoliceStationService.insertSysPoliceStation(sysPoliceStation));
+    }
+
+    /**
+     * 修改派出所管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:station:edit')")
+    @Log(title = "派出所管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysPoliceStation sysPoliceStation) {
+        return toAjax(sysPoliceStationService.updateSysPoliceStation(sysPoliceStation));
+    }
+
+    /**
+     * 删除派出所管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:station:remove')")
+    @Log(title = "派出所管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(sysPoliceStationService.deleteSysPoliceStationByIds(ids));
+    }
+
+    /**
+     * 查询派出所管理列表
+     */
+    @GetMapping("/allList")
+    public AjaxResult allList() {
+        List<SysPoliceStation> list = sysPoliceStationService.selectSysPoliceStationAllList();
+        return AjaxResult.success(list);
+    }
+}

+ 109 - 81
zhsq_qk-system/src/main/java/zhsq_qk/system/domain/SysCamera.java

@@ -11,85 +11,113 @@ import zhsq_qk.common.core.domain.BaseEntity;
  * @author lc
  * @date 2024-05-30
  */
-public class SysCamera extends BaseEntity
-        {
-private static final long serialVersionUID = 1L;
-
-        /** 主键id */
-        private Long id;
-
-        /** 归属派出所 */
-                @Excel(name = "归属派出所")
-        private String ascriptionStation;
-
-        /** 点位具体位置 */
-                @Excel(name = "点位具体位置")
-        private String address;
-
-        /** 经度 */
-                @Excel(name = "经度")
-        private String longitude;
-
-        /** 纬度 */
-                @Excel(name = "纬度")
-        private String latitude;
-
-        /** 类型 */
-                @Excel(name = "类型")
-        private String buildType;
-
-        public void setId(Long id) {
-            this.id = id;
-        }
-
-        public Long getId() {
-            return id;
-        }
-        public void setAscriptionStation(String ascriptionStation) {
-            this.ascriptionStation = ascriptionStation;
-        }
-
-        public String getAscriptionStation() {
-            return ascriptionStation;
-        }
-        public void setAddress(String address) {
-            this.address = address;
-        }
-
-        public String getAddress() {
-            return address;
-        }
-        public void setLongitude(String longitude) {
-            this.longitude = longitude;
-        }
-
-        public String getLongitude() {
-            return longitude;
-        }
-        public void setLatitude(String latitude) {
-            this.latitude = latitude;
-        }
-
-        public String getLatitude() {
-            return latitude;
-        }
-        public void setBuildType(String buildType) {
-            this.buildType = buildType;
-        }
-
-        public String getBuildType() {
-            return buildType;
-        }
-
-@Override
-public String toString() {
-    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-        .append("id", getId())
-        .append("ascriptionStation", getAscriptionStation())
-        .append("address", getAddress())
-        .append("longitude", getLongitude())
-        .append("latitude", getLatitude())
-        .append("buildType", getBuildType())
-            .toString();
-}
+public class SysCamera extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 归属派出所
+     */
+    @Excel(name = "归属派出所")
+    private String ascriptionStation;
+
+    /**
+     * 点位具体位置
+     */
+    @Excel(name = "点位具体位置")
+    private String address;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /**
+     * 类型
+     */
+    @Excel(name = "类型")
+    private String buildType;
+
+
+    private Long policeId;
+
+    public Long getPoliceId() {
+        return policeId;
+    }
+
+    public void setPoliceId(Long policeId) {
+        this.policeId = policeId;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setAscriptionStation(String ascriptionStation) {
+        this.ascriptionStation = ascriptionStation;
+    }
+
+    public String getAscriptionStation() {
+        return ascriptionStation;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setBuildType(String buildType) {
+        this.buildType = buildType;
+    }
+
+    public String getBuildType() {
+        return buildType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("ascriptionStation", getAscriptionStation())
+                .append("address", getAddress())
+                .append("longitude", getLongitude())
+                .append("latitude", getLatitude())
+                .append("buildType", getBuildType())
+                .append("policeId", getPoliceId())
+                .toString();
+    }
 }

+ 144 - 0
zhsq_qk-system/src/main/java/zhsq_qk/system/domain/SysCameraPolice.java

@@ -0,0 +1,144 @@
+package zhsq_qk.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import zhsq_qk.common.annotation.Excel;
+import zhsq_qk.common.core.domain.BaseEntity;
+
+/**
+ * 摄像头对象 sys_camera
+ *
+ * @author lc
+ * @date 2024-05-30
+ */
+public class SysCameraPolice extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 归属派出所
+     */
+    @Excel(name = "归属派出所")
+    private String ascriptionStation;
+
+    /**
+     * 点位具体位置
+     */
+    @Excel(name = "点位具体位置")
+    private String address;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /**
+     * 类型
+     */
+    @Excel(name = "类型")
+    private String buildType;
+
+    private String policeName;
+
+    public String getPoliceName() {
+        return policeName;
+    }
+
+    public void setPoliceName(String policeName) {
+        this.policeName = policeName;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public Long getPoliceId() {
+        return policeId;
+    }
+
+    public void setPoliceId(Long policeId) {
+        this.policeId = policeId;
+    }
+
+    private String position;
+
+    private Long policeId;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setAscriptionStation(String ascriptionStation) {
+        this.ascriptionStation = ascriptionStation;
+    }
+
+    public String getAscriptionStation() {
+        return ascriptionStation;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setBuildType(String buildType) {
+        this.buildType = buildType;
+    }
+
+    public String getBuildType() {
+        return buildType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("ascriptionStation", getAscriptionStation())
+                .append("address", getAddress())
+                .append("longitude", getLongitude())
+                .append("latitude", getLatitude())
+                .append("buildType", getBuildType())
+                .append("policeName", getPoliceName())
+                .append("position", getPosition())
+                .append("policeId", getPoliceId())
+                .toString();
+    }
+}

+ 71 - 0
zhsq_qk-system/src/main/java/zhsq_qk/system/domain/SysPoliceStation.java

@@ -0,0 +1,71 @@
+package zhsq_qk.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import zhsq_qk.common.annotation.Excel;
+import zhsq_qk.common.core.domain.BaseEntity;
+
+/**
+ * 派出所管理对象 sys_police_station
+ *
+ * @author lc
+ * @date 2024-05-31
+ */
+public class SysPoliceStation extends BaseEntity
+        {
+private static final long serialVersionUID = 1L;
+
+        /** 主键id */
+        private Long id;
+
+        /** 派出所名称 */
+                @Excel(name = "派出所名称")
+        private String policeName;
+
+        /** 地址 */
+                @Excel(name = "地址")
+        private String position;
+
+        /** 摄像头id */
+                @Excel(name = "摄像头id")
+        private Long cameraId;
+
+        public void setId(Long id) {
+            this.id = id;
+        }
+
+        public Long getId() {
+            return id;
+        }
+        public void setPoliceName(String policeName) {
+            this.policeName = policeName;
+        }
+
+        public String getPoliceName() {
+            return policeName;
+        }
+        public void setPosition(String position) {
+            this.position = position;
+        }
+
+        public String getPosition() {
+            return position;
+        }
+        public void setCameraId(Long cameraId) {
+            this.cameraId = cameraId;
+        }
+
+        public Long getCameraId() {
+            return cameraId;
+        }
+
+@Override
+public String toString() {
+    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+        .append("id", getId())
+        .append("policeName", getPoliceName())
+        .append("position", getPosition())
+        .append("cameraId", getCameraId())
+            .toString();
+}
+}

+ 7 - 4
zhsq_qk-system/src/main/java/zhsq_qk/system/mapper/SysCameraMapper.java

@@ -3,6 +3,7 @@ package zhsq_qk.system.mapper;
 import java.util.List;
 
 import zhsq_qk.system.domain.SysCamera;
+import zhsq_qk.system.domain.SysCameraPolice;
 
 /**
  * 摄像头Mapper接口
@@ -17,7 +18,7 @@ public interface SysCameraMapper {
      * @param id 摄像头主键
      * @return 摄像头
      */
-    public SysCamera selectSysCameraById(Long id);
+    public SysCameraPolice selectSysCameraById(Long id);
 
     /**
      * 查询摄像头列表
@@ -25,7 +26,7 @@ public interface SysCameraMapper {
      * @param sysCamera 摄像头
      * @return 摄像头集合
      */
-    public List<SysCamera> selectSysCameraList(SysCamera sysCamera);
+    public List<SysCameraPolice> selectSysCameraList(SysCameraPolice sysCamera);
 
     /**
      * 新增摄像头
@@ -33,7 +34,7 @@ public interface SysCameraMapper {
      * @param sysCamera 摄像头
      * @return 结果
      */
-    public int insertSysCamera(SysCamera sysCamera);
+    public int insertSysCamera(SysCameraPolice sysCamera);
 
     /**
      * 修改摄像头
@@ -41,7 +42,7 @@ public interface SysCameraMapper {
      * @param sysCamera 摄像头
      * @return 结果
      */
-    public int updateSysCamera(SysCamera sysCamera);
+    public int updateSysCamera(SysCameraPolice sysCamera);
 
     /**
      * 删除摄像头
@@ -51,6 +52,8 @@ public interface SysCameraMapper {
      */
     public int deleteSysCameraById(Long id);
 
+    List<SysCameraPolice> getAllList();
+
     /**
      * 批量删除摄像头
      *

+ 63 - 0
zhsq_qk-system/src/main/java/zhsq_qk/system/mapper/SysPoliceStationMapper.java

@@ -0,0 +1,63 @@
+package zhsq_qk.system.mapper;
+
+import java.util.List;
+
+import zhsq_qk.system.domain.SysPoliceStation;
+
+/**
+ * 派出所管理Mapper接口
+ *
+ * @author lc
+ * @date 2024-05-31
+ */
+public interface SysPoliceStationMapper {
+    /**
+     * 查询派出所管理
+     *
+     * @param id 派出所管理主键
+     * @return 派出所管理
+     */
+    public SysPoliceStation selectSysPoliceStationById(Long id);
+
+    /**
+     * 查询派出所管理列表
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 派出所管理集合
+     */
+    public List<SysPoliceStation> selectSysPoliceStationList(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 新增派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    public int insertSysPoliceStation(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 修改派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    public int updateSysPoliceStation(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 删除派出所管理
+     *
+     * @param id 派出所管理主键
+     * @return 结果
+     */
+    public int deleteSysPoliceStationById(Long id);
+
+    /**
+     * 批量删除派出所管理
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysPoliceStationByIds(Long[] ids);
+
+    List<SysPoliceStation> selectSysPoliceStationAllList();
+}

+ 5 - 4
zhsq_qk-system/src/main/java/zhsq_qk/system/service/ISysCameraService.java

@@ -3,6 +3,7 @@ package zhsq_qk.system.service;
 import java.util.List;
 
 import zhsq_qk.system.domain .SysCamera;
+import zhsq_qk.system.domain.SysCameraPolice;
 
 /**
  * 摄像头Service接口
@@ -17,7 +18,7 @@ public interface ISysCameraService {
      * @param id 摄像头主键
      * @return 摄像头
      */
-    public SysCamera selectSysCameraById(Long id);
+    public SysCameraPolice selectSysCameraById(Long id);
 
     /**
      * 查询摄像头列表
@@ -25,7 +26,7 @@ public interface ISysCameraService {
      * @param sysCamera 摄像头
      * @return 摄像头集合
      */
-    public List<SysCamera> selectSysCameraList(SysCamera sysCamera);
+    public List<SysCameraPolice> selectSysCameraList(SysCameraPolice sysCamera);
 
     /**
      * 新增摄像头
@@ -33,7 +34,7 @@ public interface ISysCameraService {
      * @param sysCamera 摄像头
      * @return 结果
      */
-    public int insertSysCamera(SysCamera sysCamera);
+    public int insertSysCamera(SysCameraPolice sysCamera);
 
     /**
      * 修改摄像头
@@ -41,7 +42,7 @@ public interface ISysCameraService {
      * @param sysCamera 摄像头
      * @return 结果
      */
-    public int updateSysCamera(SysCamera sysCamera);
+    public int updateSysCamera(SysCameraPolice sysCamera);
 
     /**
      * 批量删除摄像头

+ 63 - 0
zhsq_qk-system/src/main/java/zhsq_qk/system/service/ISysPoliceStationService.java

@@ -0,0 +1,63 @@
+package zhsq_qk.system.service;
+
+import java.util.List;
+
+import zhsq_qk.system.domain .SysPoliceStation;
+
+/**
+ * 派出所管理Service接口
+ *
+ * @author lc
+ * @date 2024-05-31
+ */
+public interface ISysPoliceStationService {
+    /**
+     * 查询派出所管理
+     *
+     * @param id 派出所管理主键
+     * @return 派出所管理
+     */
+    public SysPoliceStation selectSysPoliceStationById(Long id);
+
+    /**
+     * 查询派出所管理列表
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 派出所管理集合
+     */
+    public List<SysPoliceStation> selectSysPoliceStationList(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 新增派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    public int insertSysPoliceStation(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 修改派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    public int updateSysPoliceStation(SysPoliceStation sysPoliceStation);
+
+    /**
+     * 批量删除派出所管理
+     *
+     * @param ids 需要删除的派出所管理主键集合
+     * @return 结果
+     */
+    public int deleteSysPoliceStationByIds(Long[] ids);
+
+    /**
+     * 删除派出所管理信息
+     *
+     * @param id 派出所管理主键
+     * @return 结果
+     */
+    public int deleteSysPoliceStationById(Long id);
+
+    List<SysPoliceStation> selectSysPoliceStationAllList();
+}

+ 5 - 4
zhsq_qk-system/src/main/java/zhsq_qk/system/service/impl/SysCameraServiceImpl.java

@@ -3,6 +3,7 @@ package zhsq_qk.system.service.impl;
 import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import zhsq_qk.system.domain.SysCameraPolice;
 import zhsq_qk.system.mapper.SysCameraMapper;
 import zhsq_qk.system.domain.SysCamera;
 import zhsq_qk.system.service.ISysCameraService;
@@ -25,7 +26,7 @@ public class SysCameraServiceImpl implements ISysCameraService {
      * @return 摄像头
      */
     @Override
-    public SysCamera selectSysCameraById(Long id) {
+    public SysCameraPolice selectSysCameraById(Long id) {
         return sysCameraMapper.selectSysCameraById(id);
     }
 
@@ -36,7 +37,7 @@ public class SysCameraServiceImpl implements ISysCameraService {
      * @return 摄像头
      */
     @Override
-    public List<SysCamera> selectSysCameraList(SysCamera sysCamera) {
+    public List<SysCameraPolice> selectSysCameraList(SysCameraPolice sysCamera) {
         return sysCameraMapper.selectSysCameraList(sysCamera);
     }
 
@@ -47,7 +48,7 @@ public class SysCameraServiceImpl implements ISysCameraService {
      * @return 结果
      */
     @Override
-    public int insertSysCamera(SysCamera sysCamera) {
+    public int insertSysCamera(SysCameraPolice sysCamera) {
             return sysCameraMapper.insertSysCamera(sysCamera);
     }
 
@@ -58,7 +59,7 @@ public class SysCameraServiceImpl implements ISysCameraService {
      * @return 结果
      */
     @Override
-    public int updateSysCamera(SysCamera sysCamera) {
+    public int updateSysCamera(SysCameraPolice sysCamera) {
         return sysCameraMapper.updateSysCamera(sysCamera);
     }
 

+ 91 - 0
zhsq_qk-system/src/main/java/zhsq_qk/system/service/impl/SysPoliceStationServiceImpl.java

@@ -0,0 +1,91 @@
+package zhsq_qk.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import zhsq_qk.system.mapper.SysPoliceStationMapper;
+import zhsq_qk.system.domain.SysPoliceStation;
+import zhsq_qk.system.service.ISysPoliceStationService;
+
+/**
+ * 派出所管理Service业务层处理
+ *
+ * @author lc
+ * @date 2024-05-31
+ */
+@Service
+public class SysPoliceStationServiceImpl implements ISysPoliceStationService {
+    @Autowired
+    private SysPoliceStationMapper sysPoliceStationMapper;
+
+    /**
+     * 查询派出所管理
+     *
+     * @param id 派出所管理主键
+     * @return 派出所管理
+     */
+    @Override
+    public SysPoliceStation selectSysPoliceStationById(Long id) {
+        return sysPoliceStationMapper.selectSysPoliceStationById(id);
+    }
+
+    /**
+     * 查询派出所管理列表
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 派出所管理
+     */
+    @Override
+    public List<SysPoliceStation> selectSysPoliceStationList(SysPoliceStation sysPoliceStation) {
+        return sysPoliceStationMapper.selectSysPoliceStationList(sysPoliceStation);
+    }
+
+    /**
+     * 新增派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    @Override
+    public int insertSysPoliceStation(SysPoliceStation sysPoliceStation) {
+            return sysPoliceStationMapper.insertSysPoliceStation(sysPoliceStation);
+    }
+
+    /**
+     * 修改派出所管理
+     *
+     * @param sysPoliceStation 派出所管理
+     * @return 结果
+     */
+    @Override
+    public int updateSysPoliceStation(SysPoliceStation sysPoliceStation) {
+        return sysPoliceStationMapper.updateSysPoliceStation(sysPoliceStation);
+    }
+
+    /**
+     * 批量删除派出所管理
+     *
+     * @param ids 需要删除的派出所管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysPoliceStationByIds(Long[] ids) {
+        return sysPoliceStationMapper.deleteSysPoliceStationByIds(ids);
+    }
+
+    /**
+     * 删除派出所管理信息
+     *
+     * @param id 派出所管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysPoliceStationById(Long id) {
+        return sysPoliceStationMapper.deleteSysPoliceStationById(id);
+    }
+
+    @Override
+    public List<SysPoliceStation> selectSysPoliceStationAllList() {
+        return sysPoliceStationMapper.selectSysPoliceStationAllList();
+    }
+}

+ 100 - 61
zhsq_qk-system/src/main/resources/mapper/system/SysCameraMapper.xml

@@ -7,98 +7,137 @@
     <resultMap type="SysCamera" id="SysCameraResult">
             <result property="id" column="id"/>
             <result property="ascriptionStation" column="ascription_station"/>
+            <result property="policeId" column="police_id"/>
             <result property="address" column="address"/>
             <result property="longitude" column="longitude"/>
             <result property="latitude" column="latitude"/>
             <result property="buildType" column="build_type"/>
     </resultMap>
 
+    <resultMap type="SysCameraPolice" id="SysPoliceStationResult">
+        <result property="id" column="id"/>
+        <result property="policeId" column="police_id"/>
+        <result property="policeName" column="police_name"/>
+        <result property="position" column="position"/>
+        <result property="ascriptionStation" column="ascription_station"/>
+        <result property="address" column="address"/>
+        <result property="longitude" column="longitude"/>
+        <result property="latitude" column="latitude"/>
+        <result property="buildType" column="build_type"/>
+    </resultMap>
+
     <sql id="selectSysCameraVo">
         select id, ascription_station, address, longitude, latitude, build_type
         from sys_camera
     </sql>
 
-    <select id="selectSysCameraList" parameterType="SysCamera" resultMap="SysCameraResult">
-        <include refid="selectSysCameraVo"/>
+    <select id="selectSysCameraList"  resultMap="SysPoliceStationResult">
+        SELECT
+        a.id,
+        b.police_name,
+        a.ascription_station,
+        a.address,
+        a.longitude,
+        a.latitude,
+        a.build_type
+        FROM
+        sys_camera a
+        left join sys_police_station b on a.police_id = b.id
         <where>
-                        <if test="ascriptionStation != null  and ascriptionStation != ''">
-                            and ascription_station = #{ascriptionStation}
-                        </if>
-                        <if test="address != null  and address != ''">
-                            and address = #{address}
-                        </if>
-                        <if test="longitude != null  and longitude != ''">
-                            and longitude = #{longitude}
-                        </if>
-                        <if test="latitude != null  and latitude != ''">
-                            and latitude = #{latitude}
-                        </if>
-                        <if test="buildType != null  and buildType != ''">
-                            and build_type = #{buildType}
-                        </if>
+            <if test="ascriptionStation != null  and ascriptionStation != ''">
+                and ascription_station = #{ascriptionStation}
+            </if>
+            <if test="policeName != null ">and b.police_name = #{policeName}</if>
+            <if test="longitude != null  and longitude != ''">
+                and longitude = #{longitude}
+            </if>
+            <if test="latitude != null  and latitude != ''">
+                and latitude = #{latitude}
+            </if>
+            <if test="buildType != null  and buildType != ''">
+                and build_type = #{buildType}
+            </if>
         </where>
     </select>
 
-    <select id="selectSysCameraById" parameterType="Long"
-            resultMap="SysCameraResult">
-            <include refid="selectSysCameraVo"/>
-            where id = #{id}
+    <select id="selectSysCameraById" parameterType="Long" resultMap="SysPoliceStationResult">
+        SELECT
+            a.id,
+            b.police_name,
+            a.ascription_station,
+            a.address,
+            a.longitude,
+            a.latitude,
+            a.build_type
+        FROM
+            sys_camera a
+                left join sys_police_station b on a.police_id = b.id
+            where a.id = #{id}
     </select>
 
-    <insert id="insertSysCamera" parameterType="SysCamera">
+    <insert id="insertSysCamera" parameterType="SysCamera" useGeneratedKeys="true" keyProperty="id">
         insert into sys_camera
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="id != null">id,
-                    </if>
-                    <if test="ascriptionStation != null">ascription_station,
-                    </if>
-                    <if test="address != null">address,
-                    </if>
-                    <if test="longitude != null">longitude,
-                    </if>
-                    <if test="latitude != null">latitude,
-                    </if>
-                    <if test="buildType != null">build_type,
-                    </if>
+            <if test="id != null">id,
+            </if>
+            <if test="policeId != null">police_id,
+            </if>
+            <if test="ascriptionStation != null">ascription_station,
+            </if>
+            <if test="address != null">address,
+            </if>
+            <if test="longitude != null">longitude,
+            </if>
+            <if test="latitude != null">latitude,
+            </if>
+            <if test="buildType != null">build_type,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="id != null">#{id},
-                    </if>
-                    <if test="ascriptionStation != null">#{ascriptionStation},
-                    </if>
-                    <if test="address != null">#{address},
-                    </if>
-                    <if test="longitude != null">#{longitude},
-                    </if>
-                    <if test="latitude != null">#{latitude},
-                    </if>
-                    <if test="buildType != null">#{buildType},
-                    </if>
+            <if test="id != null">#{id},
+            </if>
+            <if test="policeId != null">#{policeId},
+            </if>
+            <if test="ascriptionStation != null">#{ascriptionStation},
+            </if>
+            <if test="address != null">#{address},
+            </if>
+            <if test="longitude != null">#{longitude},
+            </if>
+            <if test="latitude != null">#{latitude},
+            </if>
+            <if test="buildType != null">#{buildType},
+            </if>
         </trim>
     </insert>
 
     <update id="updateSysCamera" parameterType="SysCamera">
         update sys_camera
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="ascriptionStation != null">ascription_station =
-                        #{ascriptionStation},
-                    </if>
-                    <if test="address != null">address =
-                        #{address},
-                    </if>
-                    <if test="longitude != null">longitude =
-                        #{longitude},
-                    </if>
-                    <if test="latitude != null">latitude =
-                        #{latitude},
-                    </if>
-                    <if test="buildType != null">build_type =
-                        #{buildType},
-                    </if>
+            <if test="policeId != null">police_id = #{policeId},</if>
+            <if test="ascriptionStation != null">ascription_station =
+                #{ascriptionStation},
+            </if>
+            <if test="address != null">address =
+                #{address},
+            </if>
+            <if test="longitude != null">longitude =
+                #{longitude},
+            </if>
+            <if test="latitude != null">latitude =
+                #{latitude},
+            </if>
+            <if test="buildType != null">build_type =
+                #{buildType},
+            </if>
         </trim>
         where id = #{id}
     </update>
 
+    <select id="getAllList" resultMap="SysPoliceStationResult">
+        <include refid="selectSysCameraVo"/>
+    </select>
+
     <delete id="deleteSysCameraById" parameterType="Long">
         delete
         from sys_camera where id = #{id}

+ 95 - 0
zhsq_qk-system/src/main/resources/mapper/system/SysPoliceStationMapper.xml

@@ -0,0 +1,95 @@
+<?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="zhsq_qk.system.mapper.SysPoliceStationMapper">
+
+    <resultMap type="SysPoliceStation" id="SysPoliceStationResult">
+            <result property="id" column="id"/>
+            <result property="policeName" column="police_name"/>
+            <result property="position" column="position"/>
+            <result property="cameraId" column="camera_id"/>
+    </resultMap>
+
+    <sql id="selectSysPoliceStationVo">
+        select id, police_name, position, camera_id
+        from sys_police_station
+    </sql>
+
+    <select id="selectSysPoliceStationList" parameterType="SysPoliceStation" resultMap="SysPoliceStationResult">
+        <include refid="selectSysPoliceStationVo"/>
+        <where>
+                        <if test="policeName != null  and policeName != ''">
+                            and police_name like concat('%', #{policeName}, '%')
+                        </if>
+                        <if test="position != null  and position != ''">
+                            and position = #{position}
+                        </if>
+                        <if test="cameraId != null ">
+                            and camera_id = #{cameraId}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectSysPoliceStationById" parameterType="Long"
+            resultMap="SysPoliceStationResult">
+            <include refid="selectSysPoliceStationVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertSysPoliceStation" parameterType="SysPoliceStation">
+        insert into sys_police_station
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="policeName != null">police_name,
+                    </if>
+                    <if test="position != null">position,
+                    </if>
+                    <if test="cameraId != null">camera_id,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="policeName != null">#{policeName},
+                    </if>
+                    <if test="position != null">#{position},
+                    </if>
+                    <if test="cameraId != null">#{cameraId},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateSysPoliceStation" parameterType="SysPoliceStation">
+        update sys_police_station
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="policeName != null">police_name =
+                        #{policeName},
+                    </if>
+                    <if test="position != null">position =
+                        #{position},
+                    </if>
+                    <if test="cameraId != null">camera_id =
+                        #{cameraId},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysPoliceStationById" parameterType="Long">
+        delete
+        from sys_police_station where id = #{id}
+    </delete>
+
+    <delete id="deleteSysPoliceStationByIds" parameterType="String">
+        delete from sys_police_station where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectSysPoliceStationAllList" resultMap="SysPoliceStationResult">
+        select id, police_name from sys_police_station where id not in(select police_id from sys_camera)
+    </select>
+</mapper>

+ 51 - 0
zhsq_qk-ui/src/api/system/station.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询派出所管理列表
+export function listStation(query) {
+    return request({
+        url: '/system/station/list',
+        method: 'get',
+        params: query
+    })
+}
+
+// 查询派出所管理详细
+export function getStation(id) {
+    return request({
+        url: '/system/station/' + id,
+        method: 'get'
+    })
+}
+
+// 新增派出所管理
+export function addStation(data) {
+    return request({
+        url: '/system/station',
+        method: 'post',
+        data: data
+    })
+}
+
+// 修改派出所管理
+export function updateStation(data) {
+    return request({
+        url: '/system/station',
+        method: 'put',
+        data: data
+    })
+}
+
+// 删除派出所管理
+export function delStation(id) {
+    return request({
+        url: '/system/station/' + id,
+        method: 'delete'
+    })
+}
+
+export function listAllPolice() {
+  return request({
+    url: '/system/station/allList',
+    method: 'get'
+  })
+}

+ 7 - 7
zhsq_qk-ui/src/layout/components/Navbar.vue

@@ -8,15 +8,15 @@
 
     <div class="right-menu">
       <template v-if="device!=='mobile'">
-        <search id="header-search" class="right-menu-item"/>
+<!--        <search id="header-search" class="right-menu-item"/>-->
 
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
-          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect"/>
-        </el-tooltip>
+<!--        <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
+<!--          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect"/>-->
+<!--        </el-tooltip>-->
 
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
-          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect"/>
-        </el-tooltip>
+<!--        <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
+<!--          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect"/>-->
+<!--        </el-tooltip>-->
 
         <screenfull id="screenfull" class="right-menu-item hover-effect"/>
 

+ 31 - 6
zhsq_qk-ui/src/views/system/camera/index.vue

@@ -83,11 +83,11 @@
 
     <el-table v-loading="loading" :data="cameraList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="归属派出所" align="center" prop="ascriptionStation"/>
+      <el-table-column label="归属派出所" align="center" prop="policeName"/>
       <el-table-column label="点位具体位置" align="center" prop="address"/>
       <el-table-column label="经度" align="center" prop="longitude"/>
       <el-table-column label="纬度" align="center" prop="latitude"/>
-      <el-table-column label="状态" prop="buildType" width="100">
+      <el-table-column label="类型" prop="buildType" width="100">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.build_type" :value="scope.row.buildType"/>
         </template>
@@ -125,8 +125,15 @@
     <!-- 添加或修改摄像头对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="归属派出所" prop="ascriptionStation">
-          <el-input v-model="form.ascriptionStation" placeholder="请输入归属派出所"/>
+        <el-form-item label="归属派出所" prop="policeName">
+          <el-select v-model="form.policeName" filterable placeholder="请选择项目名称" @change="onChange">
+            <el-option
+              v-for="item in projectData"
+              :key="item.id"
+              :label="item.policeName"
+              :value="item.id">
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="点位具体位置" prop="address">
           <el-input v-model="form.address" placeholder="请输入点位具体位置"/>
@@ -157,7 +164,8 @@
 </template>
 
 <script>
-import {getCamera, listCamera,addCamera, delCamera, updateCamera} from "@/api/system//camera";
+import {getCamera, listCamera,addCamera, delCamera, updateCamera} from "@/api/system/camera";
+import {listAllPolice} from "@/api/system/station";
 
 export default {
   name: "Camera",
@@ -192,6 +200,7 @@ export default {
         latitude: null,
         buildType: null
       },
+      projectData: [],
       // 表单参数
       form: {},
       // 表单校验
@@ -200,6 +209,7 @@ export default {
   },
   created() {
     this.getList();
+    this.getProjectList();
   },
   methods: {
     /** 查询摄像头列表 */
@@ -211,6 +221,13 @@ export default {
         this.loading = false;
       });
     },
+    /** 查询派出所管理列表 */
+    getProjectList() {
+      this.loading = true;
+      listAllPolice().then(response => {
+        this.projectData = response.data;
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -220,7 +237,7 @@ export default {
     reset() {
       this.form = {
         id: null,
-        ascriptionStation: null,
+        projectName: null,
         address: null,
         longitude: null,
         latitude: null,
@@ -232,6 +249,7 @@ export default {
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
+      this.getProjectList();
     },
     /** 重置按钮操作 */
     resetQuery() {
@@ -260,6 +278,10 @@ export default {
         this.title = "修改摄像头";
       });
     },
+    onChange(e) {
+      this.form.policeId = e
+      this.form.policeName = this.projectData.find(item => item.id == e).policeName
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
@@ -269,12 +291,14 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.getProjectList();
             });
           } else {
             addCamera(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.getProjectList();
             });
           }
         }
@@ -287,6 +311,7 @@ export default {
         return delCamera(ids);
       }).then(() => {
         this.getList();
+        this.getProjectList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {
       });

+ 268 - 0
zhsq_qk-ui/src/views/system/station/index.vue

@@ -0,0 +1,268 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="派出所名称" prop="policeName">
+        <el-input
+          v-model="queryParams.policeName"
+          placeholder="请输入派出所名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="地址" prop="position">
+        <el-input
+          v-model="queryParams.position"
+          placeholder="请输入地址"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:station:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:station:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:station:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:station:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="stationList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="派出所名称" align="center" prop="policeName"/>
+      <el-table-column label="地址" align="center" prop="position"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:station:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:station:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改派出所管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="派出所名称" prop="policeName">
+          <el-input v-model="form.policeName" placeholder="请输入派出所名称"/>
+        </el-form-item>
+        <el-form-item label="地址" prop="position">
+          <el-input v-model="form.position" placeholder="请输入地址"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {getStation, listStation,addStation,updateStation,delStation} from "@/api/system/station";
+import {addCamera, delCamera, updateCamera} from "@/api/system/camera";
+
+export default {
+  name: "Station",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 派出所管理表格数据
+      stationList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        policeName: null,
+        position: null,
+        cameraId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询派出所管理列表 */
+    getList() {
+      this.loading = true;
+      listStation(this.queryParams).then(response => {
+        this.stationList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        policeName: null,
+        position: null,
+        cameraId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加派出所管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getStation(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改派出所管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateStation(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addStation(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除摄像头编号为"' + ids + '"的数据项?').then(function () {
+        return delStation(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/station/export', {
+        ...this.queryParams
+      }, `station_${new Date().getTime()}.xlsx`)
+    }
+  }
+}
+;
+</script>