Browse Source

修改事件确定中的事件预案关联表存储

develop
Mr.Wang 6 months ago
parent
commit
7928338686
  1. 6
      zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java
  2. 13
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  3. 2
      zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

6
zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java

@ -58,4 +58,10 @@ public class EventPlanAssoc {
*/ */
@ApiModelProperty("执行操作结果") @ApiModelProperty("执行操作结果")
private String controlResult; private String controlResult;
/**
* 执行操作
*/
@ApiModelProperty("执行操作")
private String control;
} }

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

@ -170,12 +170,12 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
dcExecuteActions.forEach(dcExecuteAction -> { dcExecuteActions.forEach(dcExecuteAction -> {
JSONObject executeConfig = JSON.parseObject(dcExecuteAction.getExecuteConfig()); JSONObject executeConfig = JSON.parseObject(dcExecuteAction.getExecuteConfig());
if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.ROAD_SECTION_VOICE_BROADCASTING.getCode() if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.ROAD_SECTION_VOICE_BROADCASTING.getCode()
&& executeConfig.get("operationType").equals("2")) { && executeConfig.getString("operationType").equals("2")) {
// 执行操作中智能发布语音广播 // 执行操作中智能发布语音广播
String content = intelligentPublishingOfInformation(dcEvent); String content = intelligentPublishingOfInformation(dcEvent);
updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection()); updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection());
} else if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.VARIABLE_INFORMATION_FLAG.getCode() } else if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.VARIABLE_INFORMATION_FLAG.getCode()
&& executeConfig.get("operationType").equals("2")) { && executeConfig.getString("operationType").equals("2")) {
// 执行操作中智能发布情报板 // 执行操作中智能发布情报板
String content = intelligentPublishingOfInformation(dcEvent); String content = intelligentPublishingOfInformation(dcEvent);
updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection()); updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection());
@ -753,6 +753,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
eventPlanAssoc.setControlDevice(deviceIds.toString().replaceFirst(";", "")); eventPlanAssoc.setControlDevice(deviceIds.toString().replaceFirst(";", ""));
eventPlanAssoc.setControlResult(resultArray.toJSONString()); eventPlanAssoc.setControlResult(resultArray.toJSONString());
eventPlanAssoc.setCreateTime(DateUtils.getNowDate()); eventPlanAssoc.setCreateTime(DateUtils.getNowDate());
eventPlanAssoc.setControl(JSON.toJSONString(dcEmergencyPlans.getDcExecuteAction()));
eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc); eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc);
resultObject.put("eventPlanAssocId",eventPlanAssoc.getId()); resultObject.put("eventPlanAssocId",eventPlanAssoc.getId());
@ -819,7 +820,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
else if (device.getDeviceType().equals(DeviceTypeConstants.VARIABLE_INFORMATION_FLAG.toString())) { else if (device.getDeviceType().equals(DeviceTypeConstants.VARIABLE_INFORMATION_FLAG.toString())) {
if (operationType == 1) { if (operationType == 1) {
// 情报板发布全流程 // 情报板发布全流程
if (otherConfig.get("operationType").equals("2")) { if (otherConfig.getString("operationType").equals("2")) {
JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString()); JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString());
JSONObject foundContent = contentList.stream() JSONObject foundContent = contentList.stream()
.map(content -> JSON.parseObject(content.toString())) .map(content -> JSON.parseObject(content.toString()))
@ -843,7 +844,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
} else { } else {
// 恢复操作 // 恢复操作
if (otherConfig.get("operationType").equals("2")) { if (otherConfig.getString("operationType").equals("2")) {
// 还原上次 // 还原上次
props.put("fileId", "10"); props.put("fileId", "10");
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_1B; functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_1B;
@ -869,7 +870,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
params.put("name", "task-event"); params.put("name", "task-event");
params.put("outVVol", "8"); params.put("outVVol", "8");
params.put("priority", "1"); params.put("priority", "1");
if (otherConfig.get("operationType").equals("2")) { if (otherConfig.getString("operationType").equals("2")) {
// 智能发布 // 智能发布
JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString()); JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString());
JSONObject foundContent = contentList.stream() JSONObject foundContent = contentList.stream()
@ -1169,7 +1170,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}else if (dcExecuteAction.getDeviceType() == DeviceTypeConstants.VARIABLE_INFORMATION_FLAG || }else if (dcExecuteAction.getDeviceType() == DeviceTypeConstants.VARIABLE_INFORMATION_FLAG ||
dcExecuteAction.getDeviceType() == DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING) { dcExecuteAction.getDeviceType() == DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING) {
// 情报板/语音广播 // 情报板/语音广播
if (jsonObject.get("operationType").equals("1")) { if (jsonObject.getString("operationType").equals("1")) {
config.put("content",jsonObject.get("content")); config.put("content",jsonObject.get("content"));
}else { }else {
config.put("operationType","智能发布"); config.put("operationType","智能发布");

2
zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="controlResult != null and controlResult !=''">control_result,</if> <if test="controlResult != null and controlResult !=''">control_result,</if>
<if test="control != null and control !=''">control,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventId != null and eventId != ''">#{eventId},</if> <if test="eventId != null and eventId != ''">#{eventId},</if>
@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="controlResult != null and controlResult !=''">#{controlResult},</if> <if test="controlResult != null and controlResult !=''">#{controlResult},</if>
<if test="control != null and control !=''">#{control},</if>
</trim> </trim>
</insert> </insert>

Loading…
Cancel
Save