| | |
| | | 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(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){ |
| | | PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames); |
| | | logList.add(log); |
| | | } |
| | | if(logList.size()>0){ |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | } |
| | | |
| | | 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()); |
| | | PlatformBroadcastLog log = new PlatformBroadcastLog(); |
| | | |
| | | log.setCreateDate(new Date()); |
| | | log.setBizType(Constants.ONE); |
| | | log.setHkDate(new Date()); |
| | |
| | | } |
| | | log.setDeviceType(Constants.ONE); |
| | | log.setName("发送广播播报内容"); |
| | | logList.add(log); |
| | | } |
| | | if(logList.size()>0){ |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | return log; |
| | | } |
| | | |
| | | public static BaseResponse dealLedContentBiz(String hkNo, String content,int speed,int color) { |
| | | 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; |
| | | } |
| | | } |