Commit d8349475 authored by zhangsen's avatar zhangsen

预警存入 td相关

parent 7c0f50b3
......@@ -30,9 +30,13 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_TIME_PATTERN;
@EnableScheduling
@Service
@Slf4j
......@@ -318,10 +322,10 @@ public class HealthStatusIndicatorServiceImpl {
return;
}
Date time = new Date();
Date date = DateUtils.dateAddHours(time, -8);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = DateUtils.dateAddHours(time, -13);
// Calendar calendar = Calendar.getInstance();
// calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
......@@ -480,11 +484,12 @@ public class HealthStatusIndicatorServiceImpl {
if (!openHealth){
return;
}
Calendar calendar = Calendar.getInstance();
// Calendar calendar = Calendar.getInstance();
Date time = new Date();
Date date = DateUtils.dateAddHours(time, -8);
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
//三天 + 8小时
Date date = DateUtils.dateAddHours(time, -80);
// calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
LambdaQueryWrapper<PvHealthIndexDay> wrapper = new LambdaQueryWrapper<>();
......@@ -815,10 +820,10 @@ public class HealthStatusIndicatorServiceImpl {
}
Date time = new Date();
String format = DateUtil.format(time, "yyyy-MM-dd HH:00:00");
Date date = DateUtils.dateAddHours(time, -8);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = DateUtils.dateAddHours(time, -13);
// Calendar calendar = Calendar.getInstance();
// calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
LambdaQueryWrapper<FanHealthIndexHour> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FanHealthIndexHour::getAnalysisObjType, "测点");
......@@ -976,10 +981,11 @@ public class HealthStatusIndicatorServiceImpl {
}
Date time = new Date();
String format = DateUtil.format(time, "yyyy-MM-dd 00:00:00");
Date date = DateUtils.dateAddHours(time, -8);
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
//三天 + 8小时
Date date = DateUtils.dateAddHours(time, -80);
// Calendar calendar = Calendar.getInstance();
// calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
LambdaQueryWrapper<FanHealthIndexDay> wrapper = new LambdaQueryWrapper<>();
wrapper.ne(FanHealthIndexDay::getHealthLevel,"安全");
......
......@@ -12,7 +12,7 @@ public class PvWarningRecord implements Serializable {
private Long ts;
private String recDate;
private String disposotionState;
private String healthIndexSeq;
private String healthIndex;
private String analysisPointId;
private String warningName;
private String arae;
......
......@@ -6,34 +6,33 @@
insert
into
pv_warning_record
(ts,
rec_date,
disposotion_state,
health_index_seq,
health_index,
analysis_point_id,
warning_name,
arae,
station,
subarray,
manufacturer,
device_type,
equipment_name,
gateway_id,
index_address,
content,
point_name,
health_level,
disposotion_date,
kks,
warning_period,
status)
<!-- (ts,-->
<!-- rec_date,-->
<!-- disposotion_state,-->
<!-- health_index_seq,-->
<!-- health_index,-->
<!-- analysis_point_id,-->
<!-- warning_name,-->
<!-- arae,-->
<!-- station,-->
<!-- subarray,-->
<!-- manufacturer,-->
<!-- device_type,-->
<!-- equipment_name,-->
<!-- gateway_id,-->
<!-- index_address,-->
<!-- content,-->
<!-- point_name,-->
<!-- health_level,-->
<!-- disposotion_date,-->
<!-- kks,-->
<!-- warning_period,-->
<!-- status)-->
values
<foreach collection="list" separator="," item="item" index="index">
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
#{item.healthIndexSeq, jdbcType=VARCHAR},
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
......
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