| | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | upWarnMsgUrgeTodoAckDao.save(upWarnMsgUrgeTodoAck); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //走川标的公司 |
| | | private List<Integer> enterprise = Arrays.asList(17458936, 43984060, 13914394); |
| | | |
| | | |
| | | /** |
| | | * 上报报警信息 |
| | | * |
| | |
| | | * @param warnMsg |
| | | */ |
| | | public void up_warn_msg_adpt_info(ChannelHandlerContext ctx, int inferiorPlatformId, WarnMsg warnMsg) { |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = new UPWarnMsgAdptInfo().decode(warnMsg); |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = enterprise.contains(inferiorPlatformId) ? new UPWarnMsgAdptInfo().decode2(warnMsg) : new UPWarnMsgAdptInfo().decode1(warnMsg); |
| | | upWarnMsgAdptInfo.setResult(0x00); |
| | | upWarnMsgAdptInfo.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | if(0 == upWarnMsgAdptInfo.getLongitude()){ |
| | | UPExgMsgRealLocation upExgMsgRealLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(upWarnMsgAdptInfo.getVehicleNo()); |
| | | if (null != upExgMsgRealLocation) { |
| | | GnssData gnssData = upExgMsgRealLocation.getGnssData(); |
| | | upWarnMsgAdptInfo.setSpeed(gnssData.getVec1()); |
| | | upWarnMsgAdptInfo.setLongitude(gnssData.getLon()); |
| | | upWarnMsgAdptInfo.setLatitude(gnssData.getLat()); |
| | | } |
| | | }else if(2 != upWarnMsgAdptInfo.getLevel()){ |
| | | return; |
| | | } |
| | | upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo); |
| | | } |
| | |
| | | * 定时任务督办报警请求 |
| | | */ |
| | | public void taskUrgeTodo() { |
| | | List<UPWarnMsgAdptInfo> list = upWarnMsgAdptInfoDao.findByResultIsAndPushTimeBefore(0x00, LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | List<UPWarnMsgAdptInfo> list = upWarnMsgAdptInfoDao.findByResultIsAndLevelNotNullAndPushTimeBefore(0x00, LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | for (UPWarnMsgAdptInfo upWarnMsgAdptInfo : list) { |
| | | down_warn_msg_urge_todo_req(upWarnMsgAdptInfo); |
| | | } |