Browse Source

感知id

develop
wangsixiang 1 year ago
parent
commit
4cdb9a52d5
  1. 46
      zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java
  2. 4
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

46
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<HashMap<String, Object>> selectSectionMark(DcWarning dcWarning) {
// List<HashMap<String, Object>> mapList = perceivedEventsWarningMapper.selectSectionMark(dcWarning);
//
// List<HashMap<String, Object>> result = new ArrayList<>();
// for (HashMap<String, Object> 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<String, Object> addSectionNumber( String stakeMarkId, Object sectionNumber) {
// HashMap<String, Object> mapNum = new HashMap<>();
// mapNum.put("stakeMarkId", stakeMarkId);
// mapNum.put("sectionNumber", sectionNumber);
// return mapNum;
// }
//预警事件,事件列表 查询状态为上报的感知事件
@Override
public List<HashMap<String, Object>> selectWarningEscalation(DcWarning dcWarning) {

4
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);
}

Loading…
Cancel
Save