|
|
@ -21,6 +21,7 @@ import com.zc.business.utils.StakeMarkUtils; |
|
|
|
import com.zc.business.utils.diff.Diff; |
|
|
|
import com.zc.business.utils.diff.model.Result; |
|
|
|
import com.zc.common.core.websocket.WebSocketService; |
|
|
|
import com.zc.common.core.websocket.constant.WebSocketEvent; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -573,7 +574,12 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
Map<String, Object> contentMap = new HashMap<>(); |
|
|
|
contentMap.put("content", content); |
|
|
|
contentMap.put("event", dcEvent); |
|
|
|
WebSocketService.broadcast(SUBEVENT, contentMap); //推送事件消息 0不是感知事件
|
|
|
|
|
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT, contentMap); //推送事件消息 0不是感知事件
|
|
|
|
|
|
|
|
Long count = getCountNum(); |
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//根据路网设施查询桩号
|
|
|
@ -1051,6 +1057,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
//推送待处理数量
|
|
|
|
Long count = getCountNum(); |
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count); |
|
|
|
return i7; |
|
|
|
|
|
|
|
} |
|
|
@ -1223,6 +1232,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
int i = dcEventMapper.updateDcEventState(id, state); |
|
|
|
if (i > 0) { |
|
|
|
|
|
|
|
//推送待处理数量
|
|
|
|
Long count = getCountNum(); |
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count); |
|
|
|
|
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); |
|
|
|
|
|
|
|
//中间库
|
|
|
@ -1929,26 +1943,18 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
* |
|
|
|
* @author liuwenge |
|
|
|
* @date 2024/6/6 18:45 |
|
|
|
* @param type 类型 1:告警 2:待确认 3:处置中 |
|
|
|
* @param |
|
|
|
* @return com.ruoyi.common.core.domain.AjaxResult |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public AjaxResult getCountNum(String type){ |
|
|
|
if (StringUtils.isEmpty(type)){ |
|
|
|
return AjaxResult.error("类型不能为空"); |
|
|
|
} |
|
|
|
public Long getCountNum(){ |
|
|
|
|
|
|
|
Long warningCount = dcWarningMapper.selectWarningNum(); |
|
|
|
|
|
|
|
Long eventCount = dcEventMapper.selectEventNumByStatus("0"); |
|
|
|
|
|
|
|
Long num = 0L; |
|
|
|
//告警
|
|
|
|
if (type.equals("1")){ |
|
|
|
num = dcWarningMapper.selectWarningNum(); |
|
|
|
} else if (type.equals("2")){ |
|
|
|
num = dcEventMapper.selectEventNumByStatus("0"); |
|
|
|
} else if (type.equals("3")){ |
|
|
|
num = dcEventMapper.selectEventNumByStatus("1"); |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success(num); |
|
|
|
return warningCount + eventCount; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|