Browse Source

修改执行操作为情报板的数据接收

增加对语音广播设备控制
develop
Mr.Wang 9 months ago
parent
commit
fee158eedb
  1. 44
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

44
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.zc.business.constant.DeviceFunctionIdConstants; import com.zc.business.constant.DeviceFunctionIdConstants;
import com.zc.business.constant.DeviceTypeConstants; import com.zc.business.constant.DeviceTypeConstants;
import com.zc.business.controller.BroadcastController;
import com.zc.business.controller.DcDeviceController; import com.zc.business.controller.DcDeviceController;
import com.zc.business.domain.*; import com.zc.business.domain.*;
import com.zc.business.enums.*; import com.zc.business.enums.*;
@ -40,6 +41,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
@Resource @Resource
private DcDeviceController dcDeviceController; private DcDeviceController dcDeviceController;
@Resource @Resource
private BroadcastController broadcastController;
@Resource
private EventPlanAssocMapper eventPlanAssocMapper; private EventPlanAssocMapper eventPlanAssocMapper;
@ -489,25 +492,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_13; functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_13;
List<Map<String,String>> list = new ArrayList<>(); List<Map<String,String>> list = new ArrayList<>();
Map<String,String> parameters = new HashMap<>(); Map<String,String> parameters = new HashMap<>();
DcInfoBoardTemplate dcInfoBoardTemplate = JSON.parseObject(
JSON.toJSONString(otherConfig.get("dcInfoBoardTemplate")),
DcInfoBoardTemplate.class);
// stopTime // stopTime
parameters.put("STAY",otherConfig.get("STAY").toString()); parameters.put("STAY",dcInfoBoardTemplate.getStopTime());
// inScreenMode // inScreenMode
parameters.put("ACTION",otherConfig.get("ACTION").toString()); parameters.put("ACTION",dcInfoBoardTemplate.getInScreenMode());
// fontSpacing // fontSpacing
parameters.put("SPEED",otherConfig.get("SPEED").toString()); parameters.put("SPEED",dcInfoBoardTemplate.getFontSpacing());
// fontColor // fontColor
parameters.put("COLOR",otherConfig.get("COLOR").toString()); parameters.put("COLOR",dcInfoBoardTemplate.getFontColor());
// fontType // fontType
parameters.put("FONT",otherConfig.get("FONT").toString()); parameters.put("FONT",dcInfoBoardTemplate.getFontType());
// fontSize // fontSize
parameters.put("FONT_SIZE",otherConfig.get("FONT_SIZE").toString()); parameters.put("FONT_SIZE",dcInfoBoardTemplate.getFontSize());
// content // content
parameters.put("CONTENT",otherConfig.get("CONTENT").toString()); parameters.put("CONTENT",dcInfoBoardTemplate.getContent());
// screenSize 768*64 宽度和高度 // screenSize 768*64 宽度和高度
parameters.put("width",otherConfig.get("width").toString()); parameters.put("width",dcInfoBoardTemplate.getScreenSize().split("\\*")[0]);
parameters.put("height",otherConfig.get("height").toString()); parameters.put("height",dcInfoBoardTemplate.getScreenSize().split("\\*")[1]);
// formatStyle // formatStyle
parameters.put("formatStyle",otherConfig.get("formatStyle").toString()); parameters.put("formatStyle",dcInfoBoardTemplate.getFormatStyle());
list.add(parameters); list.add(parameters);
props11.put("parameters",list); props11.put("parameters",list);
AjaxResult ajaxResult13 = dcDeviceController.invokedFunction(iotDeviceId, functionId, props11); AjaxResult ajaxResult13 = dcDeviceController.invokedFunction(iotDeviceId, functionId, props11);
@ -529,6 +535,24 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
} }
} }
} }
else if (device.getDeviceType().equals(DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING)) {
// 路段广播
JSONObject params = new JSONObject();
params.put("name","task-event");
params.put("outVVol","8");
params.put("priority","1");
params.put("text",otherConfig.get("content"));
params.put("repeatTimes","3");
params.put("functionType","startPaTts");
JSONArray termList = new JSONArray();
termList.add(JSON.parseObject(device.getOtherConfig()));
params.put("termList",termList);
JSONObject returnResult =broadcastController.nearCamListDistance(params);
JSONObject result = new JSONObject();
result.put("device", device.getId());
result.put("result", returnResult);
resultArray.add(result);
}
else { else {
break; break;
} }

Loading…
Cancel
Save