Commit a1ab7d1a authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer' into developer

parents db2ac63c f161c3b2
...@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -48,7 +49,7 @@ public class SurveyInformationDto extends BaseDto { ...@@ -48,7 +49,7 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty(value = "制单人") @ApiModelProperty(value = "制单人")
private String creator; private String creator;
@JsonFormat(pattern="yyyy-MM-dd") @JsonFormat(pattern="yyyy-MM-dd HH:ss:mm")
@ApiModelProperty(value = "制单时间") @ApiModelProperty(value = "制单时间")
private Date creatorTime; private Date creatorTime;
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.joda.time.LocalDateTime;
import java.util.Date; import java.util.Date;
......
...@@ -449,7 +449,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -449,7 +449,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr()); surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setCreatorTime(new Date()); //制单时间
surveyInfoAllDto.getSurveyInformation().setCreatorTime(surveyInformation.getCreatorTime());
QueryWrapper<SurveyDetails> surveyDetailsQueryWrapper = new QueryWrapper<>(); QueryWrapper<SurveyDetails> surveyDetailsQueryWrapper = new QueryWrapper<>();
surveyDetailsQueryWrapper.eq("survey_information_id", surveyInformationId); surveyDetailsQueryWrapper.eq("survey_information_id", surveyInformationId);
SurveyDetails surveyDetails = surveyDetailsService.getBaseMapper().selectOne(surveyDetailsQueryWrapper); SurveyDetails surveyDetails = surveyDetailsService.getBaseMapper().selectOne(surveyDetailsQueryWrapper);
......
...@@ -77,7 +77,6 @@ public class KafkaConsumerService { ...@@ -77,7 +77,6 @@ public class KafkaConsumerService {
// 相关性 // 相关性
@Value("${base.url.XGX:http://10.20.1.29:8052/intelligent-analysis/correlation}") @Value("${base.url.XGX:http://10.20.1.29:8052/intelligent-analysis/correlation}")
private String baseUrlXGX; private String baseUrlXGX;
// 工况划分 // 工况划分
@Value("${base.url.GKHF:http://10.20.1.29:8052/intelligent-analysis/working-condition-division}") @Value("${base.url.GKHF:http://10.20.1.29:8052/intelligent-analysis/working-condition-division}")
private String baseUrlGKHF; private String baseUrlGKHF;
......
...@@ -2115,8 +2115,6 @@ public class CommonServiceImpl { ...@@ -2115,8 +2115,6 @@ public class CommonServiceImpl {
"------------------------------------------调用风机健康指数计算算法结束----------------------------------------"); "------------------------------------------调用风机健康指数计算算法结束----------------------------------------");
logger.info("------------------------------------------开始计算预警----------------------------------------"); logger.info("------------------------------------------开始计算预警----------------------------------------");
// healthStatusIndicatorService.healthWarningMinute(calendar, time);
// ++++++++++
healthStatusIndicatorService.healthWarningMinute(time); healthStatusIndicatorService.healthWarningMinute(time);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -713,11 +713,10 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -713,11 +713,10 @@ public class HealthStatusIndicatorServiceImpl {
/*** /***
* 每五小时获取一次最大粒度内的指数异常数据 * 每五小时获取一次最大粒度内的指数异常数据
* 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成 * 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
* * TdengineTimeServiceImpl计算完调用
*/ */
@Scheduled(cron = "0 0 0/1 * * ?") //@Scheduled(cron = "0 0 0/1 * * ?")
// @Scheduled(cron = "0 0/5 * * * ?")
@Async("async") @Async("async")
public void healthWarningHourGF() { public void healthWarningHourGF() {
if (!openHealth) { if (!openHealth) {
...@@ -1093,10 +1092,10 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1093,10 +1092,10 @@ public class HealthStatusIndicatorServiceImpl {
/*** /***
* 每三天取一次最大粒度内的指数异常数据 * 每三天取一次最大粒度内的指数异常数据
* 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成 * 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
* * TdengineTimeServiceImpl计算完调用
*/ */
@Scheduled(cron = "0 0 0 0/1 * ? ") //@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async") @Async("async")
public void healthWarningDayGF() { public void healthWarningDayGF() {
if (!openHealth) { if (!openHealth) {
...@@ -1475,7 +1474,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1475,7 +1474,6 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?") // @Scheduled(cron = "0 0 */1 * * ?")
@Async("async") @Async("async")
//@PostConstruct
public void healthWarningMinute(Date time) { public void healthWarningMinute(Date time) {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -1483,9 +1481,8 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1483,9 +1481,8 @@ public class HealthStatusIndicatorServiceImpl {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date time=null; // Date time=null;
// try { // try {
// time = simpleDateFormat.parse("2024-03-14 13:50:00"); // time = simpleDateFormat.parse("2024-06-04 17:00:00");
// } catch (ParseException e1) { // } catch (ParseException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace(); // e1.printStackTrace();
// } // }
// Calendar calendar = Calendar.getInstance(); // Calendar calendar = Calendar.getInstance();
...@@ -1887,16 +1884,25 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1887,16 +1884,25 @@ public class HealthStatusIndicatorServiceImpl {
/*** /***
* 每五小时获取一次最大粒度内的指数异常数据 * 每五小时获取一次最大粒度内的指数异常数据
* 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成 * 判断五小时内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
* * TdengineTimeServiceImpl计算完调用
*/ */
@Scheduled(cron = "0 0 0/1 * * ?") //@Scheduled(cron = "0 0 0/1 * * ?")
@Async("async") @Async("async")
// @PostConstruct
public void healthWarningHour() { public void healthWarningHour() {
if (!openHealth) { // if (!openHealth) {
return; // return;
} // }
Date time = new Date(); Date time = new Date();
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date time=null;
// try {
// time = simpleDateFormat.parse("2024-06-04 17:00:00");
// } catch (ParseException e1) {
// e1.printStackTrace();
// }
String format = DateUtil.format(time, "yyyy-MM-dd HH:00:00"); String format = DateUtil.format(time, "yyyy-MM-dd HH:00:00");
// Date date = DateUtils.dateAddHours(time, -13); // Date date = DateUtils.dateAddHours(time, -13);
// Calendar calendar = Calendar.getInstance(); // Calendar calendar = Calendar.getInstance();
...@@ -1937,6 +1943,12 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1937,6 +1943,12 @@ public class HealthStatusIndicatorServiceImpl {
Map<String, List<FanHealthIndexHour>> healthDataMaps = gateWayMaps.get(gateWayId); Map<String, List<FanHealthIndexHour>> healthDataMaps = gateWayMaps.get(gateWayId);
for (String address : healthDataMaps.keySet()) { for (String address : healthDataMaps.keySet()) {
//桨叶目标位置B
// if(!"22046".equals(address))
// {
// continue;
// }
List<FanHealthIndexHour> idxBizFanHealthIndices = healthDataMaps.get(address); List<FanHealthIndexHour> idxBizFanHealthIndices = healthDataMaps.get(address);
List<IdxBizFanWarningRuleSet> idxBizPvWarningRuleSets = idxBizPvWarningRules.stream().filter(t -> t.getAnalysisPointId().equals(idxBizFanHealthIndices.get(0).getAnalysisObjSeq())).collect(Collectors.toList()); List<IdxBizFanWarningRuleSet> idxBizPvWarningRuleSets = idxBizPvWarningRules.stream().filter(t -> t.getAnalysisPointId().equals(idxBizFanHealthIndices.get(0).getAnalysisObjSeq())).collect(Collectors.toList());
...@@ -2070,9 +2082,10 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2070,9 +2082,10 @@ public class HealthStatusIndicatorServiceImpl {
// tdengine插入 // tdengine插入
fanWaringRecordMapper.saveBatchWarningRecords(tdFanWarningRecordList); fanWaringRecordMapper.saveBatchWarningRecords(tdFanWarningRecordList);
// 触发风险模型生成预警处置模块的预警记录
fetchDataFan(tdFanWarningRecordList, stationMap);
} }
// 触发风险模型生成预警处置模块的预警记录
fetchDataFan(tdFanWarningRecordList, stationMap);
} }
// @Scheduled(cron = "0 0 0/1 * * ?") // @Scheduled(cron = "0 0 0/1 * * ?")
...@@ -2270,10 +2283,10 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2270,10 +2283,10 @@ public class HealthStatusIndicatorServiceImpl {
/*** /***
* 每三天取一次最大粒度内的指数异常数据 * 每三天取一次最大粒度内的指数异常数据
* 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成 * 判断三天内数据是否符合预警规则 符合则报警并在redis中缓存 同一级别的预警记录下次不生成
* * TdengineTimeServiceImpl计算完调用
*/ */
@Scheduled(cron = "0 0 0 0/1 * ? ") //@Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async") @Async("async")
public void healthWarningDay() { public void healthWarningDay() {
if (!openHealth) { if (!openHealth) {
......
...@@ -50,6 +50,9 @@ public class TdengineTimeServiceImpl { ...@@ -50,6 +50,9 @@ public class TdengineTimeServiceImpl {
@Value("${openHealth:true}") @Value("${openHealth:true}")
Boolean openHealth; Boolean openHealth;
@Autowired
private HealthStatusIndicatorServiceImpl healthStatusIndicatorServiceImpl;
/** /**
* 风电 - 按时刻生成子系统、设备、场站、区域 数据 * 风电 - 按时刻生成子系统、设备、场站、区域 数据
...@@ -118,6 +121,9 @@ public class TdengineTimeServiceImpl { ...@@ -118,6 +121,9 @@ public class TdengineTimeServiceImpl {
List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4")); List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQg = fanHealthIndexMapper.getInfoListByGroupByQgFan(startTime, "fan_health_index_moment", "片区"); List<FanHealthIndex> fanHealthIndicesQg = fanHealthIndexMapper.getInfoListByGroupByQgFan(startTime, "fan_health_index_moment", "片区");
saveBatchFan(fanHealthIndicesQg, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQg); saveBatchFan(fanHealthIndicesQg, "fan_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQg);
//预警生成
healthStatusIndicatorServiceImpl.healthWarningHour();
} }
/** /**
...@@ -157,6 +163,9 @@ public class TdengineTimeServiceImpl { ...@@ -157,6 +163,9 @@ public class TdengineTimeServiceImpl {
List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4")); List<IdxBizFanHealthLevel> levelListQg = idxBizFanHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizFanHealthLevel>().eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<FanHealthIndex> fanHealthIndicesQg = fanHealthIndexMapper.getInfoListByGroupByQgFan(startTime, "fan_health_index_hour", "片区"); List<FanHealthIndex> fanHealthIndicesQg = fanHealthIndexMapper.getInfoListByGroupByQgFan(startTime, "fan_health_index_hour", "片区");
saveBatchFan(fanHealthIndicesQg, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg); saveBatchFan(fanHealthIndicesQg, "fan_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg);
//预警生成
healthStatusIndicatorServiceImpl.healthWarningDay();
} }
...@@ -224,6 +233,8 @@ public class TdengineTimeServiceImpl { ...@@ -224,6 +233,8 @@ public class TdengineTimeServiceImpl {
List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4")); List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_moment", "片区"); List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_moment", "片区");
saveBatchPv(fanHealthIndicesQg, "pv_health_index_moment", recDate, WarningPeriodEnum.MINUTES.getName(), levelListQg); saveBatchPv(fanHealthIndicesQg, "pv_health_index_moment", recDate, WarningPeriodEnum.MINUTES.getName(), levelListQg);
} }
/** /**
...@@ -262,6 +273,9 @@ public class TdengineTimeServiceImpl { ...@@ -262,6 +273,9 @@ public class TdengineTimeServiceImpl {
List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4")); List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_moment", "片区"); List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_moment", "片区");
saveBatchPv(fanHealthIndicesQg, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQg); saveBatchPv(fanHealthIndicesQg, "pv_health_index_hour", recDate, WarningPeriodEnum.HOUR.getName(), levelListQg);
//预警生成
healthStatusIndicatorServiceImpl.healthWarningHourGF();
} }
/** /**
...@@ -300,6 +314,9 @@ public class TdengineTimeServiceImpl { ...@@ -300,6 +314,9 @@ public class TdengineTimeServiceImpl {
List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4")); List<IdxBizPvHealthLevel> levelListQg = idxBizPvHealthLevelMapper.selectList(new LambdaQueryWrapper<IdxBizPvHealthLevel>().eq(IdxBizPvHealthLevel::getAnalysisObjType, "全域").last("limit 4"));
List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_hour", "片区"); List<PvHealthIndex> fanHealthIndicesQg = pvHealthIndexMapper.getInfoListByGroupByQgPv(startTime, "pv_health_index_hour", "片区");
saveBatchPv(fanHealthIndicesQg, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg); saveBatchPv(fanHealthIndicesQg, "pv_health_index_day", recDate, WarningPeriodEnum.DAY.getName(), levelListQg);
//预警生成
healthStatusIndicatorServiceImpl.healthWarningDayGF();
} }
......
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
and concat(#{endDate}, ' 23:59:59') >= a.recdate and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if> </if>
</where> </where>
order by sort desc, recDate desc order by recDate desc
limit #{current}, #{size} limit #{current}, #{size}
</select> </select>
......
...@@ -216,6 +216,7 @@ ...@@ -216,6 +216,7 @@
ifnull(a.qrcode_color, '') AS qrCodeColor, ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(c.station_name, '') AS stationName, ifnull(c.station_name, '') AS stationName,
ifnull(a.rec_date, '') as recDate, ifnull(a.rec_date, '') as recDate,
ifnull(a.qrcode_date, '') as qrcodeDate,
a.sequence_nbr as objectId, a.sequence_nbr as objectId,
b.project_name as unitName, b.project_name as unitName,
case when a.qrcode_color = 'red' then 1 case when a.qrcode_color = 'red' then 1
......
...@@ -133,6 +133,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -133,6 +133,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
item.put("name", name); item.put("name", name);
item.put("faultInfo", "证书不全或临期"); item.put("faultInfo", "证书不全或临期");
item.put("faultLevel", "严重"); item.put("faultLevel", "严重");
if (item.get("recDate").equals("")){
item.put("recDate", item.get("qrcodeDate"));
}
if (!Objects.isNull(score) && count != 0) { if (!Objects.isNull(score) && count != 0) {
BigDecimal divide = new BigDecimal(100).subtract(score).divide(BigDecimal.valueOf(count), 10, 2); BigDecimal divide = new BigDecimal(100).subtract(score).divide(BigDecimal.valueOf(count), 10, 2);
BigDecimal bigDecimal = divide.setScale(getNonZeroDecimalPlaces(divide), RoundingMode.HALF_UP); BigDecimal bigDecimal = divide.setScale(getNonZeroDecimalPlaces(divide), RoundingMode.HALF_UP);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment