上饶市公安局wvp平台
zhongrj
2023-03-07 a416c2077583b91886d36b46f4df4dc7a5c93313
设备插入测试
4 files modified
90 ■■■■ changed files
.idea/workspace.xml 32 ●●●●● patch | view | raw | blame | history
src/main/java/com/genersoft/iot/vmp/netty/handle/UdpServerHandler.java 29 ●●●● patch | view | raw | blame | history
src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/DeviceChannelPoliceCameraService.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/impl/DeviceChannelPoliceCameraServiceImpl.java 22 ●●●●● patch | view | raw | blame | history
.idea/workspace.xml
@@ -18,9 +18,9 @@
  <component name="ChangeListManager">
    <list default="true" id="208daac0-1abd-465d-abf2-6a0414be019b" name="默认的" comment="配置提交">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/mapper/DeviceChannelPoliceCameraMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/mapper/DeviceChannelPoliceCameraMapper.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/netty/handle/UdpServerHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/netty/handle/UdpServerHandler.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/DeviceChannelPoliceCameraService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/DeviceChannelPoliceCameraService.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/impl/DeviceChannelPoliceCameraServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/impl/DeviceChannelPoliceCameraServiceImpl.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -166,7 +166,7 @@
      <workItem from="1677651650908" duration="1778000" />
      <workItem from="1677660534432" duration="58000" />
      <workItem from="1677726051229" duration="38096000" />
      <workItem from="1678063078799" duration="42993000" />
      <workItem from="1678063078799" duration="44512000" />
    </task>
    <task id="LOCAL-00001" summary="默认的">
      <created>1676691639632</created>
@@ -231,7 +231,14 @@
      <option name="project" value="LOCAL" />
      <updated>1678171715257</updated>
    </task>
    <option name="localTasksCounter" value="10" />
    <task id="LOCAL-00010" summary="设备插入修改">
      <created>1678191961494</created>
      <option name="number" value="00010" />
      <option name="presentableId" value="LOCAL-00010" />
      <option name="project" value="LOCAL" />
      <updated>1678191961494</updated>
    </task>
    <option name="localTasksCounter" value="11" />
    <servers />
  </component>
  <component name="TypeScriptGeneratedFilesManager">
@@ -271,17 +278,18 @@
    <MESSAGE value="执法记录仪移动位置插入新增" />
    <MESSAGE value="对讲设备读取数据修改" />
    <MESSAGE value="对讲设备字段修改读取数据修改" />
    <option name="LAST_COMMIT_MESSAGE" value="对讲设备字段修改读取数据修改" />
    <MESSAGE value="设备插入修改" />
    <option name="LAST_COMMIT_MESSAGE" value="设备插入修改" />
  </component>
  <component name="WindowStateProjectService">
    <state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1678100334007">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1678100334007" />
    <state x="765" y="225" key="#com.intellij.ide.util.MemberChooser" timestamp="1678081258315">
    <state x="765" y="225" key="#com.intellij.ide.util.MemberChooser" timestamp="1678193398796">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="765" y="225" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1678081258315" />
    <state x="765" y="225" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040@0.0.1920.1040" timestamp="1678193398796" />
    <state x="511" y="442" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1677736409554">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
@@ -362,10 +370,10 @@
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="461" y="164" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1676692121637" />
    <state x="552" y="252" key="Vcs.Push.Dialog.v2" timestamp="1678171716665">
    <state x="552" y="252" key="Vcs.Push.Dialog.v2" timestamp="1678191963092">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="552" y="252" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1678171716665" />
    <state x="552" y="252" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1678191963092" />
    <state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1673925442539">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
@@ -378,10 +386,10 @@
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="661" y="252" width="866" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1678183717780" />
    <state x="643" y="306" key="git4idea.merge.GitPullDialog" timestamp="1676946006482">
    <state x="643" y="306" key="git4idea.merge.GitPullDialog" timestamp="1678191884252">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
    <state x="643" y="306" key="git4idea.merge.GitPullDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1676946006482" />
    <state x="643" y="306" key="git4idea.merge.GitPullDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1678191884252" />
    <state x="716" y="419" key="git4idea.remote.GitConfigureRemotesDialog" timestamp="1676692396357">
      <screen x="0" y="0" width="1920" height="1040" />
    </state>
src/main/java/com/genersoft/iot/vmp/netty/handle/UdpServerHandler.java
@@ -1,8 +1,11 @@
package com.genersoft.iot.vmp.netty.handle;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.netty.business.entity.TalkBackEquipment;
import com.genersoft.iot.vmp.netty.business.service.TalkBackEquipmentService;
import com.genersoft.iot.vmp.netty.config.MyDecoder;
import com.genersoft.iot.vmp.policeBodyCamera.entity.DeviceChannelPoliceCamera;
import com.genersoft.iot.vmp.policeBodyCamera.service.DeviceChannelPoliceCameraService;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
@@ -41,10 +44,14 @@
    private TalkBackEquipmentService talkBackEquipmentService;
    @Autowired
    private DeviceChannelPoliceCameraService deviceChannelPoliceCameraService;
    @PostConstruct
    public void init() {
        udpServerHandler = this;
        udpServerHandler.talkBackEquipmentService = this.talkBackEquipmentService;
        udpServerHandler.deviceChannelPoliceCameraService = this.deviceChannelPoliceCameraService;
    }
    @Override
@@ -54,10 +61,8 @@
        byte[] req = new byte[buf.readableBytes()];
        buf.readBytes(req);
        String body = new String(req, CharsetUtil.UTF_8);
//        System.out.println("【UDP】>>>>>> 收到客户端的数据:"+body);
        // 字节转16进制字符串
        String s = bytesToHexString(req);
//        System.out.println("s111111 = " + s);
        //获取字符串的长度
        int length = s.length();
//        System.out.println("数据长度>>>>>> = " + length);
@@ -114,7 +119,7 @@
        if (Integer.parseInt(second)<10){
            second = "0" + second;
        }
        String time = year + "-" + month + "-" + day +" " + hour+ ":"+minute + ":" + second;
        String time = year + "-" + month + "-" + day +" " + hour + ":" + minute + ":" + second;
        //时间拼接
        try {
            backEquipment.setReceiveTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(time));
@@ -144,14 +149,24 @@
    }
    /**
     * 保存设备数据
     * 保存设备数据--测试
     * @param body
     */
    @Async
    public void saveTalkBackEquipmentInfo(String body) {
        TalkBackEquipment equipmentRecord = new TalkBackEquipment();
        DeviceChannel deviceChannelPoliceCamera = new DeviceChannel();
        deviceChannelPoliceCamera.setAddress("");
        deviceChannelPoliceCamera.setDeviceId("123");
        deviceChannelPoliceCamera.setName("CS");
        deviceChannelPoliceCamera.setLongitude(128.125412);
        deviceChannelPoliceCamera.setLatitude(29.1254124);
        deviceChannelPoliceCamera.setPTZTypeText("111");
        deviceChannelPoliceCamera.setCertNum("10");
        deviceChannelPoliceCamera.setPTZType(1);
        deviceChannelPoliceCamera.setStatus(1);
        deviceChannelPoliceCamera.setChannelId("123456");
        udpServerHandler.deviceChannelPoliceCameraService.insertDeviceChannelPoliceCamera(deviceChannelPoliceCamera);
    }
    /**
src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/DeviceChannelPoliceCameraService.java
@@ -2,6 +2,7 @@
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
import com.genersoft.iot.vmp.policeBodyCamera.entity.DeviceChannelPoliceCamera;
public interface DeviceChannelPoliceCameraService {
@@ -19,6 +20,12 @@
    void del(String deviceId, String channelId);
    /**
     * 添加执法记录仪位置信息
     * @param deviceChannelPoliceCamera
     */
    void insertDeviceChannelPoliceCamera(DeviceChannel deviceChannelPoliceCamera);
    /**
     * 添加执法记录仪移动位置信息
     * @param mobilePosition
     */
src/main/java/com/genersoft/iot/vmp/policeBodyCamera/service/impl/DeviceChannelPoliceCameraServiceImpl.java
@@ -65,6 +65,28 @@
    }
    /**
     * 添加执法记录仪位置信息
     * @param deviceChannelPoliceCamera
     */
    @Override
    public void insertDeviceChannelPoliceCamera(DeviceChannel deviceChannelPoliceCamera) {
        //新增
        deviceChannelPoliceCameraMapper.add(deviceChannelPoliceCamera);
        //新增记录
        MobilePosition mobilePosition = new MobilePosition();
        mobilePosition.setDirection(1.12);
        mobilePosition.setDeviceId("123");
        mobilePosition.setChannelId("123456");
        mobilePosition.setSpeed(1.12);
        mobilePosition.setCnLat("1.12");
        mobilePosition.setCnLng("1.12");
        mobilePosition.setLongitude(117.123652);
        mobilePosition.setLatitude(28.124525);
        insertNewPositionPoliceCamera(mobilePosition);
    }
    /**
     * 添加执法记录仪移动位置信息
     * @param mobilePosition
     */