|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.config.DataSyncConfig; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.HKConstants; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.*; | 
|---|
|  |  |  | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsInfoRequest; | 
|---|
|  |  |  | 
|---|
|  |  |  | if( data.getHPVehicleStatus() ==null  ){ | 
|---|
|  |  |  | continue;//如何推送状态集合为空,不处理跳过 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //各车道车辆状态 | 
|---|
|  |  |  | EventPlatformCarsStatusInfoRequest status = data.getHPVehicleStatus(); | 
|---|
|  |  |  | eventList.add(initPlatformEventModel(request,data,status));//封装事件(已月台通道为维度) | 
|---|
|  |  |  | PlatformDevice model = platformDeviceMapper.selectOne(new QueryWrapper<PlatformDevice>().lambda() | 
|---|
|  |  |  | .eq(PlatformDevice::getDeviceId,request.getSrcIndex()) | 
|---|
|  |  |  | .eq(PlatformDevice::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .last("limit 1")); | 
|---|
|  |  |  | if(model ==null){ | 
|---|
|  |  |  | continue;//监控点未同步,跳过处理 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //各车道车辆状态 | 
|---|
|  |  |  | EventPlatformCarsStatusInfoRequest status = data.getHPVehicleStatus(); | 
|---|
|  |  |  | eventList.add(initPlatformEventModel(request,data,status));//封装事件(已月台通道为维度) | 
|---|
|  |  |  | if(StringUtils.isBlank(status.getPlateNo())){ | 
|---|
|  |  |  | continue;//如果车辆信息为空,不处理直接跳过 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(Constants.equalsInteger(device.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | //如果是LED | 
|---|
|  |  |  | PlatformBroadcastLog log = new PlatformBroadcastLog(); | 
|---|
|  |  |  | log.setCreateDate(new Date()); | 
|---|
|  |  |  | log.setBizType(Constants.ONE); | 
|---|
|  |  |  | log.setHkDate(new Date()); | 
|---|
|  |  |  | log.setObjType(Constants.ONE); | 
|---|
|  |  |  | log.setIds(device.getHkNo()); | 
|---|
|  |  |  | log.setRemark(device.getName()); | 
|---|
|  |  |  | log.setInfo(content); | 
|---|
|  |  |  | log.setNum(Constants.ONE); | 
|---|
|  |  |  | BaseResponse response = dealLedContentBiz(device.getHkNo(),content,speed,1); | 
|---|
|  |  |  | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | log.setHkInfo("请求失败:"+JSONObject.toJSONString(response)); | 
|---|
|  |  |  | log.setHkStatus(Constants.THREE); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | log.setHkInfo("请求成功"); | 
|---|
|  |  |  | log.setHkStatus(Constants.TWO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.setDeviceType(Constants.ONE); | 
|---|
|  |  |  | log.setName("设置LED屏显内容"); | 
|---|
|  |  |  | PlatformBroadcastLog log = dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1); | 
|---|
|  |  |  | logList.add(log); | 
|---|
|  |  |  | ledList.add(device.getHkId()); | 
|---|
|  |  |  | }else  if(Constants.equalsInteger(device.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | 
|---|
|  |  |  | broadcastList.add(device.getHkId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(broadcastList.size()>0){ | 
|---|
|  |  |  | String content1 =Constants.PlatformBroadcastContent.WRONG_IN.getInfo(); | 
|---|
|  |  |  | content1 = content1.replace("${param}",model.getCarCodeFront()); | 
|---|
|  |  |  | PlatformBroadcastLog log = new PlatformBroadcastLog(); | 
|---|
|  |  |  | log.setCreateDate(new Date()); | 
|---|
|  |  |  | log.setBizType(Constants.ONE); | 
|---|
|  |  |  | log.setHkDate(new Date()); | 
|---|
|  |  |  | log.setObjType(Constants.ONE); | 
|---|
|  |  |  | log.setInfo(content1); | 
|---|
|  |  |  | log.setRemark(bNames); | 
|---|
|  |  |  | log.setNum(Constants.ONE); | 
|---|
|  |  |  | log.setIds(String.join(",",broadcastList)); | 
|---|
|  |  |  | CustomBroadcastRequest request = new CustomBroadcastRequest(); | 
|---|
|  |  |  | request.setAudioPointIndexCode(broadcastList); | 
|---|
|  |  |  | request.setPlayDuration(15);//单位秒 | 
|---|
|  |  |  | request.setBroadCastMode("tts"); | 
|---|
|  |  |  | request.setPriority(1); | 
|---|
|  |  |  | request.setState(1);//播放/停止标识 1-播放,0-停止 | 
|---|
|  |  |  | request.setPlayTtsContent(content1); | 
|---|
|  |  |  | BaseResponse response =  HKService.customBroadcast(request); | 
|---|
|  |  |  | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | log.setHkInfo("请求失败:"+JSONObject.toJSONString(response)); | 
|---|
|  |  |  | log.setHkStatus(Constants.THREE); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | log.setHkInfo("请求成功"); | 
|---|
|  |  |  | log.setHkStatus(Constants.TWO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.setDeviceType(Constants.ONE); | 
|---|
|  |  |  | log.setName("发送广播播报内容"); | 
|---|
|  |  |  | PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames); | 
|---|
|  |  |  | logList.add(log); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(logList.size()>0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static BaseResponse dealLedContentBiz(String hkNo, String content,int speed,int color) { | 
|---|
|  |  |  | private PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames) { | 
|---|
|  |  |  | PlatformBroadcastLog log = new PlatformBroadcastLog(); | 
|---|
|  |  |  | String content1 =Constants.PlatformBroadcastContent.WRONG_IN.getInfo(); | 
|---|
|  |  |  | content1 = content1.replace("${param}",model.getCarCodeFront()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | log.setCreateDate(new Date()); | 
|---|
|  |  |  | log.setBizType(Constants.ONE); | 
|---|
|  |  |  | log.setHkDate(new Date()); | 
|---|
|  |  |  | log.setObjType(Constants.ONE); | 
|---|
|  |  |  | log.setInfo(content1); | 
|---|
|  |  |  | log.setRemark(bNames); | 
|---|
|  |  |  | log.setNum(Constants.ONE); | 
|---|
|  |  |  | log.setIds(String.join(",",broadcastList)); | 
|---|
|  |  |  | CustomBroadcastRequest request = new CustomBroadcastRequest(); | 
|---|
|  |  |  | request.setAudioPointIndexCode(broadcastList); | 
|---|
|  |  |  | request.setPlayDuration(15);//单位秒 | 
|---|
|  |  |  | request.setBroadCastMode("tts"); | 
|---|
|  |  |  | request.setPriority(1); | 
|---|
|  |  |  | request.setState(1);//播放/停止标识 1-播放,0-停止 | 
|---|
|  |  |  | request.setPlayTtsContent(content1); | 
|---|
|  |  |  | BaseResponse response =  HKService.customBroadcast(request); | 
|---|
|  |  |  | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | log.setHkInfo("请求失败:"+JSONObject.toJSONString(response)); | 
|---|
|  |  |  | log.setHkStatus(Constants.THREE); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | log.setHkInfo("请求成功"); | 
|---|
|  |  |  | log.setHkStatus(Constants.TWO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.setDeviceType(Constants.ONE); | 
|---|
|  |  |  | log.setName("发送广播播报内容"); | 
|---|
|  |  |  | return  log; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static PlatformBroadcastLog dealLedContentBiz(String hkNo,String hkName, String content,int speed,int color) { | 
|---|
|  |  |  | PlatformBroadcastLog log = new PlatformBroadcastLog(); | 
|---|
|  |  |  | log.setCreateDate(new Date()); | 
|---|
|  |  |  | log.setBizType(Constants.ONE); | 
|---|
|  |  |  | log.setHkDate(new Date()); | 
|---|
|  |  |  | log.setObjType(Constants.ONE); | 
|---|
|  |  |  | log.setIds(hkNo); | 
|---|
|  |  |  | log.setRemark(hkName); | 
|---|
|  |  |  | log.setInfo(content); | 
|---|
|  |  |  | log.setNum(Constants.ONE); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | TransparentChannelBodyRequest body = new TransparentChannelBodyRequest(); | 
|---|
|  |  |  | TransparentChannelHeadRequest head = new TransparentChannelHeadRequest(); | 
|---|
|  |  |  | TransparentChannelBodyParamRequest request = new TransparentChannelBodyParamRequest(); | 
|---|
|  |  |  | 
|---|
|  |  |  | request.getRegions().add(regions); | 
|---|
|  |  |  | regions.setSpeed(speed>0?speed:13); | 
|---|
|  |  |  | body.setParams(request); | 
|---|
|  |  |  | return HKService.transparentchannel(head,body); | 
|---|
|  |  |  | BaseResponse response =  HKService.transparentchannel(head,body); | 
|---|
|  |  |  | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ | 
|---|
|  |  |  | log.setHkInfo("请求失败:"+JSONObject.toJSONString(response)); | 
|---|
|  |  |  | log.setHkStatus(Constants.THREE); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | log.setHkInfo("请求成功"); | 
|---|
|  |  |  | log.setHkStatus(Constants.TWO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.setDeviceType(Constants.ONE); | 
|---|
|  |  |  | log.setName("设置LED屏显内容"); | 
|---|
|  |  |  | return log; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|