|
|
|
@ -108,6 +108,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询站点月报运行数据 |
|
|
|
|
* |
|
|
|
|
* @param mon |
|
|
|
|
* @param stationCode |
|
|
|
|
* @return |
|
|
|
@ -123,7 +124,8 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
} |
|
|
|
|
RunDataShowVo data = new RunDataShowVo(); |
|
|
|
|
BeanUtil.copyProperties(entity, data); |
|
|
|
|
List<RunDataVo> runs = JSONObject.parseObject(entity.getRunData(),new TypeReference<List<RunDataVo>>(){}); |
|
|
|
|
List<RunDataVo> runs = JSONObject.parseObject(entity.getRunData(), new TypeReference<List<RunDataVo>>() { |
|
|
|
|
}); |
|
|
|
|
if (CollectionUtil.isEmpty(runs)) { |
|
|
|
|
return data; |
|
|
|
|
} |
|
|
|
@ -156,9 +158,9 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 导出站点月报文件 |
|
|
|
|
* |
|
|
|
|
* @param mon |
|
|
|
|
* @param stationCode |
|
|
|
|
*/ |
|
|
|
@ -174,7 +176,8 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
if (ObjectUtil.isEmpty(data)) { |
|
|
|
|
throw new ServiceException("站点" + mon + "月份未生成运行月报数据!"); |
|
|
|
|
} |
|
|
|
|
List<RunDataVo> runs = JSONObject.parseObject(data.getRunData(),new TypeReference<List<RunDataVo>>(){}); |
|
|
|
|
List<RunDataVo> runs = JSONObject.parseObject(data.getRunData(), new TypeReference<List<RunDataVo>>() { |
|
|
|
|
}); |
|
|
|
|
if (CollectionUtil.isNotEmpty(runs)) { |
|
|
|
|
// 保留两位小数
|
|
|
|
|
data.setRunData(JSONObject.toJSONString(runs.stream().map(run -> { |
|
|
|
@ -210,6 +213,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 生成站点月报 |
|
|
|
|
* |
|
|
|
|
* @param mon |
|
|
|
|
* @param stationCode |
|
|
|
|
* @return |
|
|
|
@ -297,6 +301,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 调用大模型分析月报接口 |
|
|
|
|
* |
|
|
|
|
* @param mon 月报月份 |
|
|
|
|
* @param stationCode 月报站号 |
|
|
|
|
*/ |
|
|
|
@ -329,6 +334,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 填充大模型分析所需数据格式 |
|
|
|
|
* |
|
|
|
|
* @param req 月报数据 |
|
|
|
|
* @param analyseVOList 大模型分析对象 |
|
|
|
|
* @param month 查询月报筛选条件 |
|
|
|
@ -385,6 +391,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建大模型分析所需对象 |
|
|
|
|
* |
|
|
|
|
* @param deviceName 设备名称 |
|
|
|
|
* @param month 对象月份 |
|
|
|
|
* @param deviceOrder 设备序号 |
|
|
|
@ -443,6 +450,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 先删除原先月报数据 |
|
|
|
|
* |
|
|
|
|
* @param mon |
|
|
|
|
* @param stationCode |
|
|
|
|
*/ |
|
|
|
@ -459,6 +467,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行数据 |
|
|
|
|
* |
|
|
|
|
* @param devices |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -491,6 +500,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 实际发电量 |
|
|
|
|
* |
|
|
|
|
* @param type |
|
|
|
|
* @param deviceCode |
|
|
|
|
* @param ride |
|
|
|
@ -512,6 +522,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 计划发电量 |
|
|
|
|
* |
|
|
|
|
* @param type |
|
|
|
|
* @param stationCode |
|
|
|
|
* @param plans |
|
|
|
@ -536,6 +547,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取运行数据 |
|
|
|
|
* |
|
|
|
|
* @param device |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -557,6 +569,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取时间范围内运行时长 |
|
|
|
|
* |
|
|
|
|
* @param realId |
|
|
|
|
* @param startDate |
|
|
|
|
* @param endDate |
|
|
|
@ -581,6 +594,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取运行时长 |
|
|
|
|
* |
|
|
|
|
* @param result |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -614,6 +628,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 告警数据 |
|
|
|
|
* |
|
|
|
|
* @param code |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -627,6 +642,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询hz3000告警 |
|
|
|
|
* |
|
|
|
|
* @param code |
|
|
|
|
*/ |
|
|
|
|
private List<RunAlarmVo> hz3000Alarm(String code, String start, String end) { |
|
|
|
@ -654,6 +670,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 智能预警 |
|
|
|
|
* |
|
|
|
|
* @param code |
|
|
|
|
* @param start |
|
|
|
|
* @param end |
|
|
|
@ -685,6 +702,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行曲线 |
|
|
|
|
* |
|
|
|
|
* @param devices |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -703,11 +721,10 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取曲线数据 |
|
|
|
|
* |
|
|
|
|
* @param attributes |
|
|
|
|
* @param deviceCode |
|
|
|
|
* @return |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
private List<EchartVo> curve(List<AttributeVo> attributes, String start, String end, String deviceCode) { |
|
|
|
|
List<AnalyzeDataConditionVO> datas = dataService.periodTargetSignages(start, end, 3, 3, deviceCode, attributes.stream().map(AttributeVo::getSignage).collect(Collectors.toList())); |
|
|
|
@ -756,6 +773,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 曲线属性获取 |
|
|
|
|
* |
|
|
|
|
* @param attributeType |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -820,6 +838,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 检查站点是否存在设备信息 |
|
|
|
|
* |
|
|
|
|
* @param stationCode |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -848,8 +867,14 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean evaluate(Long id, String text) { |
|
|
|
|
return this.update(Wrappers.<RunMonthEntity>lambdaUpdate().set(RunMonthEntity::getEvaluation, text).eq(RunMonthEntity::getId, id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 手绘运行数据表格 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private Workbook drawBook(String headerName, RunMonthEntity entity) { |
|
|
|
@ -906,6 +931,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 绘制机组曲线 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param rowNumber |
|
|
|
|
* @param data |
|
|
|
@ -919,7 +945,8 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
sheet.addMergedRegion(region); |
|
|
|
|
return rowNumber + 1; |
|
|
|
|
} |
|
|
|
|
List<CurveEchartVo> curves = JSONObject.parseObject(data,new TypeReference<List<CurveEchartVo>>(){}); |
|
|
|
|
List<CurveEchartVo> curves = JSONObject.parseObject(data, new TypeReference<List<CurveEchartVo>>() { |
|
|
|
|
}); |
|
|
|
|
if (CollectionUtil.isEmpty(curves)) { |
|
|
|
|
// 绘制空表格
|
|
|
|
|
this.emptyRow(hssWB, sheet, rowNumber); |
|
|
|
@ -941,6 +968,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 绘制曲线 |
|
|
|
|
* |
|
|
|
|
* @param loadCurve |
|
|
|
|
* @param rowNumber |
|
|
|
|
*/ |
|
|
|
@ -1000,6 +1028,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 曲线转数组对象 |
|
|
|
|
* |
|
|
|
|
* @param curves |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -1024,6 +1053,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行数据分析填充 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
* @param rowNumber |
|
|
|
@ -1053,6 +1083,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行建议及其他填充 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
* @param rowNumber |
|
|
|
@ -1081,6 +1112,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置头部 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
*/ |
|
|
|
@ -1098,6 +1130,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置标题表头 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
*/ |
|
|
|
@ -1114,6 +1147,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行数据表头绘制 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
*/ |
|
|
|
@ -1142,6 +1176,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 运行数据填充 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
* @param rowNumber |
|
|
|
@ -1156,7 +1191,8 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
sheet.addMergedRegion(region); |
|
|
|
|
return rowNumber + 1; |
|
|
|
|
} |
|
|
|
|
List<RunDataVo> runData = JSONObject.parseObject(data,new TypeReference<List<RunDataVo>>(){}); |
|
|
|
|
List<RunDataVo> runData = JSONObject.parseObject(data, new TypeReference<List<RunDataVo>>() { |
|
|
|
|
}); |
|
|
|
|
if (CollectionUtil.isEmpty(runData)) { |
|
|
|
|
// 绘制空表格
|
|
|
|
|
this.emptyRow(hssWB, sheet, rowNumber); |
|
|
|
@ -1227,6 +1263,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 绘制空表格 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
* @param rowNumber |
|
|
|
@ -1257,6 +1294,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 告警数据表头绘制 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
*/ |
|
|
|
@ -1285,6 +1323,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 告警数据填充 |
|
|
|
|
* |
|
|
|
|
* @param hssWB |
|
|
|
|
* @param sheet |
|
|
|
|
* @param rowNumber |
|
|
|
@ -1299,7 +1338,8 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
|
|
|
|
|
sheet.addMergedRegion(region); |
|
|
|
|
return rowNumber + 1; |
|
|
|
|
} |
|
|
|
|
List<RunAlarmVo> runAlarm = JSONObject.parseObject(data,new TypeReference<List<RunAlarmVo>>(){}); |
|
|
|
|
List<RunAlarmVo> runAlarm = JSONObject.parseObject(data, new TypeReference<List<RunAlarmVo>>() { |
|
|
|
|
}); |
|
|
|
|
if (CollectionUtil.isEmpty(runAlarm)) { |
|
|
|
|
// 绘制空表格
|
|
|
|
|
this.emptyRow(hssWB, sheet, rowNumber); |
|
|
|
|