| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="E:/VehicleSupervisionPlatform/app/logs/ruoyi-auth" /> |
| | | <property name="log.path" value="/mnt/java/log/auth" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="E:/VehicleSupervisionPlatform/app/logs/ruoyi-gateway" /> |
| | | <property name="log.path" value="/mnt/java/log/gateway" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | warn.setWarnNumber(1); |
| | | warn.setSpeed(null == vo.getSpeed() ? BigDecimal.ZERO : new BigDecimal(vo.getSpeed())); |
| | | if(null != vo.getLongitude() && 0 != vo.getLongitude()){ |
| | | warn.setLongitude(new BigDecimal(vo.getLongitude()).divide(new BigDecimal(1000000)).toString()); |
| | | String s = vo.getLongitude().toString(); |
| | | warn.setLongitude(s.substring(0, 3) + "." + s.substring(3)); |
| | | } |
| | | if(null != vo.getLatitude() && 0 != vo.getLatitude()){ |
| | | warn.setLatitude(new BigDecimal(vo.getLatitude()).divide(new BigDecimal(1000000)).toString()); |
| | | String s = vo.getLatitude().toString(); |
| | | warn.setLatitude(s.substring(0, 2) + "." + s.substring(2)); |
| | | Map<String, String> geocode = null; |
| | | try { |
| | | geocode = GDMapGeocodingUtil.geocode(warn.getLongitude(), warn.getLatitude()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | warn.setAddress(geocode.get("address")); |
| | | if(null != geocode){ |
| | | warn.setAddress(geocode.get("address")); |
| | | } |
| | | } |
| | | switch (vo.getResult()) { |
| | | case 0x00: |
| | |
| | | public void taskUpdateWarnStatus() { |
| | | List<Warn> warnList = this.list(new LambdaQueryWrapper<Warn>().eq(Warn::getTreatmentState, "处理中")); |
| | | for (Warn warn : warnList) { |
| | | if(null == warn.getObjectId()){ |
| | | continue; |
| | | } |
| | | UPWarnMsgAdptInfoVo vo = upWarnMsgAdptInfoClient.findByInfoId(warn.getObjectId()).getData(); |
| | | if (null != vo && null != warn && vo.getResult() != 0x00) { |
| | | if(null == vo){ |
| | | continue; |
| | | } |
| | | if (null != warn && vo.getResult() != 0x00) { |
| | | switch (vo.getResult()) { |
| | | case 0x00: |
| | | warn.setTreatmentState("处理中"); |
| | |
| | | if(null == warn.getPicUrl()){ |
| | | warn.setPicUrl(vo.getPicUrl()); |
| | | } |
| | | if(0x00 != vo.getResult() && null == warn.getTreatmentTime()){ |
| | | if(0x00 != vo.getResult()){ |
| | | UPWarnMsgOperationInfoVo upWarnMsgOperationInfoVo = upWarnMsgOperationInfoClient.getUPWarnMsgOperationInfo(warn.getObjectId()).getData(); |
| | | if(null != upWarnMsgOperationInfoVo){ |
| | | warn.setTreatmentUser(upWarnMsgOperationInfoVo.getOperator()); |
| | |
| | | allow-circular-references: true |
| | | profiles: |
| | | # 环境配置 |
| | | # active: dev |
| | | # active: dev |
| | | active: prod |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapping/system/*.xml |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="E:/VehicleSupervisionPlatform/app/logs/ruoyi-system" /> |
| | | <property name="log.path" value="/mnt/java/log/system" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | try { |
| | | bytes2 = this.getInfoId().getBytes("GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | e.printStackTrace(); |
| | | } |
| | | for (int i = 0; i < this.getDataLength(); i++) { |
| | | if (i < bytes2.length) { |
| | |
| | | System.err.println("客户端和服务端已建立连接"); |
| | | } |
| | | |
| | | /** |
| | | * channelInactive |
| | | * channel 通道 Inactive 不活跃的 |
| | | * 当客户端主动断开服务端的链接后,这个通道就是不活跃的。也就是说客户端与服务端的关闭了通信通道并且不可以传输数据 |
| | | */ |
| | | public void channelInactive(ChannelHandlerContext ctx) throws Exception { |
| | | System.out.println("客户端与服务端通道-关闭:" + ctx.channel().localAddress() + "channelInactive"); |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | ctx.close(); |
| | | System.out.println("异常退出:" + cause.getMessage()); |
| | | } |
| | | |
| | | public void write(ChannelHandlerContext ctx, String mess) throws Exception { |
| | | String sendInfo = mess; |
| | | ctx.writeAndFlush(Unpooled.copiedBuffer(sendInfo, CharsetUtil.UTF_8)); // 必须有flush |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * channelInactive |
| | | * channel 通道 Inactive 不活跃的 |
| | | * 当客户端主动断开服务端的链接后,这个通道就是不活跃的。也就是说客户端与服务端的关闭了通信通道并且不可以传输数据 |
| | | */ |
| | | public void channelInactive(ChannelHandlerContext ctx) throws Exception { |
| | | System.out.println("客户端与服务端通道-关闭:" + ctx.channel().localAddress() + "channelInactive"); |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | ctx.close(); |
| | | System.out.println("异常退出:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 业务路由 |
| | | * |
| | |
| | | * @param out |
| | | */ |
| | | public void serviceRouting(DataType dataType, ChannelHandlerContext ctx, OuterPacket out) { |
| | | log.info("从链路信息交换响应({}):{}", dataType.getCode(), out); |
| | | log.debug("从链路信息交换响应({}):{}", dataType.getCode(), out); |
| | | switch (dataType) { |
| | | case UP_DISCONNECT_INFORM: |
| | | log.info("主链路断开通知请求({}):{}", DataType.UP_DISCONNECT_INFORM.getCode(), out); |
| | | log.debug("主链路断开通知请求({}):{}", DataType.UP_DISCONNECT_INFORM.getCode(), out); |
| | | upDisconnectInformService.disconnect(ctx, out); |
| | | break; |
| | | case UP_CLOSELINK_INFORM: |
| | | log.info("下级平台主动关闭主从链路通知({}):{}", DataType.UP_CLOSELINK_INFORM.getCode(), out); |
| | | log.debug("下级平台主动关闭主从链路通知({}):{}", DataType.UP_CLOSELINK_INFORM.getCode(), out); |
| | | upCloseLinkInformService.closeLinkInform(ctx, out); |
| | | break; |
| | | case DOWN_CONNECT_RSP: |
| | | log.info("从链路连接应答({}):{}", DataType.DOWN_CONNECT_RSP.getCode(), out); |
| | | log.debug("从链路连接应答({}):{}", DataType.DOWN_CONNECT_RSP.getCode(), out); |
| | | downConnectRspService.connectRsp(ctx, out); |
| | | break; |
| | | case DOWN_DISCONNECT_RSP: |
| | | log.info("从链路注销应答({}):{}", DataType.DOWN_DISCONNECT_RSP.getCode(), out); |
| | | log.debug("从链路注销应答({}):{}", DataType.DOWN_DISCONNECT_RSP.getCode(), out); |
| | | break; |
| | | case DOWN_LINKTEST_RSP: |
| | | log.info("从链路连接保持应答({}):{}", DataType.DOWN_LINKTEST_RSP.getCode(), out); |
| | | log.debug("从链路连接保持应答({}):{}", DataType.DOWN_LINKTEST_RSP.getCode(), out); |
| | | break; |
| | | case UP_MANAGE_TOTAL_RECV_BACK_MSG: |
| | | log.info("发送车辆定位信息数量通知({}):{}", DataType.UP_MANAGE_TOTAL_RECV_BACK_MSG.getCode(), out); |
| | | log.debug("发送车辆定位信息数量通知({}):{}", DataType.UP_MANAGE_TOTAL_RECV_BACK_MSG.getCode(), out); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void channelActive(ChannelHandlerContext ctx) throws Exception { |
| | | log.info("Netty客户端链接成功"); |
| | | super.channelActive(ctx); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { |
| | | log.info("Netty客户端连链接常关闭"); |
| | | cause.printStackTrace(); |
| | | ctx.close(); |
| | | } |
| | | |
| | | @Override |
| | | public void channelInactive(ChannelHandlerContext ctx) throws Exception { |
| | | log.info("Netty客户端离线"); |
| | | super.channelInactive(ctx); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 业务路由 |
| | | * |
| | |
| | | * @param out |
| | | */ |
| | | public void serviceRouting(DataType dataType, ChannelHandlerContext ctx, OuterPacket out) { |
| | | log.info("主链路信息交换响应({}):{}", dataType.getCode(), out); |
| | | log.debug("主链路信息交换响应({}):{}", dataType.getCode(), out); |
| | | switch (dataType) { |
| | | case UP_CONNECT_REQ: |
| | | log.info("主链路登录请求({}):{}", DataType.UP_CONNECT_REQ.getCode(), out); |
| | | log.debug("主链路登录请求({}):{}", DataType.UP_CONNECT_REQ.getCode(), out); |
| | | connectReqService.connect(ctx, out); |
| | | break; |
| | | case UP_DISCONNECT_REQ: |
| | | log.info("主链路注销请求({}):{}", DataType.UP_DISCONNECT_REQ.getCode(), out); |
| | | log.debug("主链路注销请求({}):{}", DataType.UP_DISCONNECT_REQ.getCode(), out); |
| | | upDisconnectReqService.disconnect(ctx, out); |
| | | break; |
| | | case UP_LINKTEST_REQ: |
| | | log.info("主链路连接保持请求({}):{}", DataType.UP_LINKTEST_REQ.getCode(), out); |
| | | log.debug("主链路连接保持请求({}):{}", DataType.UP_LINKTEST_REQ.getCode(), out); |
| | | upLinkTestReqService.linkTest(ctx, out); |
| | | break; |
| | | case UP_EXG_MSG: |
| | | log.info("主链路车辆动态信息交换({}):{}", DataType.UP_EXG_MSG.getCode(), out); |
| | | log.debug("主链路车辆动态信息交换({}):{}", DataType.UP_EXG_MSG.getCode(), out); |
| | | exgMsgService.up_exg_msg(ctx, out); |
| | | break; |
| | | case UP_PLATFORM_MSG: |
| | | log.info("主链路平台间信息交互({}):{}", DataType.UP_PLATFORM_MSG.getCode(), out); |
| | | log.debug("主链路平台间信息交互({}):{}", DataType.UP_PLATFORM_MSG.getCode(), out); |
| | | platformMsgService.up_platform_msg(ctx, out); |
| | | break; |
| | | case UP_WARN_MSG: |
| | | log.info("报警信息交互({}):{}", DataType.UP_WARN_MSG.getCode(), out); |
| | | log.debug("报警信息交互({}):{}", DataType.UP_WARN_MSG.getCode(), out); |
| | | warnMsgService.up_warn_msg(ctx, out); |
| | | break; |
| | | case UP_CTRL_MSG: |
| | | log.info("车辆监管业务({}):{}", DataType.UP_CTRL_MSG.getCode(), out); |
| | | log.debug("车辆监管业务({}):{}", DataType.UP_CTRL_MSG.getCode(), out); |
| | | ctrlMsgService.up_ctrl_msg(ctx, out); |
| | | break; |
| | | case UP_BASE_MSG: |
| | | log.info("车辆静态信息交换业务({}):{}", DataType.UP_BASE_MSG.getCode(), out); |
| | | log.debug("车辆静态信息交换业务({}):{}", DataType.UP_BASE_MSG.getCode(), out); |
| | | baseMsgService.up_base_msg(ctx, out); |
| | | break; |
| | | case UP_AUTHORIZE_MSG: |
| | | log.info("视频时效口令交互({}):{}", DataType.UP_AUTHORIZE_MSG.getCode(), out); |
| | | log.debug("视频时效口令交互({}):{}", DataType.UP_AUTHORIZE_MSG.getCode(), out); |
| | | authorizeMsgService.up_authorize_msg(ctx, out); |
| | | break; |
| | | case UP_REALVIDEO_MSG: |
| | | log.info("实时音视频交互({}):{}", DataType.UP_REALVIDEO_MSG.getCode(), out); |
| | | log.debug("实时音视频交互({}):{}", DataType.UP_REALVIDEO_MSG.getCode(), out); |
| | | realvideoMsgService.up_realvideo_msg(ctx, out); |
| | | break; |
| | | case UP_PLAYBACK_MSG: |
| | | log.info("远程录像回放交互({}):{}", DataType.UP_PLAYBACK_MSG.getCode(), out); |
| | | log.debug("远程录像回放交互({}):{}", DataType.UP_PLAYBACK_MSG.getCode(), out); |
| | | playbackMsgService.up_playback_msg(ctx, out); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void channelActive(ChannelHandlerContext ctx) throws Exception { |
| | | log.info("Netty客户端链接成功"); |
| | | super.channelActive(ctx); |
| | | } |
| | | |
| | | @Override |
| | | public void channelInactive(ChannelHandlerContext ctx) throws Exception { |
| | | log.info("Netty客户端离线"); |
| | | super.channelInactive(ctx); |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { |
| | | log.info("Netty客户端连链接常关闭"); |
| | | cause.printStackTrace(); |
| | | ctx.close(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgRegisterDao; |
| | | import com.ruoyi.dataInterchange.model.BaseMsg; |
| | |
| | | DataType dataType = DataType.getDataType(baseMsg.getDataType()); |
| | | switch (dataType) { |
| | | case UP_BASE_MSG_VEHICLE_ADDED_ACK: |
| | | log.info("补报车辆静态信息应答消息({}):{}", DataType.UP_BASE_MSG_VEHICLE_ADDED_ACK.getCode(), out); |
| | | log.debug("补报车辆静态信息应答消息({}):{}", DataType.UP_BASE_MSG_VEHICLE_ADDED_ACK.getCode(), out); |
| | | up_base_msg_vehicle_added_ack(ctx, out.getGnsscenterId(), baseMsg); |
| | | break; |
| | | default: |
| | |
| | | BeanUtils.copyProperties(upBaseMsgVehicleAddedAck, upExgMsgRegister); |
| | | upExgMsgRegister.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRegister.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | log.info("补报车辆静态信息应答消息({}):{}", DataType.UP_BASE_MSG_VEHICLE_ADDED_ACK.getCode(), JSON.toJSONString(upExgMsgRegister)); |
| | | UPExgMsgRegister register = upExgMsgRegisterDao.findByVehicleNo(upExgMsgRegister.getVehicleNo()); |
| | | if (null == register) { |
| | | upExgMsgRegisterDao.save(upExgMsgRegister); |
| | |
| | | try { |
| | | new NettyClient(host, port).start(inferiorPlatformId, verifyCode); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | UPExgMsg exgMsg = getExgMsg(out); |
| | | DataType dataType = DataType.getDataType(exgMsg.getDataType()); |
| | | log.info("主链路车辆动态信息交换子业务({}):{}", dataType.getCode(), out); |
| | | log.debug("主链路车辆动态信息交换子业务({}):{}", dataType.getCode(), out); |
| | | switch (dataType) { |
| | | case UP_EXG_MSG_REGISTER: |
| | | log.info("上传车辆注册信息({}):{}", DataType.UP_EXG_MSG_REGISTER.getCode(), out); |
| | | log.debug("上传车辆注册信息({}):{}", DataType.UP_EXG_MSG_REGISTER.getCode(), out); |
| | | up_exg_msg_register(ctx, out.getGnsscenterId(), exgMsg); |
| | | break; |
| | | case UP_EXG_MSG_REAL_LOCATION: |
| | | log.info("上传车辆实时定位信息({}):{}", DataType.UP_EXG_MSG_REAL_LOCATION.getCode(), out); |
| | | log.debug("上传车辆实时定位信息({}):{}", DataType.UP_EXG_MSG_REAL_LOCATION.getCode(), out); |
| | | up_exg_msg_real_location(ctx, out.getGnsscenterId(), exgMsg); |
| | | break; |
| | | case UP_EXG_MSG_HISTORY_LOCATION: |
| | | log.info("车辆定位信息自动补报请求({}):{}", DataType.UP_EXG_MSG_HISTORY_LOCATION.getCode(), out); |
| | | log.debug("车辆定位信息自动补报请求({}):{}", DataType.UP_EXG_MSG_HISTORY_LOCATION.getCode(), out); |
| | | up_exg_msg_history_location(ctx, out.getGnsscenterId(), exgMsg); |
| | | break; |
| | | case UP_EXG_MSG_RETURN_STARTUP_ACK: |
| | | log.info("启动车辆定位信息交换应答({}):{}", DataType.UP_EXG_MSG_RETURN_STARTUP_ACK.getCode(), out); |
| | | log.debug("启动车辆定位信息交换应答({}):{}", DataType.UP_EXG_MSG_RETURN_STARTUP_ACK.getCode(), out); |
| | | break; |
| | | case UP_EXG_MSG_RETURN_END_ACK: |
| | | log.info("结束车辆定位信息交换应答({}):{}", DataType.UP_EXG_MSG_RETURN_END_ACK.getCode(), out); |
| | | log.debug("结束车辆定位信息交换应答({}):{}", DataType.UP_EXG_MSG_RETURN_END_ACK.getCode(), out); |
| | | break; |
| | | case UP_EXG_MSG_APPLY_FOR_MONITOR_STARTUP: |
| | | log.info("申请交换指定车辆定位信息请求({}):{}", DataType.UP_EXG_MSG_APPLY_FOR_MONITOR_STARTUP.getCode(), out); |
| | | log.debug("申请交换指定车辆定位信息请求({}):{}", DataType.UP_EXG_MSG_APPLY_FOR_MONITOR_STARTUP.getCode(), out); |
| | | break; |
| | | case UP_EXG_MSG_APPLY_FOR_MONITOR_END: |
| | | log.info("取消交换指定车辆定位信息请求({}):{}", DataType.UP_EXG_MSG_APPLY_FOR_MONITOR_END.getCode(), out); |
| | | log.debug("取消交换指定车辆定位信息请求({}):{}", DataType.UP_EXG_MSG_APPLY_FOR_MONITOR_END.getCode(), out); |
| | | break; |
| | | case UP_EXG_MSG_APPLY_HISGNSSDATA_REQ: |
| | | log.info("车辆定位信息补发请求({}):{}", DataType.UP_EXG_MSG_APPLY_HISGNSSDATA_REQ.getCode(), out); |
| | | log.debug("车辆定位信息补发请求({}):{}", DataType.UP_EXG_MSG_APPLY_HISGNSSDATA_REQ.getCode(), out); |
| | | break; |
| | | case UP_EXG_MSG_REPORT_DRIVER_INFO_ACK: |
| | | log.info("上报驾驶员身份信息应答({}):{}", DataType.UP_EXG_MSG_REPORT_DRIVER_INFO_ACK.getCode(), out); |
| | | log.debug("上报驾驶员身份信息应答({}):{}", DataType.UP_EXG_MSG_REPORT_DRIVER_INFO_ACK.getCode(), out); |
| | | up_exg_msg_report_driver_info_ack(ctx, out.getGnsscenterId(), exgMsg); |
| | | break; |
| | | case UP_EXG_MSG_TAKE_EWAYBILL_ACK: |
| | | log.info("上报车辆电子运单应答消息({}):{}", DataType.UP_EXG_MSG_TAKE_EWAYBILL_ACK.getCode(), out); |
| | | log.debug("上报车辆电子运单应答消息({}):{}", DataType.UP_EXG_MSG_TAKE_EWAYBILL_ACK.getCode(), out); |
| | | up_exg_msg_take_ewaybill_ack(ctx, out.getGnsscenterId(), exgMsg); |
| | | break; |
| | | default: |
| | |
| | | upExgMsgRegister.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRegister.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | UPExgMsgRegister register = upExgMsgRegisterDao.findByVehicleNo(upExgMsgRegister.getVehicleNo()); |
| | | log.info("上传车辆注册信息({}):{}", DataType.UP_EXG_MSG_REGISTER.getCode(), JSON.toJSON(upExgMsgRegister)); |
| | | if (null == register) { |
| | | upExgMsgRegisterDao.save(upExgMsgRegister); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 上传车辆实时定位信息 |
| | | * |
| | | * @param ctx |
| | | */ |
| | | public void up_exg_msg_real_location(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = new UPExgMsgRealLocation().decode(exgMsg); |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | log.info("上传车辆实时定位信息({}):{}", DataType.UP_EXG_MSG_REAL_LOCATION.getCode(), JSON.toJSON(upExgMsgRealLocation)); |
| | | //修改车辆实时定位 |
| | | GnssDataVo vo = new GnssDataVo(); |
| | | BeanUtils.copyProperties(upExgMsgRealLocation.getGnssData(), vo); |
| | | redisTemplate.opsForValue().set("location:" + upExgMsgRealLocation.getVehicleNo(), vo); |
| | | //查询车辆信息,没有则主动发起请求 |
| | | UPExgMsgRegister msgRegister = upExgMsgRegisterDao.findByVehicleNo(upExgMsgRealLocation.getVehicleNo()); |
| | | if (null == msgRegister) { |
| | | down_base_msg_vehicle_added(inferiorPlatformId, upExgMsgRealLocation.getVehicleNo(), upExgMsgRealLocation.getVehicleColor()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆定位信息自动补报请求 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_history_location(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgHistoryLocation upExgMsgHistoryLocation = new UPExgMsgHistoryLocation().decode(exgMsg); |
| | | upExgMsgHistoryLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgHistoryLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgHistoryLocationDao.save(upExgMsgHistoryLocation); |
| | | log.info("车辆定位信息自动补报请求({}):{}", DataType.UP_EXG_MSG_HISTORY_LOCATION.getCode(), JSON.toJSONString(upExgMsgHistoryLocation)); |
| | | |
| | | //将数据存储实时定位数据表中 |
| | | List<GnssData> gnssData = upExgMsgHistoryLocation.getGnssData(); |
| | | for (GnssData gnssDatum : gnssData) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = new UPExgMsgRealLocation(); |
| | | upExgMsgRealLocation.setVehicleNo(upExgMsgHistoryLocation.getVehicleNo()); |
| | | upExgMsgRealLocation.setVehicleColor(upExgMsgHistoryLocation.getVehicleColor()); |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setDataType(DataType.UP_EXG_MSG_REAL_LOCATION.getCode()); |
| | | upExgMsgRealLocation.setGnssData(gnssDatum); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 上报驾驶员身份识别信息应答 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_report_driver_info_ack(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgReportDriverInfoAck upExgMsgReportDriverInfoAck = new UPExgMsgReportDriverInfoAck().decode(exgMsg); |
| | | upExgMsgReportDriverInfoAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgReportDriverInfoAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgReportDriverInfoAckDao.save(upExgMsgReportDriverInfoAck); |
| | | log.info("上报驾驶员身份信息应答({}):{}", DataType.UP_EXG_MSG_REPORT_DRIVER_INFO_ACK.getCode(), JSON.toJSONString(upExgMsgReportDriverInfoAck)); |
| | | } |
| | | |
| | | /** |
| | | * 上报车辆电子运单应答 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_take_ewaybill_ack(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgTakeEwayBillAck upExgMsgTakeEwayBillAck = new UPExgMsgTakeEwayBillAck().decode(exgMsg); |
| | | upExgMsgTakeEwayBillAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgTakeEwayBillAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | UPExgMsgTakeEwayBillAck byVehicleNo = upExgMsgTakeEwayBillAckDao.findByVehicleNo(upExgMsgTakeEwayBillAck.getVehicleNo()); |
| | | log.info("上报车辆电子运单应答消息({}):{}", DataType.UP_EXG_MSG_TAKE_EWAYBILL_ACK.getCode(), JSON.toJSONString(upExgMsgTakeEwayBillAck)); |
| | | if (null == byVehicleNo) { |
| | | upExgMsgTakeEwayBillAckDao.save(upExgMsgTakeEwayBillAck); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 补报车辆静态信息 |
| | | */ |
| | | public void down_base_msg_vehicle_added(int inferiorPlatformId, String vehicleNo, int VehicleColor) { |
| | | if (!redisTemplate.hasKey("login:" + inferiorPlatformId)) { |
| | | log.error("链路还未登录校验,拒绝连接:{}", inferiorPlatformId); |
| | | return; |
| | | } |
| | | DOWNBaseMsgVehicleAdded downBaseMsgVehicleAdded = new DOWNBaseMsgVehicleAdded(); |
| | | downBaseMsgVehicleAdded.setVehicleNo(vehicleNo); |
| | | downBaseMsgVehicleAdded.setVehicleColor(VehicleColor); |
| | | downBaseMsgVehicleAdded.setDataType(DataType.DOWN_BASE_MSG_VEHICLE_ADDED.getCode()); |
| | | downBaseMsgVehicleAdded.setDataLength(0); |
| | | |
| | | byte[] body = downBaseMsgVehicleAdded.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_BASE_MSG.getCode(), inferiorPlatformId, body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | | channel.writeAndFlush(out); |
| | | log.info("补报车辆静态信息请求({}):{}", DataType.DOWN_BASE_MSG_VEHICLE_ADDED.getCode(), JSON.toJSONString(downBaseMsgVehicleAdded)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 定时获取司机基础信息 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传车辆实时定位信息 |
| | | * |
| | | * @param ctx |
| | | */ |
| | | public void up_exg_msg_real_location(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = new UPExgMsgRealLocation().decode(exgMsg); |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | //修改车辆实时定位 |
| | | GnssDataVo vo = new GnssDataVo(); |
| | | BeanUtils.copyProperties(upExgMsgRealLocation.getGnssData(), vo); |
| | | redisTemplate.opsForValue().set("location:" + upExgMsgRealLocation.getVehicleNo(), vo); |
| | | //查询车辆信息,没有则主动发起请求 |
| | | UPExgMsgRegister msgRegister = upExgMsgRegisterDao.findByVehicleNo(upExgMsgRealLocation.getVehicleNo()); |
| | | if (null == msgRegister) { |
| | | down_base_msg_vehicle_added(inferiorPlatformId, upExgMsgRealLocation.getVehicleNo(), upExgMsgRealLocation.getVehicleColor()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取车辆运单信息 |
| | | */ |
| | |
| | | down_exg_msg_take_ewaybill_req(pojo.getInferiorPlatformId(), pojo.getVehicleNo(), pojo.getVehicleColor()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报车辆电子运单请求 |
| | |
| | | if (null != channel && channel.isActive()) { |
| | | channel.writeAndFlush(out); |
| | | log.info("上报车辆电子运单请求({}):{}", DataType.DOWN_EXG_MSG_TAKE_EWAYBILL_REQ.getCode(), JSON.toJSONString(downExgMsgTakeEwaybillReq)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 车辆定位信息自动补报请求 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_history_location(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgHistoryLocation upExgMsgHistoryLocation = new UPExgMsgHistoryLocation().decode(exgMsg); |
| | | upExgMsgHistoryLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgHistoryLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgHistoryLocationDao.save(upExgMsgHistoryLocation); |
| | | |
| | | //将数据存储实时定位数据表中 |
| | | List<GnssData> gnssData = upExgMsgHistoryLocation.getGnssData(); |
| | | for (GnssData gnssDatum : gnssData) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = new UPExgMsgRealLocation(); |
| | | upExgMsgRealLocation.setVehicleNo(upExgMsgHistoryLocation.getVehicleNo()); |
| | | upExgMsgRealLocation.setVehicleColor(upExgMsgHistoryLocation.getVehicleColor()); |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setDataType(DataType.UP_EXG_MSG_REAL_LOCATION.getCode()); |
| | | upExgMsgRealLocation.setGnssData(gnssDatum); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报驾驶员身份识别信息应答 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_report_driver_info_ack(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgReportDriverInfoAck upExgMsgReportDriverInfoAck = new UPExgMsgReportDriverInfoAck().decode(exgMsg); |
| | | upExgMsgReportDriverInfoAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgReportDriverInfoAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgReportDriverInfoAckDao.save(upExgMsgReportDriverInfoAck); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报车辆电子运单应答 |
| | | * |
| | | * @param ctx |
| | | * @param inferiorPlatformId |
| | | * @param exgMsg |
| | | */ |
| | | public void up_exg_msg_take_ewaybill_ack(ChannelHandlerContext ctx, int inferiorPlatformId, UPExgMsg exgMsg) { |
| | | UPExgMsgTakeEwayBillAck upExgMsgTakeEwayBillAck = new UPExgMsgTakeEwayBillAck().decode(exgMsg); |
| | | upExgMsgTakeEwayBillAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgTakeEwayBillAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | UPExgMsgTakeEwayBillAck byVehicleNo = upExgMsgTakeEwayBillAckDao.findByVehicleNo(upExgMsgTakeEwayBillAck.getVehicleNo()); |
| | | if (null == byVehicleNo) { |
| | | upExgMsgTakeEwayBillAckDao.save(upExgMsgTakeEwayBillAck); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 补报车辆静态信息 |
| | | */ |
| | | public void down_base_msg_vehicle_added(int inferiorPlatformId, String vehicleNo, int VehicleColor) { |
| | | if (!redisTemplate.hasKey("login:" + inferiorPlatformId)) { |
| | | log.error("链路还未登录校验,拒绝连接:{}", inferiorPlatformId); |
| | | return; |
| | | } |
| | | DOWNBaseMsgVehicleAdded downBaseMsgVehicleAdded = new DOWNBaseMsgVehicleAdded(); |
| | | downBaseMsgVehicleAdded.setVehicleNo(vehicleNo); |
| | | downBaseMsgVehicleAdded.setVehicleColor(VehicleColor); |
| | | downBaseMsgVehicleAdded.setDataType(DataType.DOWN_BASE_MSG_VEHICLE_ADDED.getCode()); |
| | | downBaseMsgVehicleAdded.setDataLength(0); |
| | | |
| | | byte[] body = downBaseMsgVehicleAdded.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_BASE_MSG.getCode(), inferiorPlatformId, body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | | channel.writeAndFlush(out); |
| | | log.info("补报车辆静态信息请求({}):{}", DataType.DOWN_BASE_MSG_VEHICLE_ADDED.getCode(), JSON.toJSONString(downBaseMsgVehicleAdded)); |
| | | } |
| | | } |
| | | |
| | |
| | | DataType dataType = DataType.getDataType(platformMsg.getDataType()); |
| | | switch (dataType) { |
| | | case UP_PLATFORM_MSG_POST_QUERY_ACK: |
| | | log.info("平台查岗应答消息({}):{}", DataType.UP_PLATFORM_MSG_POST_QUERY_ACK.getCode(), platformMsg); |
| | | log.debug("平台查岗应答消息({}):{}", DataType.UP_PLATFORM_MSG_POST_QUERY_ACK.getCode(), platformMsg); |
| | | break; |
| | | case UP_PLATFORM_MSG_INFO_ACK: |
| | | log.info("下发平台间报文应答消息({}):{}", DataType.UP_PLATFORM_MSG_INFO_ACK.getCode(), platformMsg); |
| | | log.debug("下发平台间报文应答消息({}):{}", DataType.UP_PLATFORM_MSG_INFO_ACK.getCode(), platformMsg); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.dataInterchange.dao.UPPlaybackMsgControlAckDao; |
| | | import com.ruoyi.dataInterchange.dao.UPPlaybackMsgStartupAckDao; |
| | | import com.ruoyi.dataInterchange.model.PlaybackMsg; |
| | |
| | | DataType dataType = DataType.getDataType(realVideoMsg.getDataType()); |
| | | switch (dataType) { |
| | | case UP_PLAYBACK_MSG_STARTUP_ACK: |
| | | log.info("远程录像回放请求应答({}):{}", DataType.UP_PLAYBACK_MSG_STARTUP_ACK.getCode(), out); |
| | | log.debug("远程录像回放请求应答({}):{}", DataType.UP_PLAYBACK_MSG_STARTUP_ACK.getCode(), out); |
| | | up_playback_msg_startup_ack(ctx, out.getGnsscenterId(), realVideoMsg); |
| | | break; |
| | | case UP_PLAYBACK_MSG_CONTROL_ACK: |
| | | log.info("远程录像回放控制请求应答({}):{}", DataType.UP_PLAYBACK_MSG_CONTROL_ACK.getCode(), out); |
| | | log.debug("远程录像回放控制请求应答({}):{}", DataType.UP_PLAYBACK_MSG_CONTROL_ACK.getCode(), out); |
| | | up_playback_msg_control_ack(ctx, out.getGnsscenterId(), realVideoMsg); |
| | | break; |
| | | default: |
| | |
| | | upPlaybackMsgStartupAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upPlaybackMsgStartupAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upPlaybackMsgStartupAckDao.save(upPlaybackMsgStartupAck); |
| | | log.info("远程录像回放请求应答({}):{}", DataType.UP_PLAYBACK_MSG_STARTUP_ACK.getCode(), JSON.toJSONString(upPlaybackMsgStartupAck)); |
| | | } |
| | | |
| | | |
| | |
| | | upPlaybackMsgControlAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upPlaybackMsgControlAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upPlaybackMsgControlAckDao.save(upPlaybackMsgControlAck); |
| | | log.info("远程录像回放控制请求应答({}):{}", DataType.UP_PLAYBACK_MSG_CONTROL_ACK.getCode(), JSON.toJSONString(upPlaybackMsgControlAck)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.dataInterchange.dao.UPRealvideoMsgEndAckDao; |
| | | import com.ruoyi.dataInterchange.dao.UPRealvideoMsgStartupAckDao; |
| | | import com.ruoyi.dataInterchange.model.RealVideoMsg; |
| | |
| | | DataType dataType = DataType.getDataType(realVideoMsg.getDataType()); |
| | | switch (dataType) { |
| | | case UP_REALVIDEO_MSG_STARTUP_ACK: |
| | | log.info("实时音视频请求应答({}):{}", DataType.UP_REALVIDEO_MSG_STARTUP_ACK.getCode(), out); |
| | | log.debug("实时音视频请求应答({}):{}", DataType.UP_REALVIDEO_MSG_STARTUP_ACK.getCode(), out); |
| | | up_realvideo_msg_startup_ack(ctx, out.getGnsscenterId(), realVideoMsg); |
| | | break; |
| | | case UP_REALVIDEO_MSG_END_ACK: |
| | | log.info("主动请求停止实时音视频应答({}):{}", DataType.UP_REALVIDEO_MSG_END_ACK.getCode(), out); |
| | | log.debug("主动请求停止实时音视频应答({}):{}", DataType.UP_REALVIDEO_MSG_END_ACK.getCode(), out); |
| | | up_realvideo_msg_end_ack(ctx, out.getGnsscenterId(), realVideoMsg); |
| | | break; |
| | | default: |
| | |
| | | upRealvideoMsgStartupAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upRealvideoMsgStartupAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upRealvideoMsgStartupAckDao.save(upRealvideoMsgStartupAck); |
| | | log.info("实时音视频请求应答({}):{}", DataType.UP_REALVIDEO_MSG_STARTUP_ACK.getCode(), JSON.toJSONString(upRealvideoMsgStartupAck)); |
| | | } |
| | | |
| | | |
| | |
| | | upRealvideoMsgEndAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upRealvideoMsgEndAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upRealvideoMsgEndAckDao.save(upRealvideoMsgEndAck); |
| | | log.info("主动请求停止实时音视频应答({}):{}", DataType.UP_REALVIDEO_MSG_END_ACK.getCode(), JSON.toJSONString(upRealvideoMsgEndAck)); |
| | | } |
| | | } |
| | |
| | | //均辉报警类型 |
| | | private List<Integer> jh_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0203, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307); |
| | | //出租车报警类型 |
| | | private List<Integer> cz_warnType = Arrays.asList(0x0001, 0x0005); |
| | | private List<Integer> cz_warnType = Arrays.asList(0x0001, 0x0004, 0x0005); |
| | | //公交报警类型 |
| | | private List<Integer> gj_warnType = Arrays.asList(0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0001); |
| | | //平安报警类型 |
| | |
| | | DataType dataType = DataType.getDataType(warnMsg.getDataType()); |
| | | switch (dataType) { |
| | | case UP_WARN_MSG_URGE_TODO_ACK: |
| | | log.info("报警督办应答消息({}):{}", DataType.UP_WARN_MSG_URGE_TODO_ACK.getCode(), out); |
| | | log.debug("报警督办应答消息({}):{}", DataType.UP_WARN_MSG_URGE_TODO_ACK.getCode(), out); |
| | | up_warn_msg_urge_todo_ack(ctx, out.getGnsscenterId(), warnMsg); |
| | | break; |
| | | case UP_WARN_MSG_ADPT_INFO: |
| | | log.info("上报报警信息({}):{}", DataType.UP_WARN_MSG_ADPT_INFO.getCode(), out); |
| | | log.debug("上报报警信息({}):{}", DataType.UP_WARN_MSG_ADPT_INFO.getCode(), out); |
| | | up_warn_msg_adpt_info(ctx, out.getGnsscenterId(), warnMsg); |
| | | break; |
| | | case UP_WARN_MSG_OPERATION_INFO: |
| | | log.info("上报报警处理信息({}):{}", DataType.UP_WARN_MSG_OPERATION_INFO.getCode(), out); |
| | | log.debug("上报报警处理信息({}):{}", DataType.UP_WARN_MSG_OPERATION_INFO.getCode(), out); |
| | | up_warn_msg_operation_info(ctx, out.getGnsscenterId(), warnMsg); |
| | | break; |
| | | case UP_WARN_MSG_FILELIST_ACK: |
| | | log.info("报警附件目录请求应答({}):{}", DataType.UP_WARN_MSG_FILELIST_ACK.getCode(), out); |
| | | log.debug("报警附件目录请求应答({}):{}", DataType.UP_WARN_MSG_FILELIST_ACK.getCode(), out); |
| | | up_warn_msg_filelist_ack(ctx, out.getGnsscenterId(), warnMsg); |
| | | break; |
| | | default: |
| | |
| | | upWarnMsgUrgeTodoAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgUrgeTodoAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upWarnMsgUrgeTodoAckDao.save(upWarnMsgUrgeTodoAck); |
| | | log.info("报警督办应答消息({}):{}", DataType.UP_WARN_MSG_URGE_TODO_ACK.getCode(), JSON.toJSONString(upWarnMsgUrgeTodoAck)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo); |
| | | log.info("上报报警信息({}):{}", DataType.UP_WARN_MSG_ADPT_INFO.getCode(), JSON.toJSONString(upWarnMsgAdptInfo)); |
| | | |
| | | //请求报警附件(川标协议) |
| | | if(enterprise.contains(inferiorPlatformId)){ |
| | |
| | | upWarnMsgOperationInfo.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgOperationInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upWarnMsgOperationInfoDao.save(upWarnMsgOperationInfo); |
| | | log.info("上报报警处理信息({}):{}", DataType.UP_WARN_MSG_OPERATION_INFO.getCode(), JSON.toJSONString(upWarnMsgOperationInfo)); |
| | | //修改报警处理结果 |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(upWarnMsgOperationInfo.getInfoId()); |
| | | if(null != upWarnMsgAdptInfo){ |
| | |
| | | upWarnMsgFileListAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgFileListAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upWarnMsgFileListAckDao.save(upWarnMsgFileListAck); |
| | | log.info("报警附件目录请求应答({}):{}", DataType.UP_WARN_MSG_FILELIST_ACK.getCode(), JSON.toJSONString(upWarnMsgFileListAck)); |
| | | //修改报警附件数据 |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(upWarnMsgFileListAck.getInfoId()); |
| | | if(upWarnMsgFileListAck.getFileList().size() > 0){ |
| | |
| | | package com.ruoyi.dataInterchange.util; |
| | | |
| | | import com.ruoyi.dataInterchange.server.DOWNConnectRspService; |
| | | import com.ruoyi.dataInterchange.server.ExgMsgService; |
| | | import com.ruoyi.dataInterchange.server.WarnMsgService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | /** |
| | | * 报警督办请求 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskUrgeTodo() { |
| | | warnMsgService.taskUrgeTodo(); |
| | | } |
| | | // @Scheduled(fixedRate = 1000 * 60) |
| | | // public void taskUrgeTodo() { |
| | | // warnMsgService.taskUrgeTodo(); |
| | | // } |
| | | } |
| | |
| | | package com.ruoyi.dataInterchange.util.jtt809.decoder; |
| | | |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.ByteArrayUtil; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Constant; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | | import com.ruoyi.dataInterchange.util.jtt809.gnsscenter.GnssCenterService; |
| | |
| | | } |
| | | byte[] readableBytes = new byte[msg.readableBytes()]; |
| | | msg.readBytes(readableBytes); |
| | | log.info("接收到数据包, packetLen : {}, packet : {}", readableBytes.length, ByteArrayUtil.bytes2HexStr(readableBytes)); |
| | | // log.info("接收到数据包, packetLen : {}, packet : {}", readableBytes.length, ByteArrayUtil.bytes2HexStr(readableBytes)); |
| | | // 反转义处理 |
| | | byte[] bytes = Jtt809Util.unescape(readableBytes); |
| | | ByteBuf byteBuf = Unpooled.wrappedBuffer(bytes); |
| | | log.info("反转义后数据包, packetLen : {}, packet : {}", bytes.length, ByteArrayUtil.bytes2HexStr(bytes)); |
| | | // log.info("反转义后数据包, packetLen : {}, packet : {}", bytes.length, ByteArrayUtil.bytes2HexStr(bytes)); |
| | | // 判断包头 |
| | | if (byteBuf.readByte() != Jtt809Constant.PACKET_HEAD_FLAG) { |
| | | byteBuf.resetReaderIndex(); |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="E:/VehicleSupervisionPlatform/app/logs/ruoyi-order" /> |
| | | <property name="log.path" value="/mnt/java/log/dataInterchange" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |