在线监测功能
1.预处理生成超标数据和无数据监测点数据 2.分页查询数据 3.生成预告警单(处理中)
This commit is contained in:
@@ -31,16 +31,26 @@ public class OnlineParam extends BaseParam implements Serializable {
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty(value = "指标")
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "指标id")
|
||||
private String targetId;
|
||||
|
||||
@ApiModelProperty(value = "指标集合")
|
||||
private List<String> targetList;
|
||||
|
||||
@ApiModelProperty(value = "预警阈值")
|
||||
private Integer alertThreshold;
|
||||
|
||||
@ApiModelProperty(value = "告警阈值")
|
||||
private Integer alarmThreshold;
|
||||
|
||||
@ApiModelProperty(value = "数据类型")
|
||||
private Integer dataType;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ReportParam extends OnlineParam {
|
||||
|
||||
@ApiModelProperty(name = "type", value = "0:预警单 1:告警单")
|
||||
@@ -48,7 +58,15 @@ public class OnlineParam extends BaseParam implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "issueDetail", value = "问题描述")
|
||||
private String issueDetail;
|
||||
|
||||
@ApiModelProperty(name = "year", value = "年")
|
||||
private String year;
|
||||
|
||||
@ApiModelProperty(name = "number", value = "编号")
|
||||
private String number;
|
||||
|
||||
@ApiModelProperty(name = "idList", value = "问题id集合")
|
||||
private List<String> idList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.supervision.pojo.po.device;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
@@ -31,16 +32,24 @@ public class LineWarning extends BaseEntity implements Serializable {
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
@MppMultiId(value = "alarm_time")
|
||||
private LocalDate alarmTime;
|
||||
|
||||
/**
|
||||
* 责任部门id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@MppMultiId(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 指标类型(字典id)
|
||||
*/
|
||||
@MppMultiId(value = "target_type")
|
||||
private String targetType;
|
||||
|
||||
/**
|
||||
@@ -73,9 +82,4 @@ public class LineWarning extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private Integer thresholdResource;
|
||||
|
||||
/**
|
||||
* 责任部门id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,9 +44,33 @@ public class OnlineVo implements Serializable {
|
||||
@ApiModelProperty("指标id")
|
||||
private String targetType;
|
||||
|
||||
@ApiModelProperty("累计超标天数")
|
||||
@ApiModelProperty("超标天数")
|
||||
private Integer overLimitDay;
|
||||
|
||||
@ApiModelProperty("频率偏差")
|
||||
private Integer freq;
|
||||
|
||||
@ApiModelProperty("电压偏差")
|
||||
private Integer voltage;
|
||||
|
||||
@ApiModelProperty("闪变")
|
||||
private Integer flicker;
|
||||
|
||||
@ApiModelProperty("三相电压不平衡度")
|
||||
private Integer ubalance;
|
||||
|
||||
@ApiModelProperty("负序电流")
|
||||
private Integer iNeg;
|
||||
|
||||
@ApiModelProperty("谐波电压")
|
||||
private Integer harmonicV;
|
||||
|
||||
@ApiModelProperty("谐波电流")
|
||||
private Integer harmonicI;
|
||||
|
||||
@ApiModelProperty("间谐波电压")
|
||||
private Integer inuharmV;
|
||||
|
||||
@ApiModelProperty("数据来源 0:系统默认 1:自定义")
|
||||
private Integer dataResource;
|
||||
}
|
||||
|
||||
@@ -8,10 +8,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
||||
import com.njcn.supervision.service.device.ILineWarningService;
|
||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -25,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 监测点每日稳态指标超标天数统计表 前端控制器
|
||||
@@ -44,7 +44,7 @@ public class LineWarningController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增在线监测数据")
|
||||
@ApiOperation("新增在线监测数据(连续超标天数)")
|
||||
@ApiIgnore
|
||||
public HttpResult<String> add() {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
@@ -52,6 +52,15 @@ public class LineWarningController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/heBeiNorthAdd")
|
||||
@ApiOperation("新增在线监测数据(冀北-按月统计累计超标天数)")
|
||||
public HttpResult<String> heBeiNorthAdd() {
|
||||
String methodDescribe = getMethodDescribe("heBeiNorthAdd");
|
||||
lineWarningService.addHeBeiNorthLineWarning();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("分页查询在线监测数据")
|
||||
@@ -66,9 +75,9 @@ public class LineWarningController extends BaseController {
|
||||
@PostMapping("/report")
|
||||
@ApiOperation("发起预告警单")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> startReport(@RequestBody @Validated OnlineParam.ReportParam param) {
|
||||
public HttpResult<String> startReport(@RequestBody @Validated OnlineParam.ReportParam param, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("startReport");
|
||||
lineWarningService.startReport(param);
|
||||
lineWarningService.startReport(param,response);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,4 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface LineWarningMapper extends MppBaseMapper<LineWarning> {
|
||||
|
||||
Page<OnlineVo> page(@Param("page") Page<LineWarning> page, @Param("ew") QueryWrapper<LineWarning> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@@ -29,5 +29,4 @@
|
||||
and ${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.njcn.supervision.pojo.param.device.OnlineParam;
|
||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 监测点每日稳态指标超标天数统计表 服务类
|
||||
@@ -21,6 +23,11 @@ public interface ILineWarningService extends IService<LineWarning> {
|
||||
*/
|
||||
void addLineWarning();
|
||||
|
||||
/**
|
||||
* 每日统计当前月各监测点各指标累计超标天数
|
||||
*/
|
||||
void addHeBeiNorthLineWarning();
|
||||
|
||||
/**
|
||||
* 获取在线监测的数据列表
|
||||
* @param param
|
||||
@@ -33,6 +40,6 @@ public interface ILineWarningService extends IService<LineWarning> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
void startReport(OnlineParam.ReportParam param);
|
||||
void startReport(OnlineParam.ReportParam param, HttpServletResponse response);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.njcn.supervision.service.device.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
@@ -13,11 +13,14 @@ import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.ReportLineInfoVo;
|
||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||
import com.njcn.supervision.enums.ProblemTypeEnum;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.supervision.mapper.device.LineWarningMapper;
|
||||
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||
@@ -33,9 +36,11 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -57,6 +62,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||
private final IWarningLeafletService warningLeafletService;
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -117,6 +123,68 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
this.updateBatchById(updateList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addHeBeiNorthLineWarning() {
|
||||
List<LineWarning> result = new ArrayList<>();
|
||||
//获取指标集合(10个指标,包含总指标)
|
||||
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
Map<String, DictData> targetMap = dataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
||||
//获取监测点和部门表关系
|
||||
List<DeptLine> deptLines = deptLineFeignClient.getAllData().getData();
|
||||
Map<String, List<DeptLine>> deptLineMap = deptLines.stream().collect(Collectors.groupingBy(DeptLine::getLineId));
|
||||
//获取监测点按时间统计越限天数
|
||||
LocalDate firstDayOfMonth = LocalDate.now().minusDays(1).with(TemporalAdjusters.firstDayOfMonth());
|
||||
String date = DateUtil.format(firstDayOfMonth.atStartOfDay(), DatePattern.NORM_DATE_PATTERN);
|
||||
String endDate = DateUtil.format(LocalDateTime.now().minusDays(1), DatePattern.NORM_DATE_PATTERN);
|
||||
RStatLimitQueryParam rStatLimitQueryParam = new RStatLimitQueryParam(null,date,endDate);
|
||||
List<RStatLimitTargetVO> limitTarget = limitRateDClient.monitorOverLimitDays(rStatLimitQueryParam).getData();
|
||||
//按各指标统计越限天数
|
||||
if (CollUtil.isNotEmpty(limitTarget)) {
|
||||
limitTarget.forEach(item->{
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
//频率偏差
|
||||
LineWarning l1 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FREQUENCY_DEV.getCode()).getId(),item.getFreqDevOvertime());
|
||||
//电压偏差
|
||||
LineWarning l2 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.VOLTAGE_DEV.getCode()).getId(),item.getVoltageDevOvertime());
|
||||
//长时闪变
|
||||
LineWarning l3 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FLICKER.getCode()).getId(),item.getFlickerOvertime());
|
||||
//谐波电压
|
||||
LineWarning l4 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getId(),item.getUharmOvertime());
|
||||
//谐波电流
|
||||
LineWarning l5 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_CURRENT.getCode()).getId(),item.getIharmOvertime());
|
||||
//间谐波电压
|
||||
LineWarning l6 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()).getId(),item.getInuharmOvertime());
|
||||
//负序电压不平衡度
|
||||
LineWarning l7 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.PHASE_VOLTAGE.getCode()).getId(),item.getUbalanceOvertime());
|
||||
//负序电流
|
||||
LineWarning l8 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.NEG_CURRENT.getCode()).getId(),item.getINegOvertime());
|
||||
//电压总谐波畸变率
|
||||
LineWarning l9 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.THD_V.getCode()).getId(),item.getUaberranceOvertime());
|
||||
//总稳态指标
|
||||
LineWarning l10 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.TOTAL_INDICATOR.getCode()).getId(),item.getAllOvertime());
|
||||
result.addAll(Arrays.asList(l1,l2,l3,l4,l5,l6,l7,l8,l9,l10));
|
||||
});
|
||||
}
|
||||
//将装置无数据的统计入库 按运维要求,判断装置的最新数据不是当天,则认为装置无数据
|
||||
List<LineDetailVO.noDataLineInfo> noDataLineInfo = lineFeignClient.getNoDataLine().getData();
|
||||
if (CollUtil.isNotEmpty(noDataLineInfo)) {
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0").eq(LineWarning::getAlarmTime,LocalDate.now().minusDays(1));
|
||||
this.baseMapper.delete(lambdaQueryWrapper);
|
||||
noDataLineInfo.forEach(item->{
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||
lineWarning.setDeptId(deptId);
|
||||
lineWarning.setLineId(item.getLineId());
|
||||
lineWarning.setTargetType("0");
|
||||
result.add(lineWarning);
|
||||
});
|
||||
}
|
||||
this.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
@@ -129,35 +197,66 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
.collect(Collectors.toList());
|
||||
QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(),param.getSearchEndTime());
|
||||
queryWrapper.ge("A.over_limit_day", param.getAlertThreshold());
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
queryWrapper.in("A.line_id",lineList);
|
||||
//查询无数据的监测点
|
||||
if (Objects.equals(param.getDataType(),0)){
|
||||
queryWrapper.eq("A.target_type", "0");
|
||||
}
|
||||
if (!Objects.isNull(param.getTargetId())) {
|
||||
queryWrapper.eq("A.target_type", param.getTargetId());
|
||||
//查询指标超标的监测点
|
||||
else {
|
||||
queryWrapper.ge("A.over_limit_day", param.getAlertThreshold());
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
queryWrapper.in("A.line_id",lineList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(param.getTargetList())) {
|
||||
queryWrapper.in("A.target_type", param.getTargetList());
|
||||
}
|
||||
}
|
||||
queryWrapper.orderBy(true, true, "D.Name","p4.Name","p3.Name");
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void startReport(OnlineParam.ReportParam param) {
|
||||
String dept = this.baseMapper.selectById(param.getId()).getDeptId();
|
||||
//下发预告警单
|
||||
warningLeafletService.createLeaflet(ProblemTypeEnum.ONLINE.getName(), dept,IdUtil.fastSimpleUUID(), param.getId(), ProblemTypeEnum.ONLINE.getCode(),param.getType(),param.getIssueDetail(),"");
|
||||
//更新supervision_line_warning表字段信
|
||||
LineWarning lineWarning = this.baseMapper.selectById(param.getId());
|
||||
if (lineWarning.getThresholdResource() == 0) {
|
||||
lineWarning.setInitiateWarningFlag(1);
|
||||
lineWarning.setAlertThreshold(10);
|
||||
lineWarning.setAlarmThreshold(15);
|
||||
public void startReport(OnlineParam.ReportParam param,HttpServletResponse response) {
|
||||
//获取无数据监测点集合
|
||||
List<ReportLineInfoVo> list1 = getReportLineInfo(true,param.getIdList(),null,param.getSearchBeginTime(),param.getSearchEndTime(),param.getDeptId());
|
||||
//获取谐波电压超标监测点集合
|
||||
String vCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getData().getId();
|
||||
List<ReportLineInfoVo> list2 = getReportLineInfo(false,param.getIdList(),vCode,param.getSearchBeginTime(),param.getSearchEndTime(),null);
|
||||
//获取谐波电流超标监测点集合
|
||||
String iCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_CURRENT.getCode()).getData().getId();
|
||||
List<ReportLineInfoVo> list3 = getReportLineInfo(false,param.getIdList(),iCode,param.getSearchBeginTime(),param.getSearchEndTime(),null);
|
||||
|
||||
}
|
||||
|
||||
public List<ReportLineInfoVo> getReportLineInfo(boolean type, List<String> idList, String codeId, String startTime, String endTime, String deptId) {
|
||||
List<ReportLineInfoVo> list = new ArrayList<>();
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (type) {
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0")
|
||||
.eq(LineWarning::getDeptId,deptId)
|
||||
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||
} else {
|
||||
lineWarning.setInitiateWarningFlag(1);
|
||||
lineWarning.setThresholdResource(1);
|
||||
lineWarning.setAlertThreshold(param.getAlertThreshold());
|
||||
lineWarning.setAlarmThreshold(param.getAlarmThreshold());
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,codeId)
|
||||
.in(LineWarning::getId,idList)
|
||||
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||
}
|
||||
this.baseMapper.updateById(lineWarning);
|
||||
List<LineWarning> warnings = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (CollUtil.isNotEmpty(warnings)) {
|
||||
List<String> lineList = warnings.stream().map(LineWarning::getLineId).collect(Collectors.toList());
|
||||
list = lineFeignClient.getReportLineInfo(lineList).getData();
|
||||
if (!type){
|
||||
Map<String, Integer> lineIdOverLimitDayMap = warnings.stream().collect(Collectors.toMap(LineWarning::getLineId, LineWarning::getOverLimitDay));
|
||||
list.forEach(item1 -> {
|
||||
String lineId = item1.getLineId();
|
||||
Integer overLimitDay = lineIdOverLimitDayMap.getOrDefault(lineId, null);
|
||||
if (overLimitDay != null) {
|
||||
item1.setOverDays(overLimitDay);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,6 +278,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
return result;
|
||||
}
|
||||
|
||||
public LineWarning overData(LocalDate date, String lineId, String deptId, String codeId, Integer overDays) {
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(date);
|
||||
lineWarning.setDeptId(deptId);
|
||||
lineWarning.setLineId(lineId);
|
||||
lineWarning.setTargetType(codeId);
|
||||
lineWarning.setOverLimitDay(overDays);
|
||||
return lineWarning;
|
||||
}
|
||||
|
||||
public int overDay(String code, RStatLimitTargetDPO limitTarget) {
|
||||
int result = 0;
|
||||
try {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user