| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | |
| | | import com.doumee.core.haikang.model.param.request.CustomBroadcastRequest; |
| | | import com.doumee.core.haikang.model.param.request.TransparentChannelSingleRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private PlatformBroadcastLogMapper platformBroadcastLogMapper; |
| | | @Autowired |
| | | private InterfaceLogMapper interfaceLogMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<Device> findList(Device device) { |
| | | device.setIsdeleted(Constants.ZERO); |
| | | QueryWrapper<Device> wrapper = new QueryWrapper<>(device); |
| | | return deviceMapper.selectList(wrapper); |
| | | } |
| | |
| | | } |
| | | } |
| | | @Override |
| | | public String setBroadcaseBobaoHttp(Device param){ |
| | | Device model = deviceMapper.selectById(param.getId()); |
| | | if(model ==null && Constants.equalsInteger(param.getType(),Constants.FOUR)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String input = ""; |
| | | |
| | | model.setSendInfo(param.getSendInfo()); |
| | | return sendBroadcaseBobaoHttpBiz(model,interfaceLogMapper); |
| | | } |
| | | public static String sendBroadcaseBobaoHttpBiz(Device model,InterfaceLogMapper interfaceLogMapper){ |
| | | //重新下发计划 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("command","start"); |
| | | jsonObject.put("TTSContent",model.getSendInfo()); |
| | | jsonObject.put("audioLevel",6); |
| | | jsonObject.put("audioVolume",100); |
| | | jsonObject.put("TTSLanguageType","chinese"); |
| | | jsonObject.put("voiceType","female"); |
| | | jsonObject.put("pace",50); |
| | | JSONArray a = new JSONArray(); |
| | | a.add(1); |
| | | jsonObject.put("audioOutID",a); |
| | | String params =jsonObject.toJSONString(); |
| | | log.error("========海康广播播放入参内容 : " + params); |
| | | String result = HttpsUtil.doPutHk(model.getIp(),Integer.parseInt(StringUtils.defaultString(model.getPort(),"80")),model.getDoorId(), model.getDoorName() |
| | | ,"/ISAPI/AccessControl/EventCardLinkageCfg/TTSAudio?format=json",params); |
| | | log.error("========海康广播播放返回内容 : " + result); |
| | | |
| | | JSONObject resultJson = JSONObject.parseObject(result); |
| | | Boolean success = false; |
| | | if(Constants.equalsInteger(resultJson.getInteger("statusCode"),Constants.ONE)){ |
| | | success = true; |
| | | } |
| | | InterfaceLog log = new InterfaceLog(); |
| | | log.setCreateDate(new Date()); |
| | | log.setUrl("/ISAPI/AccessControl/EventCardLinkageCfg/TTSAudio?format=json"); |
| | | log.setEditDate(log.getCreateDate()); |
| | | log.setPlat(Constants.ZERO); |
| | | log.setName("海康广播播放"); |
| | | log.setIsdeleted(Constants.ZERO); |
| | | log.setRequest(params); |
| | | log.setType(Constants.ZERO); |
| | | log.setSuccess(success?Constants.ZERO:Constants.ONE); |
| | | log.setRepose(result); |
| | | interfaceLogMapper.insert(log); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | @Override |
| | | public void setLedContent(TransparentChannelSingleRequest model) { |
| | | Device device = findById(model.getDeviceId()); |
| | | if(device == null |
| | |
| | | }catch (Exception e){ |
| | | log.error( "对不起,屏幕内容设置异常"+ device.getName()); |
| | | } |
| | | |
| | | } |
| | | log.error( "屏幕内容设置=======================结束========" ); |
| | | } |