diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java index f37afff4..15bdbb98 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java @@ -1,27 +1,17 @@ package com.zc.business.service.impl; -import cn.hutool.core.io.unit.DataUnit; -import cn.hutool.core.lang.hash.Hash; import com.ruoyi.common.utils.DateUtils; import com.zc.business.domain.DcEventType; import com.zc.business.domain.DcWarning; import com.zc.business.mapper.DcPerceivedEventsWarningMapper; import com.zc.business.service.IDCPerceivedEventsWarningService; -import lombok.val; -import org.checkerframework.framework.qual.FromByteCode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Calendar; -import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; /** * @author 王思祥 @@ -217,40 +207,8 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa } return numList; } -// @Override -// public List> selectSectionMark(DcWarning dcWarning) { -// List> mapList = perceivedEventsWarningMapper.selectSectionMark(dcWarning); -// -// List> result = new ArrayList<>(); -// for (HashMap list : mapList) { -// String stakeMarkId = list.get("stakeMark").toString(); -// dcWarning.setStakeMark(stakeMarkId); -// switch (dcWarning.getType()) { -// case "day": -// result.add(addSectionNumber( stakeMarkId, perceivedEventsWarningMapper.selectWarningMarkDay(dcWarning))); -// break; -// case "month": -// result.add(addSectionNumber( stakeMarkId, perceivedEventsWarningMapper.selectWarningMarkMonth(dcWarning))); -// break; -// case "quarter": -// result.add(addSectionNumber( stakeMarkId, perceivedEventsWarningMapper.selectWarningMarkQuarter(dcWarning))); -// break; -// case "year": -// result.add(addSectionNumber( stakeMarkId, perceivedEventsWarningMapper.selectWarningMarkYear(dcWarning))); -// break; -// default: -// result.add(addSectionNumber(stakeMarkId, "")); -// } -// } -// return result; -// } -// -// private HashMap addSectionNumber( String stakeMarkId, Object sectionNumber) { -// HashMap mapNum = new HashMap<>(); -// mapNum.put("stakeMarkId", stakeMarkId); -// mapNum.put("sectionNumber", sectionNumber); -// return mapNum; -// } + + //预警事件,事件列表 查询状态为上报的感知事件 @Override public List> selectWarningEscalation(DcWarning dcWarning) { diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index e1036cc4..fd980029 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -3,6 +3,7 @@ package com.zc.business.service.impl; import java.util.HashMap; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.uuid.IdUtils; import com.zc.business.mapper.DcWarningMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -61,6 +62,9 @@ public class DcWarningServiceImpl implements IDcWarningService public int insertDcWarning(DcWarning dcWarning) { dcWarning.setCreateTime(DateUtils.getNowDate()); + //设置事件Id UUID无下划线格式32 + String uuid = IdUtils.fastSimpleUUID(); + dcWarning.setId(uuid); return dcWarningMapper.insertDcWarning(dcWarning); }