| | |
| | | @Resource |
| | | private UPExgMsgRealLocationDao upExgMsgRealLocationDao; |
| | | //走川标的公司 |
| | | private List<Integer> enterprise = Arrays.asList(17458936, 43984060, 13914394); |
| | | //固定报警类型 |
| | | private List<Integer> warnType = Arrays.asList(0x0201, 0x0202, 0x0301, 0x000B, 0x0012, 0x0203, 0x0208, 0x0002, 0x0211, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307); |
| | | private List<Integer> enterprise = Arrays.asList(17458936,13914394,43984060,25439966); |
| | | //富临报警类型 |
| | | private List<Integer> fl_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0203, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217); |
| | | //均辉报警类型 |
| | | 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> gj_warnType = Arrays.asList(0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0001); |
| | | //平安报警类型 |
| | | private List<Integer> pa_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307); |
| | | |
| | | |
| | | public void up_warn_msg(ChannelHandlerContext ctx, OuterPacket out) { |
| | |
| | | */ |
| | | public void up_warn_msg_adpt_info(ChannelHandlerContext ctx, int inferiorPlatformId, WarnMsg warnMsg) { |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = enterprise.contains(inferiorPlatformId) ? new UPWarnMsgAdptInfo().decode2(warnMsg) : new UPWarnMsgAdptInfo().decode1(warnMsg); |
| | | if(!warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | switch (inferiorPlatformId) { |
| | | case 17458936: |
| | | if(!fl_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | case 43984060: |
| | | if(!jh_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | case 17235341: |
| | | if(!cz_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | case 82296583: |
| | | if(!cz_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | case 25439966: |
| | | if(!gj_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | case 13914394: |
| | | if(!pa_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | } |
| | | upWarnMsgAdptInfo.setResult(0x00); |
| | | upWarnMsgAdptInfo.setInferiorPlatformId(inferiorPlatformId); |
| | |
| | | } |
| | | } |
| | | //请求报警附件(川标协议) |
| | | if(enterprise.contains(inferiorPlatformId) && null == upWarnMsgAdptInfo.getPicUrl()){ |
| | | if(enterprise.contains(inferiorPlatformId) && !StringUtils.hasLength(upWarnMsgAdptInfo.getPicUrl())){ |
| | | DOWNWarnMsgFileListReq downWarnMsgFileListReq = new DOWNWarnMsgFileListReq(); |
| | | downWarnMsgFileListReq.setVehicleNo(upWarnMsgAdptInfo.getVehicleNo()); |
| | | downWarnMsgFileListReq.setVehicleColor(upWarnMsgAdptInfo.getVehicleColor()); |
| | |
| | | } |
| | | } |
| | | |
| | | down_warn_msg_urge_todo_req(upWarnMsgAdptInfo); |
| | | // down_warn_msg_urge_todo_req(upWarnMsgAdptInfo); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | upWarnMsgAdptInfo.setInfoId(data.getAlarmId()); |
| | | upWarnMsgAdptInfo.setLevel(getLevel(data.getLevel())); |
| | | if(null != data.getLatitude()){ |
| | | upWarnMsgAdptInfo.setLongitude(data.getLatitude().intValue() * 10); |
| | | } |
| | | if(null != data.getLongitude()){ |
| | | upWarnMsgAdptInfo.setLatitude(data.getLongitude().intValue()); |
| | | // if(null != data.getLatitude()){ |
| | | // upWarnMsgAdptInfo.setLongitude(data.getLatitude().intValue() * 10); |
| | | // } |
| | | // if(null != data.getLongitude()){ |
| | | // upWarnMsgAdptInfo.setLatitude(data.getLongitude().intValue()); |
| | | // } |
| | | //调用获取实时定位数据 |
| | | 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{ |
| | | return; |
| | | } |
| | | if(null != data.getHeight()){ |
| | | upWarnMsgAdptInfo.setAltitude(data.getHeight().intValue() / 10); |
| | |
| | | upWarnMsgAdptInfo.setInfoContent(data.getAlarmInfo()); |
| | | upWarnMsgAdptInfo.setInferiorPlatformId(25439966); |
| | | upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | if(!warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | if(!gj_warnType.contains(upWarnMsgAdptInfo.getWarnType())){ |
| | | return; |
| | | } |
| | | upWarnMsgAdptInfo.setResult(0x00); |