Pārlūkot izejas kodu

Merge branch 'master' of http://app.tjzhxx.cn:3001/chaos/yyky_vue

zhengjie 1 gadu atpakaļ
vecāks
revīzija
0bb5a0aa8a

+ 124 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSearchLocationInfoController.java

@@ -0,0 +1,124 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.vo.SearchLocationInfoVo;
+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 com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.TSearchLocationInfo;
+import com.ruoyi.system.service.ITSearchLocationInfoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+@RestController
+@RequestMapping("/system/search/location/info")
+public class TSearchLocationInfoController extends BaseController {
+    @Autowired
+    private ITSearchLocationInfoService tSearchLocationInfoService;
+
+//    /**
+//     * 查询【请填写功能名称】列表
+//     */
+//    @PreAuthorize("@ss.hasPermi('system:info:list')")
+//    @GetMapping("/list")
+//    public TableDataInfo list(TSearchLocationInfo tSearchLocationInfo) {
+//        startPage();
+//        List<TSearchLocationInfo> list = tSearchLocationInfoService.selectTSearchLocationInfoList(tSearchLocationInfo);
+//        return getDataTable(list);
+//    }
+
+//    /**
+//     * 查询【请填写功能名称】列表
+//     */
+//    @PreAuthorize("@ss.hasPermi('system:info:list')")
+//    @GetMapping("/list")
+//    public TableDataInfo list(TSearchLocationInfo tSearchLocationInfo) {
+//        tSearchLocationInfo.setUserId(getUserId());
+//        startPage();
+//        List<SearchLocationInfoVo> list = tSearchLocationInfoService.selectSearchLocationInfoVoBySearchValue(tSearchLocationInfo);
+//        return getDataTable(list);
+//    }
+
+    /**
+     * 搜索【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:search')")
+    @GetMapping("/search")
+    public TableDataInfo search(TSearchLocationInfo tSearchLocationInfo) {
+        tSearchLocationInfo.setUserId(getUserId());
+        startPage();
+        List<SearchLocationInfoVo> list = tSearchLocationInfoService.selectSearchLocationInfoVoBySearchValue(tSearchLocationInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TSearchLocationInfo tSearchLocationInfo) {
+        List<TSearchLocationInfo> list = tSearchLocationInfoService.selectTSearchLocationInfoList(tSearchLocationInfo);
+        ExcelUtil<TSearchLocationInfo> util = new ExcelUtil<TSearchLocationInfo>(TSearchLocationInfo.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(tSearchLocationInfoService.selectTSearchLocationInfoById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSearchLocationInfo tSearchLocationInfo) {
+        return toAjax(tSearchLocationInfoService.insertTSearchLocationInfo(tSearchLocationInfo));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSearchLocationInfo tSearchLocationInfo) {
+        return toAjax(tSearchLocationInfoService.updateTSearchLocationInfo(tSearchLocationInfo));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tSearchLocationInfoService.deleteTSearchLocationInfoByIds(ids));
+    }
+}

+ 1 - 1
ruoyi-admin/src/main/resources/application-dev.yml

@@ -74,7 +74,7 @@ spring:
         # 密码
         password: redis
         # 连接超时时间
-        timeout: 10s
+        timeout: 1440s
         lettuce:
             pool:
                 # 连接池中的最小空闲连接

+ 2 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -56,9 +56,9 @@ spring:
     # 测试环境
     #    active: test
     # 开发环境
-#    active: dev
+    active: dev
     # 生产环境
-    active: druid
+#    active: druid
 
   # 文件上传
   servlet:

+ 52 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/TimeStampUtils.java

@@ -0,0 +1,52 @@
+package com.ruoyi.common.utils;
+
+import java.time.*;
+
+/**
+ * @ClassName: TimeStampUtils
+ * @Author: 于学智
+ * @Description: 时间工具类
+ * @CreateDate: 2023/9/16 12:26
+ * @Version: 1.0
+ * @E-mail:18722650553@139.com
+ * @Link:https://github.com/18722650553
+ */
+public class TimeStampUtils {
+    /**
+     * 转成现在的年月日,时分秒还是之前的,秒毫秒为0
+     *
+     * @param timestamp
+     * @return
+     */
+    public static LocalDateTime convertToTodayDateTime(long timestamp) {
+        Instant instant = Instant.ofEpochMilli(timestamp);
+        LocalDateTime previousDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
+        //获取现在时间
+        LocalDate today = LocalDate.now();
+        LocalTime previousTime = previousDateTime.toLocalTime();
+        LocalDateTime todayDateTime = LocalDateTime.of(today, previousTime).withSecond(0).withNano(0);
+        return todayDateTime;
+    }
+
+    /**
+     * 转成现在的年月日,时分秒还是之前的,秒毫秒为0
+     *
+     * @param timestamp
+     * @return
+     */
+    public static long convertToTodayDateTimeToMillis(long timestamp) {
+        LocalDateTime previousDateTime = convertToTodayDateTime(timestamp);
+        return convertToMillis(previousDateTime);
+    }
+
+    /**
+     * LocalDateTime转毫秒时间戳
+     *
+     * @param dateTime
+     * @return
+     */
+    public static long convertToMillis(LocalDateTime dateTime) {
+        Instant instant = dateTime.atZone(ZoneId.systemDefault()).toInstant();
+        return instant.toEpochMilli();
+    }
+}

+ 81 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TSearchLocationInfo.java

@@ -0,0 +1,81 @@
+package com.ruoyi.system.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;
+
+/**
+ * 【请填写功能名称】对象 t_search_location_info
+ * 
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+public class TSearchLocationInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 查询者id */
+    @Excel(name = "查询者id")
+    private Long userId;
+
+    /** 查询内容 */
+    @Excel(name = "查询内容")
+    private String searchValue;
+
+    /** 查询到的设备id */
+    @Excel(name = "查询到的设备id")
+    private Long deviceId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setSearchValue(String searchValue) 
+    {
+        this.searchValue = searchValue;
+    }
+
+    public String getSearchValue() 
+    {
+        return searchValue;
+    }
+    public void setDeviceId(Long deviceId) 
+    {
+        this.deviceId = deviceId;
+    }
+
+    public Long getDeviceId() 
+    {
+        return deviceId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("userId", getUserId())
+            .append("searchValue", getSearchValue())
+            .append("deviceId", getDeviceId())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 203 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TSearchLocationInfoVo.java

@@ -0,0 +1,203 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.StringJoiner;
+
+/**
+ * 【请填写功能名称】对象 t_search_location_info
+ *
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+public class TSearchLocationInfoVo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @Excel(name = "用户id")
+    private Long user_id;
+
+    /**
+     * 设备id
+     */
+    @Excel(name = "设备id")
+    private Long device_id;
+
+    /**
+     * 设备手机号
+     */
+    @Excel(name = "设备手机号")
+    private String device_tel;
+
+    /**
+     * 设备身份证ID
+     */
+    @Excel(name = "设备身份证ID")
+    private String device_card_id;
+
+    /**
+     * 设备标识ID_CODE
+     */
+    @Excel(name = "设备标识ID_CODE")
+    private String device_id_code;
+
+    /**
+     * 客户姓名
+     */
+    @Excel(name = "客户姓名")
+    private String user_nick_name;
+
+    /**
+     * 客户性别(1男 2女)
+     */
+    @Excel(name = "客户性别(1男 2女)")
+    private String user_gender;
+
+    /**
+     * 客户紧急联系人电话1
+     */
+    @Excel(name = "客户紧急联系人电话1")
+    private String user_tel_1;
+
+    /**
+     * 客户紧急联系人电话2
+     */
+    @Excel(name = "客户紧急联系人电话2")
+    private String user_tel_2;
+
+    /**
+     * 客户紧急联系人电话3
+     */
+    @Excel(name = "客户紧急联系人电话3")
+    private String user_tel_3;
+
+    /**
+     * 客户身份证ID
+     */
+    @Excel(name = "客户身份证ID")
+    private String user_card_id;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUser_id() {
+        return user_id;
+    }
+
+    public void setUser_id(Long user_id) {
+        this.user_id = user_id;
+    }
+
+    public Long getDevice_id() {
+        return device_id;
+    }
+
+    public void setDevice_id(Long device_id) {
+        this.device_id = device_id;
+    }
+
+    public String getDevice_tel() {
+        return device_tel;
+    }
+
+    public void setDevice_tel(String device_tel) {
+        this.device_tel = device_tel;
+    }
+
+    public String getDevice_card_id() {
+        return device_card_id;
+    }
+
+    public void setDevice_card_id(String device_card_id) {
+        this.device_card_id = device_card_id;
+    }
+
+    public String getDevice_id_code() {
+        return device_id_code;
+    }
+
+    public void setDevice_id_code(String device_id_code) {
+        this.device_id_code = device_id_code;
+    }
+
+    public String getUser_nick_name() {
+        return user_nick_name;
+    }
+
+    public void setUser_nick_name(String user_nick_name) {
+        this.user_nick_name = user_nick_name;
+    }
+
+    public String getUser_gender() {
+        return user_gender;
+    }
+
+    public void setUser_gender(String user_gender) {
+        this.user_gender = user_gender;
+    }
+
+    public String getUser_tel_1() {
+        return user_tel_1;
+    }
+
+    public void setUser_tel_1(String user_tel_1) {
+        this.user_tel_1 = user_tel_1;
+    }
+
+    public String getUser_tel_2() {
+        return user_tel_2;
+    }
+
+    public void setUser_tel_2(String user_tel_2) {
+        this.user_tel_2 = user_tel_2;
+    }
+
+    public String getUser_tel_3() {
+        return user_tel_3;
+    }
+
+    public void setUser_tel_3(String user_tel_3) {
+        this.user_tel_3 = user_tel_3;
+    }
+
+    public String getUser_card_id() {
+        return user_card_id;
+    }
+
+    public void setUser_card_id(String user_card_id) {
+        this.user_card_id = user_card_id;
+    }
+
+    @Override
+    public String toString() {
+        return new StringJoiner(", ", TSearchLocationInfoVo.class.getSimpleName() + "[", "]")
+                .add("id=" + id)
+                .add("user_id=" + user_id)
+                .add("device_id=" + device_id)
+                .add("device_tel='" + device_tel + "'")
+                .add("device_card_id='" + device_card_id + "'")
+                .add("device_id_code='" + device_id_code + "'")
+                .add("user_nick_name='" + user_nick_name + "'")
+                .add("user_gender='" + user_gender + "'")
+                .add("user_tel_1='" + user_tel_1 + "'")
+                .add("user_tel_2='" + user_tel_2 + "'")
+                .add("user_tel_3='" + user_tel_3 + "'")
+                .add("user_card_id='" + user_card_id + "'")
+                .toString();
+    }
+}

+ 139 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SearchLocationInfoVo.java

@@ -0,0 +1,139 @@
+package com.ruoyi.system.domain.vo;
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.io.Serializable;
+import java.util.StringJoiner;
+
+/**
+ * @ClassName: SearchLocationInfoVo
+ * @Author: 于学智
+ * @Description: 查询定位服务VO
+ * @CreateDate: 2023/9/16 13:47
+ * @Version: 1.0
+ * @E-mail:18722650553@139.com
+ * @Link:https://github.com/18722650553
+ */
+public class SearchLocationInfoVo implements Serializable {
+    private Long id;
+
+    /**
+     * 用户ID
+     */
+    @Excel(name = "设备用户id")
+    private Long userId;
+
+    /**
+     * 设备用户名
+     */
+    @Excel(name = "设备用户名")
+    private String userName;
+
+    /**
+     * 用户名电话号
+     */
+    @Excel(name = "用户名电话号")
+    private String userPhone;
+
+    /**
+     * 查询内容
+     */
+    @Excel(name = "查询内容")
+    private String searchValue;
+
+    /**
+     * 查询到的设备ID
+     */
+    @Excel(name = "查询到的设备ID")
+    private Long deviceId;
+
+    /**
+     * 查询到的设备编号
+     */
+    @Excel(name = "查询到的设备编号")
+    private Long deviceIdCode;
+
+    /**
+     * 电子围栏VO
+     */
+    @Excel(name = "电子围栏VO")
+    private ElectronicFenceVo electronicFenceVo;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserPhone() {
+        return userPhone;
+    }
+
+    public void setUserPhone(String userPhone) {
+        this.userPhone = userPhone;
+    }
+
+    public String getSearchValue() {
+        return searchValue;
+    }
+
+    public void setSearchValue(String searchValue) {
+        this.searchValue = searchValue;
+    }
+
+    public Long getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(Long deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public Long getDeviceIdCode() {
+        return deviceIdCode;
+    }
+
+    public void setDeviceIdCode(Long deviceIdCode) {
+        this.deviceIdCode = deviceIdCode;
+    }
+
+    public ElectronicFenceVo getElectronicFenceVo() {
+        return electronicFenceVo;
+    }
+
+    public void setElectronicFenceVo(ElectronicFenceVo electronicFenceVo) {
+        this.electronicFenceVo = electronicFenceVo;
+    }
+
+    @Override
+    public String toString() {
+        return new StringJoiner(", ", SearchLocationInfoVo.class.getSimpleName() + "[", "]")
+                .add("id=" + id)
+                .add("userId=" + userId)
+                .add("userName='" + userName + "'")
+                .add("userPhone='" + userPhone + "'")
+                .add("searchValue='" + searchValue + "'")
+                .add("deviceId=" + deviceId)
+                .add("deviceIdCode=" + deviceIdCode)
+                .add("electronicFenceVo=" + electronicFenceVo)
+                .toString();
+    }
+}

+ 64 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TSearchLocationInfoMapper.java

@@ -0,0 +1,64 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.TSearchLocationInfo;
+import com.ruoyi.system.domain.vo.SearchLocationInfoVo;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+public interface TSearchLocationInfoMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TSearchLocationInfo selectTSearchLocationInfoById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TSearchLocationInfo> selectTSearchLocationInfoList(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTSearchLocationInfoById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTSearchLocationInfoByIds(Long[] ids);
+
+    List<SearchLocationInfoVo> selectSearchLocationInfoVoBySearchValue(String searchValue);
+}

+ 70 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ITSearchLocationInfoService.java

@@ -0,0 +1,70 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.TSearchLocationInfo;
+import com.ruoyi.system.domain.vo.SearchLocationInfoVo;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+public interface ITSearchLocationInfoService {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TSearchLocationInfo selectTSearchLocationInfoById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TSearchLocationInfo> selectTSearchLocationInfoList(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteTSearchLocationInfoByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTSearchLocationInfoById(Long id);
+
+    /**
+     * 根据查询内容展示查询定位信息
+     *
+     * @param tSearchLocationInfo
+     * @return
+     */
+    List<SearchLocationInfoVo> selectSearchLocationInfoVoBySearchValue(TSearchLocationInfo tSearchLocationInfo);
+}

+ 6 - 23
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TElectronicFenceServiceImpl.java

@@ -1,11 +1,7 @@
 package com.ruoyi.system.service.impl;
 
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.time.*;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import com.alibaba.fastjson.JSONObject;
@@ -14,6 +10,7 @@ import com.ruoyi.common.core.domain.AMapResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.TimeStampUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.system.domain.TElectronicFenceKey;
@@ -147,7 +144,7 @@ public class TElectronicFenceServiceImpl implements ITElectronicFenceService {
         List<TElectronicFence> tElectronicFences = tElectronicFenceMapper.selectTElectronicFenceListByDeviceId(deviceId);
         if (tElectronicFences == null || tElectronicFences.isEmpty()) {
             log.info("通过deviceId查询围栏,返回结果为空 ,deviceId:{}!", deviceId);
-            return null;
+            return new ArrayList<>();
         }
         List<AMapFenceVo> electronicFenceVos = tElectronicFences.stream()
                 .map(tElectronicFence -> {
@@ -161,8 +158,8 @@ public class TElectronicFenceServiceImpl implements ITElectronicFenceService {
                     aMapFenceVo.setUserId(tElectronicFence.getUserId());
                     aMapFenceVo.setDeviceId(tElectronicFence.getDeviceId());
                     aMapFenceVo.setName(tElectronicFence.getName());
-                    aMapFenceVo.setStartTime(convertToCurrentDateTimestamp(tElectronicFence.getStartTime().getTime()));
-                    aMapFenceVo.setEndTime(convertToCurrentDateTimestamp(tElectronicFence.getEndTime().getTime()));
+                    aMapFenceVo.setStartTime(TimeStampUtils.convertToTodayDateTimeToMillis(tElectronicFence.getStartTime().getTime()));
+                    aMapFenceVo.setEndTime(TimeStampUtils.convertToTodayDateTimeToMillis(tElectronicFence.getEndTime().getTime()));
                     aMapFenceVo.setState(tElectronicFence.geteState());
                     aMapFenceVo.setType(tElectronicFence.geteType());
                     aMapFenceVo.setDesc(tElectronicFence.geteDesc());
@@ -172,20 +169,6 @@ public class TElectronicFenceServiceImpl implements ITElectronicFenceService {
         return electronicFenceVos;
     }
 
-    public static Long convertToCurrentDateTimestamp(long timestamp) {
-        // 将时间戳转换为LocalDateTime对象
-        LocalDateTime dateTime = LocalDateTime.ofEpochSecond(timestamp, 0, ZoneOffset.UTC);
-        // 获取当前日期
-        LocalDateTime currentDate = LocalDateTime.now()
-                .withHour(dateTime.getHour())
-                .withMinute(dateTime.getMinute())
-                .withSecond(0)
-                .withNano(0);
-        // 将当前日期转换为时间戳
-        long currentTimestamp = currentDate.toInstant(ZoneOffset.UTC).toEpochMilli();
-        return currentTimestamp;
-    }
-
     @Override
     public int updateTElectronicFenceEditVo(ElectronicFenceVo tElectronicFenceEditVo) {
         //校验围栏类型是否为空

+ 124 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSearchLocationInfoServiceImpl.java

@@ -0,0 +1,124 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.vo.SearchLocationInfoVo;
+import com.ruoyi.system.mapper.TUserProfileMapper;
+import com.ruoyi.system.service.ITDeviceListService;
+import com.ruoyi.system.service.ITShouhuanInfoService;
+import com.ruoyi.system.service.ITUserProfileService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.TSearchLocationInfoMapper;
+import com.ruoyi.system.domain.TSearchLocationInfo;
+import com.ruoyi.system.service.ITSearchLocationInfoService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-09-16
+ */
+@Service
+public class TSearchLocationInfoServiceImpl implements ITSearchLocationInfoService {
+    private static final Logger log = LoggerFactory.getLogger(TSearchLocationInfoServiceImpl.class);
+
+    @Autowired
+    private TSearchLocationInfoMapper tSearchLocationInfoMapper;
+
+    @Autowired
+    private ITDeviceListService tDeviceListService;
+
+    @Autowired
+    private ITShouhuanInfoService itShouhuanInfoService;
+
+    @Autowired
+    private ITUserProfileService userProfileService;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+
+    public TSearchLocationInfo selectTSearchLocationInfoById(Long id) {
+        return tSearchLocationInfoMapper.selectTSearchLocationInfoById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<TSearchLocationInfo> selectTSearchLocationInfoList(TSearchLocationInfo tSearchLocationInfo) {
+        return tSearchLocationInfoMapper.selectTSearchLocationInfoList(tSearchLocationInfo);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo) {
+        tSearchLocationInfo.setCreateTime(DateUtils.getNowDate());
+        return tSearchLocationInfoMapper.insertTSearchLocationInfo(tSearchLocationInfo);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param tSearchLocationInfo 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateTSearchLocationInfo(TSearchLocationInfo tSearchLocationInfo) {
+        tSearchLocationInfo.setUpdateTime(DateUtils.getNowDate());
+        return tSearchLocationInfoMapper.updateTSearchLocationInfo(tSearchLocationInfo);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSearchLocationInfoByIds(Long[] ids) {
+        return tSearchLocationInfoMapper.deleteTSearchLocationInfoByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSearchLocationInfoById(Long id) {
+        return tSearchLocationInfoMapper.deleteTSearchLocationInfoById(id);
+    }
+
+    @Override
+    public List<SearchLocationInfoVo> selectSearchLocationInfoVoBySearchValue(TSearchLocationInfo tSearchLocationInfo) {
+        //判断查询内容是否为空
+        if (StringUtils.isEmpty(tSearchLocationInfo.getSearchValue())) {
+            log.error("当前查询内容禁止为空,查询者id:{}", tSearchLocationInfo.getUserId());
+            throw new ServiceException("当前查询内容禁止为空!");
+        }
+        //查询内容
+        String searchValue = tSearchLocationInfo.getSearchValue();
+        return tSearchLocationInfoMapper.selectSearchLocationInfoVoBySearchValue(searchValue);
+    }
+}

+ 122 - 0
ruoyi-system/src/main/resources/mapper/system/TSearchLocationInfoMapper.xml

@@ -0,0 +1,122 @@
+<?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.system.mapper.TSearchLocationInfoMapper">
+
+    <resultMap type="TSearchLocationInfo" id="TSearchLocationInfoResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="searchValue" column="search_value"/>
+        <result property="deviceId" column="device_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <resultMap type="TSearchLocationInfoVo" id="TSearchLocationInfoVoResult">
+        <result property="id" column="id"/>
+        <result property="device_id" column="device_id"/>
+        <result property="user_id" column="user_id"/>
+        <result property="device_tel" column="device_tel"/>
+        <result property="device_card_id" column="device_card_id"/>
+        <result property="device_id_code" column="device_id_code"/>
+        <result property="user_nick_name" column="user_nick_name"/>
+        <result property="user_gender" column="user_gender"/>
+        <result property="user_tel_1" column="user_tel_1"/>
+        <result property="user_tel_2" column="user_tel_2"/>
+        <result property="user_tel_3" column="user_tel_3"/>
+        <result property="user_card_id" column="user_card_id"/>
+    </resultMap>
+
+    <sql id="selectTSearchLocationInfoVo">
+        select id, user_id, search_value, device_id, create_time, update_time
+        from t_search_location_info
+    </sql>
+
+    <sql id="selectTSearchLocationInfoMainVo">
+        SELECT t1.id        AS device_id,
+               t1.userid    AS user_id,
+               t1.telno     AS device_tel,
+               t1.sfzid     AS device_card_id,
+               t1.device_id AS device_id_code,
+               t2.`name`    AS user_nick_name,
+               t2.gender    AS user_gender,
+               t2.tel_one   AS user_tel_1,
+               t2.tel_two   AS user_tel_2,
+               t2.tel_three AS user_tel_3,
+               t2.sfzid     AS user_card_id
+        FROM t_device_list t1
+                 JOIN
+             t_user_profile t2
+             ON
+                 t1.userid = t2.id
+    </sql>
+
+    <select id="selectTSearchLocationInfoList" parameterType="TSearchLocationInfo"
+            resultMap="TSearchLocationInfoResult">
+        <include refid="selectTSearchLocationInfoVo"/>
+        <where>
+            <if test="userId != null ">and user_id = #{userId}</if>
+            <if test="searchValue != null  and searchValue != ''">and search_value = #{searchValue}</if>
+            <if test="deviceId != null ">and device_id = #{deviceId}</if>
+        </where>
+    </select>
+
+    <select id="selectTSearchLocationInfoById" parameterType="Long" resultMap="TSearchLocationInfoResult">
+        <include refid="selectTSearchLocationInfoVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="selectSearchLocationInfoVoBySearchValue" parameterType="String" resultMap="TSearchLocationInfoVoResult">
+        <include refid="selectTSearchLocationInfoMainVo"/>
+        WHERE
+        t2.`name` LIKE concat('%', #{searchValue}, '%')
+        OR
+        t1.telno LIKE concat('%', #{searchValue}, '%')
+        OR
+        t1.device_id LIKE concat('%', #{searchValue}, '%')
+    </select>
+
+    <insert id="insertTSearchLocationInfo" parameterType="TSearchLocationInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into t_search_location_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="searchValue != null and searchValue != ''">search_value,</if>
+            <if test="deviceId != null">device_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="searchValue != null and searchValue != ''">#{searchValue},</if>
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTSearchLocationInfo" parameterType="TSearchLocationInfo">
+        update t_search_location_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="searchValue != null and searchValue != ''">search_value = #{searchValue},</if>
+            <if test="deviceId != null">device_id = #{deviceId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTSearchLocationInfoById" parameterType="Long">
+        delete
+        from t_search_location_info
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteTSearchLocationInfoByIds" parameterType="String">
+        delete from t_search_location_info where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>