diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 721ec105..8200b27e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/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.zc.business.constant.DeviceFunctionIdConstants; import com.zc.business.constant.DeviceTypeConstants; +import com.zc.business.controller.BroadcastController; import com.zc.business.controller.DcDeviceController; import com.zc.business.domain.*; import com.zc.business.enums.*; @@ -40,6 +41,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { @Resource private DcDeviceController dcDeviceController; @Resource + private BroadcastController broadcastController; + @Resource private EventPlanAssocMapper eventPlanAssocMapper; @@ -489,25 +492,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_13; List> list = new ArrayList<>(); Map parameters = new HashMap<>(); + DcInfoBoardTemplate dcInfoBoardTemplate = JSON.parseObject( + JSON.toJSONString(otherConfig.get("dcInfoBoardTemplate")), + DcInfoBoardTemplate.class); // stopTime - parameters.put("STAY",otherConfig.get("STAY").toString()); + parameters.put("STAY",dcInfoBoardTemplate.getStopTime()); // inScreenMode - parameters.put("ACTION",otherConfig.get("ACTION").toString()); + parameters.put("ACTION",dcInfoBoardTemplate.getInScreenMode()); // fontSpacing - parameters.put("SPEED",otherConfig.get("SPEED").toString()); + parameters.put("SPEED",dcInfoBoardTemplate.getFontSpacing()); // fontColor - parameters.put("COLOR",otherConfig.get("COLOR").toString()); + parameters.put("COLOR",dcInfoBoardTemplate.getFontColor()); // fontType - parameters.put("FONT",otherConfig.get("FONT").toString()); + parameters.put("FONT",dcInfoBoardTemplate.getFontType()); // fontSize - parameters.put("FONT_SIZE",otherConfig.get("FONT_SIZE").toString()); + parameters.put("FONT_SIZE",dcInfoBoardTemplate.getFontSize()); // content - parameters.put("CONTENT",otherConfig.get("CONTENT").toString()); + parameters.put("CONTENT",dcInfoBoardTemplate.getContent()); // screenSize 768*64 宽度和高度 - parameters.put("width",otherConfig.get("width").toString()); - parameters.put("height",otherConfig.get("height").toString()); + parameters.put("width",dcInfoBoardTemplate.getScreenSize().split("\\*")[0]); + parameters.put("height",dcInfoBoardTemplate.getScreenSize().split("\\*")[1]); // formatStyle - parameters.put("formatStyle",otherConfig.get("formatStyle").toString()); + parameters.put("formatStyle",dcInfoBoardTemplate.getFormatStyle()); list.add(parameters); props11.put("parameters",list); 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 { break; }