Browse Source

+ bd 围栏闯禁事件,bd 围栏绘制

chen.cheng 9 months ago
parent
commit
f95179ddfb

+ 95 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bd/BdFenceInfoController.java

@@ -0,0 +1,95 @@
+package com.ruoyi.web.controller.bd;
+
+import com.ruoyi.bd.domain.BdFenceInfo;
+import com.ruoyi.bd.service.IBdFenceInfoService;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 围栏基础信息Controller
+ *
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+@RestController
+@RequestMapping("/bd/fenceInfo")
+@CrossOrigin
+@Anonymous
+public class BdFenceInfoController extends BaseController {
+    @Autowired
+    private IBdFenceInfoService bdFenceInfoService;
+
+    /**
+     * 查询围栏基础信息列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(BdFenceInfo bdFenceInfo) {
+        startPage();
+        List<BdFenceInfo> list = bdFenceInfoService.selectBdFenceInfoList(bdFenceInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出围栏基础信息列表
+     */
+    @Log(title = "围栏基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BdFenceInfo bdFenceInfo) {
+        List<BdFenceInfo> list = bdFenceInfoService.selectBdFenceInfoList(bdFenceInfo);
+        ExcelUtil<BdFenceInfo> util = new ExcelUtil<BdFenceInfo>(BdFenceInfo.class);
+        util.exportExcel(response, list, "围栏基础信息数据");
+    }
+
+    /**
+     * 获取围栏基础信息详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(bdFenceInfoService.selectBdFenceInfoById(id));
+    }
+
+    /**
+     * 新增围栏基础信息
+     */
+    @Log(title = "围栏基础信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BdFenceInfo bdFenceInfo) {
+        return toAjax(bdFenceInfoService.insertBdFenceInfo(bdFenceInfo));
+    }
+
+    /**
+     * 修改围栏基础信息
+     */
+    @Log(title = "围栏基础信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BdFenceInfo bdFenceInfo) {
+        return toAjax(bdFenceInfoService.updateBdFenceInfo(bdFenceInfo));
+    }
+
+    /**
+     * 删除围栏基础信息
+     */
+    @Log(title = "围栏基础信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(bdFenceInfoService.deleteBdFenceInfoByIds(ids));
+    }
+}

+ 95 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bd/BdFenceVioEvtController.java

@@ -0,0 +1,95 @@
+package com.ruoyi.web.controller.bd;
+
+import com.ruoyi.bd.domain.BdFenceVioEvt;
+import com.ruoyi.bd.service.IBdFenceVioEvtService;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 围栏闯禁事件Controller
+ *
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+@RestController
+@RequestMapping("/bd/fenceVioEvt")
+@CrossOrigin
+@Anonymous
+public class BdFenceVioEvtController extends BaseController {
+    @Autowired
+    private IBdFenceVioEvtService bdFenceVioEvtService;
+
+    /**
+     * 查询围栏闯禁事件列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(BdFenceVioEvt bdFenceVioEvt) {
+        startPage();
+        List<BdFenceVioEvt> list = bdFenceVioEvtService.selectBdFenceVioEvtList(bdFenceVioEvt);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出围栏闯禁事件列表
+     */
+    @Log(title = "围栏闯禁事件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BdFenceVioEvt bdFenceVioEvt) {
+        List<BdFenceVioEvt> list = bdFenceVioEvtService.selectBdFenceVioEvtList(bdFenceVioEvt);
+        ExcelUtil<BdFenceVioEvt> util = new ExcelUtil<BdFenceVioEvt>(BdFenceVioEvt.class);
+        util.exportExcel(response, list, "围栏闯禁事件数据");
+    }
+
+    /**
+     * 获取围栏闯禁事件详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(bdFenceVioEvtService.selectBdFenceVioEvtById(id));
+    }
+
+    /**
+     * 新增围栏闯禁事件
+     */
+    @Log(title = "围栏闯禁事件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BdFenceVioEvt bdFenceVioEvt) {
+        return toAjax(bdFenceVioEvtService.insertBdFenceVioEvt(bdFenceVioEvt));
+    }
+
+    /**
+     * 修改围栏闯禁事件
+     */
+    @Log(title = "围栏闯禁事件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BdFenceVioEvt bdFenceVioEvt) {
+        return toAjax(bdFenceVioEvtService.updateBdFenceVioEvt(bdFenceVioEvt));
+    }
+
+    /**
+     * 删除围栏闯禁事件
+     */
+    @Log(title = "围栏闯禁事件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(bdFenceVioEvtService.deleteBdFenceVioEvtByIds(ids));
+    }
+}

+ 3 - 3
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java

@@ -11,7 +11,7 @@ import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
 
 /**
  * 自定义导出Excel数据注解
- * 
+ *
  * @author ruoyi
  */
 @Retention(RetentionPolicy.RUNTIME)
@@ -49,7 +49,7 @@ public @interface Excel
     public String separator() default ",";
 
     /**
-     * BigDecimal 度 默认:-1(默认不开启BigDecimal格式化)
+     * BigDecimal 度 默认:-1(默认不开启BigDecimal格式化)
      */
     public int scale() default -1;
 
@@ -189,4 +189,4 @@ public @interface Excel
             return this.value;
         }
     }
-}
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/domain/BdFenceInfo.java

@@ -0,0 +1,96 @@
+package com.ruoyi.bd.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 围栏基础信息对象 bd_fence_info
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public class BdFenceInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long id;
+
+    /** 围栏名称 */
+    @Excel(name = "围栏名称")
+    private String defenceName;
+
+    /** 围栏图形坐标 */
+    private String poly;
+
+    /** 中心点 */
+    @Excel(name = "中心点")
+    private Double centerLng;
+
+    /** 中心点 */
+    @Excel(name = "中心点")
+    private Double centerLat;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDefenceName(String defenceName) 
+    {
+        this.defenceName = defenceName;
+    }
+
+    public String getDefenceName() 
+    {
+        return defenceName;
+    }
+    public void setPoly(String poly) 
+    {
+        this.poly = poly;
+    }
+
+    public String getPoly() 
+    {
+        return poly;
+    }
+    public void setCenterLng(Double centerLng) 
+    {
+        this.centerLng = centerLng;
+    }
+
+    public Double getCenterLng() 
+    {
+        return centerLng;
+    }
+    public void setCenterLat(Double centerLat) 
+    {
+        this.centerLat = centerLat;
+    }
+
+    public Double getCenterLat() 
+    {
+        return centerLat;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("defenceName", getDefenceName())
+            .append("poly", getPoly())
+            .append("centerLng", getCenterLng())
+            .append("centerLat", getCenterLat())
+            .append("updateTime", getUpdateTime())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateBy", getUpdateBy())
+            .toString();
+    }
+}

+ 126 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/domain/BdFenceVioEvt.java

@@ -0,0 +1,126 @@
+package com.ruoyi.bd.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 围栏闯禁事件对象 bd_fence_vio_evt
+ *
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public class BdFenceVioEvt extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long id;
+
+    /**  */
+    @Excel(name = "")
+    private String evtKey;
+
+    /** 事件类型
+01 围栏闯禁事件 */
+    @Excel(name = "事件类型01 围栏闯禁事件")
+    private String evtType;
+
+    /** 事件描述 */
+    @Excel(name = "事件描述")
+    private String evtDesc;
+
+    /** 经度 */
+    @Excel(name = "经度")
+    private Double lng;
+
+    /** 维度 */
+    @Excel(name = "维度")
+    private Double lat;
+
+    /** 围栏id */
+    @Excel(name = "围栏id")
+    private Long fenceId;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setEvtKey(String evtKey)
+    {
+        this.evtKey = evtKey;
+    }
+
+    public String getEvtKey()
+    {
+        return evtKey;
+    }
+    public void setEvtType(String evtType)
+    {
+        this.evtType = evtType;
+    }
+
+    public String getEvtType()
+    {
+        return evtType;
+    }
+    public void setEvtDesc(String evtDesc)
+    {
+        this.evtDesc = evtDesc;
+    }
+
+    public String getEvtDesc()
+    {
+        return evtDesc;
+    }
+    public void setLng(Double lng)
+    {
+        this.lng = lng;
+    }
+
+    public Double getLng()
+    {
+        return lng;
+    }
+    public void setLat(Double lat)
+    {
+        this.lat = lat;
+    }
+
+    public Double getLat()
+    {
+        return lat;
+    }
+    public void setFenceId(Long fenceId)
+    {
+        this.fenceId = fenceId;
+    }
+
+    public Long getFenceId()
+    {
+        return fenceId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("evtKey", getEvtKey())
+            .append("evtType", getEvtType())
+            .append("evtDesc", getEvtDesc())
+            .append("lng", getLng())
+            .append("lat", getLat())
+            .append("fenceId", getFenceId())
+            .append("updateTime", getUpdateTime())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateBy", getUpdateBy())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/mapper/BdFenceInfoMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.bd.mapper;
+
+import java.util.List;
+import com.ruoyi.bd.domain.BdFenceInfo;
+
+/**
+ * 围栏基础信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public interface BdFenceInfoMapper 
+{
+    /**
+     * 查询围栏基础信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 围栏基础信息
+     */
+    public BdFenceInfo selectBdFenceInfoById(Long id);
+
+    /**
+     * 查询围栏基础信息列表
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 围栏基础信息集合
+     */
+    public List<BdFenceInfo> selectBdFenceInfoList(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 新增围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    public int insertBdFenceInfo(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 修改围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    public int updateBdFenceInfo(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 删除围栏基础信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 结果
+     */
+    public int deleteBdFenceInfoById(Long id);
+
+    /**
+     * 批量删除围栏基础信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBdFenceInfoByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/mapper/BdFenceVioEvtMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.bd.mapper;
+
+import java.util.List;
+import com.ruoyi.bd.domain.BdFenceVioEvt;
+
+/**
+ * 围栏闯禁事件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public interface BdFenceVioEvtMapper 
+{
+    /**
+     * 查询围栏闯禁事件
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 围栏闯禁事件
+     */
+    public BdFenceVioEvt selectBdFenceVioEvtById(Long id);
+
+    /**
+     * 查询围栏闯禁事件列表
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 围栏闯禁事件集合
+     */
+    public List<BdFenceVioEvt> selectBdFenceVioEvtList(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 新增围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    public int insertBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 修改围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    public int updateBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 删除围栏闯禁事件
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 结果
+     */
+    public int deleteBdFenceVioEvtById(Long id);
+
+    /**
+     * 批量删除围栏闯禁事件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBdFenceVioEvtByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/service/IBdFenceInfoService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.bd.service;
+
+import java.util.List;
+import com.ruoyi.bd.domain.BdFenceInfo;
+
+/**
+ * 围栏基础信息Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public interface IBdFenceInfoService 
+{
+    /**
+     * 查询围栏基础信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 围栏基础信息
+     */
+    public BdFenceInfo selectBdFenceInfoById(Long id);
+
+    /**
+     * 查询围栏基础信息列表
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 围栏基础信息集合
+     */
+    public List<BdFenceInfo> selectBdFenceInfoList(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 新增围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    public int insertBdFenceInfo(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 修改围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    public int updateBdFenceInfo(BdFenceInfo bdFenceInfo);
+
+    /**
+     * 批量删除围栏基础信息
+     * 
+     * @param ids 需要删除的围栏基础信息主键集合
+     * @return 结果
+     */
+    public int deleteBdFenceInfoByIds(Long[] ids);
+
+    /**
+     * 删除围栏基础信息信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 结果
+     */
+    public int deleteBdFenceInfoById(Long id);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/service/IBdFenceVioEvtService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.bd.service;
+
+import java.util.List;
+import com.ruoyi.bd.domain.BdFenceVioEvt;
+
+/**
+ * 围栏闯禁事件Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+public interface IBdFenceVioEvtService 
+{
+    /**
+     * 查询围栏闯禁事件
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 围栏闯禁事件
+     */
+    public BdFenceVioEvt selectBdFenceVioEvtById(Long id);
+
+    /**
+     * 查询围栏闯禁事件列表
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 围栏闯禁事件集合
+     */
+    public List<BdFenceVioEvt> selectBdFenceVioEvtList(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 新增围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    public int insertBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 修改围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    public int updateBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt);
+
+    /**
+     * 批量删除围栏闯禁事件
+     * 
+     * @param ids 需要删除的围栏闯禁事件主键集合
+     * @return 结果
+     */
+    public int deleteBdFenceVioEvtByIds(Long[] ids);
+
+    /**
+     * 删除围栏闯禁事件信息
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 结果
+     */
+    public int deleteBdFenceVioEvtById(Long id);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/service/impl/BdFenceInfoServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.bd.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.bd.mapper.BdFenceInfoMapper;
+import com.ruoyi.bd.domain.BdFenceInfo;
+import com.ruoyi.bd.service.IBdFenceInfoService;
+
+/**
+ * 围栏基础信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+@Service
+public class BdFenceInfoServiceImpl implements IBdFenceInfoService 
+{
+    @Autowired
+    private BdFenceInfoMapper bdFenceInfoMapper;
+
+    /**
+     * 查询围栏基础信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 围栏基础信息
+     */
+    @Override
+    public BdFenceInfo selectBdFenceInfoById(Long id)
+    {
+        return bdFenceInfoMapper.selectBdFenceInfoById(id);
+    }
+
+    /**
+     * 查询围栏基础信息列表
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 围栏基础信息
+     */
+    @Override
+    public List<BdFenceInfo> selectBdFenceInfoList(BdFenceInfo bdFenceInfo)
+    {
+        return bdFenceInfoMapper.selectBdFenceInfoList(bdFenceInfo);
+    }
+
+    /**
+     * 新增围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    @Override
+    public int insertBdFenceInfo(BdFenceInfo bdFenceInfo)
+    {
+        bdFenceInfo.setCreateTime(DateUtils.getNowDate());
+        return bdFenceInfoMapper.insertBdFenceInfo(bdFenceInfo);
+    }
+
+    /**
+     * 修改围栏基础信息
+     * 
+     * @param bdFenceInfo 围栏基础信息
+     * @return 结果
+     */
+    @Override
+    public int updateBdFenceInfo(BdFenceInfo bdFenceInfo)
+    {
+        bdFenceInfo.setUpdateTime(DateUtils.getNowDate());
+        return bdFenceInfoMapper.updateBdFenceInfo(bdFenceInfo);
+    }
+
+    /**
+     * 批量删除围栏基础信息
+     * 
+     * @param ids 需要删除的围栏基础信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBdFenceInfoByIds(Long[] ids)
+    {
+        return bdFenceInfoMapper.deleteBdFenceInfoByIds(ids);
+    }
+
+    /**
+     * 删除围栏基础信息信息
+     * 
+     * @param id 围栏基础信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBdFenceInfoById(Long id)
+    {
+        return bdFenceInfoMapper.deleteBdFenceInfoById(id);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/bd/service/impl/BdFenceVioEvtServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.bd.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.bd.mapper.BdFenceVioEvtMapper;
+import com.ruoyi.bd.domain.BdFenceVioEvt;
+import com.ruoyi.bd.service.IBdFenceVioEvtService;
+
+/**
+ * 围栏闯禁事件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-10-14
+ */
+@Service
+public class BdFenceVioEvtServiceImpl implements IBdFenceVioEvtService 
+{
+    @Autowired
+    private BdFenceVioEvtMapper bdFenceVioEvtMapper;
+
+    /**
+     * 查询围栏闯禁事件
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 围栏闯禁事件
+     */
+    @Override
+    public BdFenceVioEvt selectBdFenceVioEvtById(Long id)
+    {
+        return bdFenceVioEvtMapper.selectBdFenceVioEvtById(id);
+    }
+
+    /**
+     * 查询围栏闯禁事件列表
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 围栏闯禁事件
+     */
+    @Override
+    public List<BdFenceVioEvt> selectBdFenceVioEvtList(BdFenceVioEvt bdFenceVioEvt)
+    {
+        return bdFenceVioEvtMapper.selectBdFenceVioEvtList(bdFenceVioEvt);
+    }
+
+    /**
+     * 新增围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    @Override
+    public int insertBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt)
+    {
+        bdFenceVioEvt.setCreateTime(DateUtils.getNowDate());
+        return bdFenceVioEvtMapper.insertBdFenceVioEvt(bdFenceVioEvt);
+    }
+
+    /**
+     * 修改围栏闯禁事件
+     * 
+     * @param bdFenceVioEvt 围栏闯禁事件
+     * @return 结果
+     */
+    @Override
+    public int updateBdFenceVioEvt(BdFenceVioEvt bdFenceVioEvt)
+    {
+        bdFenceVioEvt.setUpdateTime(DateUtils.getNowDate());
+        return bdFenceVioEvtMapper.updateBdFenceVioEvt(bdFenceVioEvt);
+    }
+
+    /**
+     * 批量删除围栏闯禁事件
+     * 
+     * @param ids 需要删除的围栏闯禁事件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBdFenceVioEvtByIds(Long[] ids)
+    {
+        return bdFenceVioEvtMapper.deleteBdFenceVioEvtByIds(ids);
+    }
+
+    /**
+     * 删除围栏闯禁事件信息
+     * 
+     * @param id 围栏闯禁事件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBdFenceVioEvtById(Long id)
+    {
+        return bdFenceVioEvtMapper.deleteBdFenceVioEvtById(id);
+    }
+}

+ 84 - 0
ruoyi-system/src/main/resources/mapper/bd/BdFenceInfoMapper.xml

@@ -0,0 +1,84 @@
+<?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="com.ruoyi.bd.mapper.BdFenceInfoMapper">
+    
+    <resultMap type="BdFenceInfo" id="BdFenceInfoResult">
+        <result property="id"    column="id"    />
+        <result property="defenceName"    column="defence_name"    />
+        <result property="poly"    column="poly"    />
+        <result property="centerLng"    column="center_lng"    />
+        <result property="centerLat"    column="center_lat"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectBdFenceInfoVo">
+        select id, defence_name, poly, center_lng, center_lat, update_time, create_time, create_by, update_by from bd_fence_info
+    </sql>
+
+    <select id="selectBdFenceInfoList" parameterType="BdFenceInfo" resultMap="BdFenceInfoResult">
+        <include refid="selectBdFenceInfoVo"/>
+        <where>  
+            <if test="defenceName != null  and defenceName != ''"> and defence_name like concat('%', #{defenceName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectBdFenceInfoById" parameterType="Long" resultMap="BdFenceInfoResult">
+        <include refid="selectBdFenceInfoVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBdFenceInfo" parameterType="BdFenceInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into bd_fence_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="defenceName != null">defence_name,</if>
+            <if test="poly != null">poly,</if>
+            <if test="centerLng != null">center_lng,</if>
+            <if test="centerLat != null">center_lat,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="defenceName != null">#{defenceName},</if>
+            <if test="poly != null">#{poly},</if>
+            <if test="centerLng != null">#{centerLng},</if>
+            <if test="centerLat != null">#{centerLat},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBdFenceInfo" parameterType="BdFenceInfo">
+        update bd_fence_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="defenceName != null">defence_name = #{defenceName},</if>
+            <if test="poly != null">poly = #{poly},</if>
+            <if test="centerLng != null">center_lng = #{centerLng},</if>
+            <if test="centerLat != null">center_lat = #{centerLat},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBdFenceInfoById" parameterType="Long">
+        delete from bd_fence_info where id = #{id}
+    </delete>
+
+    <delete id="deleteBdFenceInfoByIds" parameterType="String">
+        delete from bd_fence_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 93 - 0
ruoyi-system/src/main/resources/mapper/bd/BdFenceVioEvtMapper.xml

@@ -0,0 +1,93 @@
+<?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="com.ruoyi.bd.mapper.BdFenceVioEvtMapper">
+    
+    <resultMap type="BdFenceVioEvt" id="BdFenceVioEvtResult">
+        <result property="id"    column="id"    />
+        <result property="evtKey"    column="evt_key"    />
+        <result property="evtType"    column="evt_type"    />
+        <result property="evtDesc"    column="evt_desc"    />
+        <result property="lng"    column="lng"    />
+        <result property="lat"    column="lat"    />
+        <result property="fenceId"    column="fence_id"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectBdFenceVioEvtVo">
+        select id, evt_key, evt_type, evt_desc, lng, lat, fence_id, update_time, create_time, create_by, update_by from bd_fence_vio_evt
+    </sql>
+
+    <select id="selectBdFenceVioEvtList" parameterType="BdFenceVioEvt" resultMap="BdFenceVioEvtResult">
+        <include refid="selectBdFenceVioEvtVo"/>
+        <where>  
+            <if test="evtType != null  and evtType != ''"> and evt_type = #{evtType}</if>
+            <if test="evtDesc != null  and evtDesc != ''"> and evt_desc = #{evtDesc}</if>
+        </where>
+    </select>
+    
+    <select id="selectBdFenceVioEvtById" parameterType="Long" resultMap="BdFenceVioEvtResult">
+        <include refid="selectBdFenceVioEvtVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBdFenceVioEvt" parameterType="BdFenceVioEvt" useGeneratedKeys="true" keyProperty="id">
+        insert into bd_fence_vio_evt
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="evtKey != null">evt_key,</if>
+            <if test="evtType != null">evt_type,</if>
+            <if test="evtDesc != null">evt_desc,</if>
+            <if test="lng != null">lng,</if>
+            <if test="lat != null">lat,</if>
+            <if test="fenceId != null">fence_id,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="evtKey != null">#{evtKey},</if>
+            <if test="evtType != null">#{evtType},</if>
+            <if test="evtDesc != null">#{evtDesc},</if>
+            <if test="lng != null">#{lng},</if>
+            <if test="lat != null">#{lat},</if>
+            <if test="fenceId != null">#{fenceId},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBdFenceVioEvt" parameterType="BdFenceVioEvt">
+        update bd_fence_vio_evt
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="evtKey != null">evt_key = #{evtKey},</if>
+            <if test="evtType != null">evt_type = #{evtType},</if>
+            <if test="evtDesc != null">evt_desc = #{evtDesc},</if>
+            <if test="lng != null">lng = #{lng},</if>
+            <if test="lat != null">lat = #{lat},</if>
+            <if test="fenceId != null">fence_id = #{fenceId},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBdFenceVioEvtById" parameterType="Long">
+        delete from bd_fence_vio_evt where id = #{id}
+    </delete>
+
+    <delete id="deleteBdFenceVioEvtByIds" parameterType="String">
+        delete from bd_fence_vio_evt where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
ruoyi-ui/src/api/bd/fenceInfo.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询围栏基础信息列表
+export function listFenceInfo(query) {
+  return request({
+    url: '/bd/fenceInfo/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询围栏基础信息详细
+export function getFenceInfo(id) {
+  return request({
+    url: '/bd/fenceInfo/' + id,
+    method: 'get'
+  })
+}
+
+// 新增围栏基础信息
+export function addFenceInfo(data) {
+  return request({
+    url: '/bd/fenceInfo',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改围栏基础信息
+export function updateFenceInfo(data) {
+  return request({
+    url: '/bd/fenceInfo',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除围栏基础信息
+export function delFenceInfo(id) {
+  return request({
+    url: '/bd/fenceInfo/' + id,
+    method: 'delete'
+  })
+}

+ 44 - 0
ruoyi-ui/src/api/bd/fenceVioEvt.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询围栏闯禁事件列表
+export function listFenceVioEvt(query) {
+  return request({
+    url: '/bd/fenceVioEvt/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询围栏闯禁事件详细
+export function getFenceVioEvt(id) {
+  return request({
+    url: '/bd/fenceVioEvt/' + id,
+    method: 'get'
+  })
+}
+
+// 新增围栏闯禁事件
+export function addFenceVioEvt(data) {
+  return request({
+    url: '/bd/fenceVioEvt',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改围栏闯禁事件
+export function updateFenceVioEvt(data) {
+  return request({
+    url: '/bd/fenceVioEvt',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除围栏闯禁事件
+export function delFenceVioEvt(id) {
+  return request({
+    url: '/bd/fenceVioEvt/' + id,
+    method: 'delete'
+  })
+}

+ 24 - 4
ruoyi-ui/src/views/bd/fence/index.vue

@@ -76,6 +76,7 @@
 
 <script>
 
+import { addFenceInfo, updateFenceInfo } from '@/api/bd/fenceInfo';
 import Pannel from '@/views/bd/pannel/index.vue';
 // this.drawtool = new BDLayers.Lib.Tools.CBDrawTool('mytool', this.mapView, 'Rectangle', true); // 绘制矩形,参数1:id,参数2:地图,参数3:绘制类型,参数4:是否可拖拽编辑
 // this.drawtool.enable(); // 开始绘制
@@ -221,10 +222,21 @@ export default {
           });
           resultCoor.push(resultCoor[0]);
           this.form.poly = `POLYGON((${resultCoor.join(',')}))`;
-          this.$message({
-            type: 'success',
-            message: '保存!',
-          });
+          if (!this.form.id) {
+            addFenceInfo(this.formatParams(this.form)).then(response => {
+              this.$message({
+                type: 'success',
+                message: '围栏保存成功',
+              });
+            });
+          } else {
+            updateFenceInfo(this.formatParams(this.form)).then(response => {
+              this.$message({
+                type: 'success',
+                message: '围栏编辑成功',
+              });
+            });
+          }
           this.dialogVisible = false;
           this.drawtool.clear();
           const polygon = this.drawPoly({
@@ -237,11 +249,19 @@ export default {
           this.layer.addGeometry(polygon);
           this.editingDrawGeom = null;
           this.editState = false;
+          this.$refs.form.resetFields();
         } else {
           return false;
         }
       });
     },
+    formatParams(form) {
+      return {
+        ...form,
+        defenceName: this.form.name,
+        poly: this.form.poly,
+      };
+    },
     startDraw() {
       this.editingDrawGeom = null;
       this.drawState = true;

+ 265 - 0
ruoyi-ui/src/views/bdspace/fenceInfo/index.vue

@@ -0,0 +1,265 @@
+<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="defenceName">
+        <el-input
+            v-model="queryParams.defenceName"
+            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="['bd:fenceInfo: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="['bd:fenceInfo: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="['bd:fenceInfo: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="['bd:fenceInfo:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fenceInfoList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="" align="center" prop="id" />
+      <el-table-column label="围栏名称" align="center" prop="defenceName" />
+      <el-table-column label="中心点" align="center" prop="centerLng" />
+      <el-table-column label="中心点" align="center" prop="centerLat" />
+      <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="['bd:fenceInfo:edit']"
+          >修改
+          </el-button>
+          <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['bd:fenceInfo: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="80px">
+        <el-form-item label="围栏名称" prop="defenceName">
+          <el-input v-model="form.defenceName" placeholder="请输入围栏名称" />
+        </el-form-item>
+        <el-form-item label="中心点" prop="centerLng">
+          <el-input v-model="form.centerLng" placeholder="请输入中心点" />
+        </el-form-item>
+        <el-form-item label="中心点" prop="centerLat">
+          <el-input v-model="form.centerLat" 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 { addFenceInfo, delFenceInfo, getFenceInfo, listFenceInfo, updateFenceInfo } from '@/api/bd/fenceInfo';
+
+export default {
+  name: 'FenceInfo',
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 围栏基础信息表格数据
+      fenceInfoList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        defenceName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询围栏基础信息列表 */
+    getList() {
+      this.loading = true;
+      listFenceInfo(this.queryParams).then(response => {
+        this.fenceInfoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        defenceName: null,
+        poly: null,
+        centerLng: null,
+        centerLat: null,
+        updateTime: null,
+        createTime: null,
+        createBy: null,
+        updateBy: 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;
+      getFenceInfo(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) {
+            updateFenceInfo(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功');
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFenceInfo(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 delFenceInfo(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess('删除成功');
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('bd/fenceInfo/export', {
+        ...this.queryParams,
+      }, `fenceInfo_${new Date().getTime()}.xlsx`);
+    },
+  },
+};
+</script>

+ 298 - 0
ruoyi-ui/src/views/bdspace/fenceVioEvt/index.vue

@@ -0,0 +1,298 @@
+<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="evtType">
+        <el-select v-model="queryParams.evtType" placeholder="请选择事件" clearable>
+          <el-option
+              v-for="dict in dict.type.evt_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="事件描述" prop="evtDesc">
+        <el-input
+            v-model="queryParams.evtDesc"
+            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"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            type="success"
+            plain
+            icon="el-icon-edit"
+            size="mini"
+            :disabled="single"
+            @click="handleUpdate"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            type="danger"
+            plain
+            icon="el-icon-delete"
+            size="mini"
+            :disabled="multiple"
+            @click="handleDelete"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            type="warning"
+            plain
+            icon="el-icon-download"
+            size="mini"
+            @click="handleExport"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fenceVioEvtList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="" align="center" prop="id" />
+      <el-table-column label="" align="center" prop="evtKey" />
+      <el-table-column label="事件类型" align="center" prop="evtType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.evt_type" :value="scope.row.evtType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="事件描述" align="center" prop="evtDesc" />
+      <el-table-column label="经度" align="center" prop="lng" />
+      <el-table-column label="维度" align="center" prop="lat" />
+      <el-table-column label="围栏id" align="center" prop="fenceId" />
+      <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)"
+          >修改
+          </el-button>
+          <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+          >删除
+          </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="80px">
+        <el-form-item label="" prop="evtKey">
+          <el-input v-model="form.evtKey" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="事件类型" prop="evtType">
+          <el-select v-model="form.evtType" placeholder="请选择事件类型">
+            <el-option
+                v-for="dict in dict.type.evt_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="事件描述" prop="evtDesc">
+          <el-input v-model="form.evtDesc" placeholder="请输入事件描述" />
+        </el-form-item>
+        <el-form-item label="经度" prop="lng">
+          <el-input v-model="form.lng" placeholder="请输入经度" />
+        </el-form-item>
+        <el-form-item label="维度" prop="lat">
+          <el-input v-model="form.lat" placeholder="请输入维度" />
+        </el-form-item>
+        <el-form-item label="围栏id" prop="fenceId">
+          <el-input v-model="form.fenceId" placeholder="请输入围栏id" />
+        </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 {
+  listFenceVioEvt, getFenceVioEvt, delFenceVioEvt, addFenceVioEvt, updateFenceVioEvt,
+} from '@/api/bd/fenceVioEvt';
+
+export default {
+  name: 'FenceVioEvt',
+  dicts: ['evt_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 围栏闯禁事件表格数据
+      fenceVioEvtList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        evtType: null,
+        evtDesc: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询围栏闯禁事件列表 */
+    getList() {
+      this.loading = true;
+      listFenceVioEvt(this.queryParams).then(response => {
+        this.fenceVioEvtList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        evtKey: null,
+        evtType: null,
+        evtDesc: null,
+        lng: null,
+        lat: null,
+        fenceId: null,
+        updateTime: null,
+        createTime: null,
+        createBy: null,
+        updateBy: 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;
+      getFenceVioEvt(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) {
+            updateFenceVioEvt(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功');
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFenceVioEvt(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 delFenceVioEvt(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess('删除成功');
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('bd/fenceVioEvt/export', {
+        ...this.queryParams,
+      }, `fenceVioEvt_${new Date().getTime()}.xlsx`);
+    },
+  },
+};
+</script>