Commit 314aa26f authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz into developer

parents 9446c562 b0e3fedb
...@@ -20,7 +20,7 @@ public class DateUtils { ...@@ -20,7 +20,7 @@ public class DateUtils {
public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm"; public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm";
public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String HOUR_PATTERN = "yyyy-MM-dd HH";
public static final String DATE_PATTERN = "yyyy-MM-dd"; public static final String DATE_PATTERN = "yyyy-MM-dd";
public static final String MONTH_PATTERN = "yyyy-MM"; public static final String MONTH_PATTERN = "yyyy-MM";
public static final String YEAR_PATTERN = "yyyy"; public static final String YEAR_PATTERN = "yyyy";
......
...@@ -798,7 +798,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -798,7 +798,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
Date startDate = DateUtils.dateParse(startTimeTop); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getRecDate)).collect(Collectors.toList());
for (FanHealthIndexDay obj : fanHealthIndexDays) { for (FanHealthIndexDay obj : fanHealthIndexDays) {
if (type.equals("0")){ if (type.equals("0")){
...@@ -814,13 +814,13 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -814,13 +814,13 @@ public class IdxBizFanHealthIndexController extends BaseController {
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){ }else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){ if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getRecDate)).collect(Collectors.toList());
for (FanHealthIndexHour obj : fanHealthIndexHours) { for (FanHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
...@@ -837,14 +837,14 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -837,14 +837,14 @@ public class IdxBizFanHealthIndexController extends BaseController {
}else { }else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){ if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getRecDate)).collect(Collectors.toList());
for (FanHealthIndexMoment obj : fanHealthIndexMoments) { for (FanHealthIndexMoment obj : fanHealthIndexMoments) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
......
...@@ -475,7 +475,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -475,7 +475,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectTrendData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, null, null, orgCode); List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectTrendData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, null, null, orgCode);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getRecDate)).collect(Collectors.toList());
for (PvHealthIndexDay obj : fanHealthIndexDays) { for (PvHealthIndexDay obj : fanHealthIndexDays) {
if (type.equals("0")){ if (type.equals("0")){
...@@ -491,13 +491,13 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -491,13 +491,13 @@ public class IdxBizPvHealthIndexController extends BaseController {
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){ }else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){ if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getRecDate)).collect(Collectors.toList());
for (PvHealthIndexHour obj : fanHealthIndexHours) { for (PvHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
...@@ -517,10 +517,10 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -517,10 +517,10 @@ public class IdxBizPvHealthIndexController extends BaseController {
SimpleDateFormat formatterNYRSF = new SimpleDateFormat("yyyy-MM-dd HH:mm"); SimpleDateFormat formatterNYRSF = new SimpleDateFormat("yyyy-MM-dd HH:mm");
if ( null != endTimeTop){ if ( null != endTimeTop){
Date endDate = DateUtils.dateAddHours(DateUtils.dateParse(endTimeTop), -8); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
Date startDate = DateUtils.dateAddHours(DateUtils.dateParse(startTimeTop), -8); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode);
......
...@@ -104,13 +104,13 @@ public class TdInfoQueryController extends BaseController { ...@@ -104,13 +104,13 @@ public class TdInfoQueryController extends BaseController {
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
String startDate = dto.getStartDate(); String startDate = dto.getStartDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate); startDate = startDate + " 00:00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate); startDate = startDate + ":00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate); startDate = startDate + ":00";
} }
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN); Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
...@@ -121,13 +121,13 @@ public class TdInfoQueryController extends BaseController { ...@@ -121,13 +121,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate(); String endDate = dto.getEndDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate); endDate = endDate + " 00:00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate); endDate = endDate + ":00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate); endDate = endDate + ":00";
} }
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN); Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
...@@ -204,13 +204,13 @@ public class TdInfoQueryController extends BaseController { ...@@ -204,13 +204,13 @@ public class TdInfoQueryController extends BaseController {
String startDate = dto.getStartDate(); String startDate = dto.getStartDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && startDate.length() == 10) {
startDate = startDate + " " + hhmmss.format(currentDate); startDate = startDate + " 00:00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":" + mmss.format(currentDate); startDate = startDate + ":00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":" + ss.format(currentDate); startDate = startDate + ":00";
} }
...@@ -222,13 +222,13 @@ public class TdInfoQueryController extends BaseController { ...@@ -222,13 +222,13 @@ public class TdInfoQueryController extends BaseController {
String endDate = dto.getEndDate(); String endDate = dto.getEndDate();
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按天") && endDate.length() == 10) {
endDate = endDate + " " + hhmmss.format(currentDate); endDate = endDate + " 00:00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":" + mmss.format(currentDate); endDate = endDate + ":00:00";
} }
if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) { if(dto.getAnalysisType() != null && dto.getAnalysisType().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":" + ss.format(currentDate); endDate = endDate + ":00";
} }
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN); Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
...@@ -282,14 +282,40 @@ public class TdInfoQueryController extends BaseController { ...@@ -282,14 +282,40 @@ public class TdInfoQueryController extends BaseController {
orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%"; orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
Date currentDate = new Date();
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
String startDate = dto.getStartDate(); String startDate = dto.getStartDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && startDate.length() == 10) {
startDate = startDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":00";
}
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN); Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN); String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN);
dto.setStartDate(startDateString); dto.setStartDate(startDateString);
} }
if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) { if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) {
String endDate = dto.getEndDate(); String endDate = dto.getEndDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && endDate.length() == 10) {
endDate = endDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":00";
}
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN); Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN); String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN);
dto.setEndDate(endDateString); dto.setEndDate(endDateString);
...@@ -340,14 +366,38 @@ public class TdInfoQueryController extends BaseController { ...@@ -340,14 +366,38 @@ public class TdInfoQueryController extends BaseController {
orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%"; orgCode = stdUserEmpower.getAmosOrgCode().get(0)+"%";
} }
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
Date currentDate = new Date();
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) { if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
String startDate = dto.getStartDate(); String startDate = dto.getStartDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && startDate.length() == 10) {
startDate = startDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && startDate.length() == 13) {
startDate = startDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && startDate.length() == 16) {
startDate = startDate + ":00";
}
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN); Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN); String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN);
dto.setStartDate(startDateString); dto.setStartDate(startDateString);
} }
if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) { if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) {
String endDate = dto.getEndDate(); String endDate = dto.getEndDate();
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按天") && endDate.length() == 10) {
endDate = endDate + " 00:00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按小时") && endDate.length() == 13) {
endDate = endDate + ":00:00";
}
if(dto.getWarningPeriod() != null && dto.getWarningPeriod().equals("按10分钟") && endDate.length() == 16) {
endDate = endDate + ":00";
}
Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN); Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN); String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN);
dto.setEndDate(endDateString); dto.setEndDate(endDateString);
......
...@@ -9,6 +9,7 @@ import java.util.Map; ...@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -47,6 +48,8 @@ public class TestController extends BaseController { ...@@ -47,6 +48,8 @@ public class TestController extends BaseController {
IndicatorDataMapper indicatorDataMapper; IndicatorDataMapper indicatorDataMapper;
@Autowired @Autowired
CommonServiceImpl commonService; CommonServiceImpl commonService;
@Autowired
HealthStatusIndicatorServiceImpl healthStatusIndicatorService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test1", notes = "test1") @ApiOperation(httpMethod = "GET", value = "test1", notes = "test1")
...@@ -162,29 +165,13 @@ public class TestController extends BaseController { ...@@ -162,29 +165,13 @@ public class TestController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test2", notes = "test1") @ApiOperation(httpMethod = "GET", value = "test2", notes = "test1")
@GetMapping("/set-date") @GetMapping("/test123")
public void clearRecord() { public void clearRecord() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date time = new Date();
String d = sdf.format(new Date()); time = DateUtil.offsetMinute(time, -DateUtil.minute(time) % 10);
LambdaQueryWrapper<FanWarningRecord> wf = new LambdaQueryWrapper<>(); String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
wf.isNull(FanWarningRecord::getDisposotionDate); time = DateUtil.parse(format, "yyyy-MM-dd HH:mm:00");
List<FanWarningRecord> list = fanWaringRecordMapper.selectList(wf); healthStatusIndicatorService.healthWarningMinuteGF(time);
if (!list.isEmpty()) {
list.forEach(i -> {
i.setDisposotionDate(d);
});
fanWaringRecordMapper.saveBatchWarningRecords(list);
}
LambdaQueryWrapper<PvWarningRecord> pf = new LambdaQueryWrapper<>();
pf.isNull(PvWarningRecord::getDisposotionDate);
List<PvWarningRecord> list1 = pvWaringRecordMapper.selectList(pf);
if (!list1.isEmpty()) {
list1.forEach(i -> {
i.setDisposotionDate(d);
});
pvWaringRecordMapper.saveBatchWarningRecords(list1);
}
} }
@TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false) @TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
......
...@@ -2430,7 +2430,6 @@ public class CommonServiceImpl { ...@@ -2430,7 +2430,6 @@ public class CommonServiceImpl {
* *
* @param fanHealthIndices * @param fanHealthIndices
*/ */
@Async
public void insertFanDataTDEngine(ArrayList<FanHealthIndex> fanHealthIndices, String recDate, String analysisType) { public void insertFanDataTDEngine(ArrayList<FanHealthIndex> fanHealthIndices, String recDate, String analysisType) {
idxFanHealthIndexMapper.deleteAllDataByTableName("fan_health_index_latest_data", analysisType); idxFanHealthIndexMapper.deleteAllDataByTableName("fan_health_index_latest_data", analysisType);
// 按时刻 - 测点插入 // 按时刻 - 测点插入
...@@ -2694,7 +2693,7 @@ public class CommonServiceImpl { ...@@ -2694,7 +2693,7 @@ public class CommonServiceImpl {
BeanUtil.copyProperties(idxBizPvHealthIndex, pvHealthIndex); BeanUtil.copyProperties(idxBizPvHealthIndex, pvHealthIndex);
pvHealthIndex.setWeight(idxBizPvHealthIndex.getWeigth()); pvHealthIndex.setWeight(idxBizPvHealthIndex.getWeigth());
pvHealthIndex.setAnomaly(idxBizPvHealthIndex.getANOMALY()); pvHealthIndex.setAnomaly(idxBizPvHealthIndex.getANOMALY());
pvHealthIndex.setRecDate(DateUtil.now()); pvHealthIndex.setRecDate(format);
pvHealthIndex.setArea(idxBizPvHealthIndex.getArae()); pvHealthIndex.setArea(idxBizPvHealthIndex.getArae());
pvHealthIndex.setAnalysisTime(format); pvHealthIndex.setAnalysisTime(format);
pvHealthIndex.setHealthLevel(idxBizPvHealthIndex.getHealthLevel()); pvHealthIndex.setHealthLevel(idxBizPvHealthIndex.getHealthLevel());
...@@ -2988,7 +2987,6 @@ public class CommonServiceImpl { ...@@ -2988,7 +2987,6 @@ public class CommonServiceImpl {
* *
* @param pvHealthIndices * @param pvHealthIndices
*/ */
@Async
public void insertPvDataTDEngine(ArrayList<PvHealthIndex> pvHealthIndices, String recDate, String analysisType) { public void insertPvDataTDEngine(ArrayList<PvHealthIndex> pvHealthIndices, String recDate, String analysisType) {
idxFanHealthIndexMapper.deleteAllDataByTableName("pv_health_index_latest_data", analysisType); idxFanHealthIndexMapper.deleteAllDataByTableName("pv_health_index_latest_data", analysisType);
......
...@@ -167,11 +167,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -167,11 +167,7 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
// @Scheduled(cron = "0 0 */1 * * ?") // @Scheduled(cron = "0 0 */1 * * ?")
@Async("async")
public void healthWarningMinuteGF(Date time) { public void healthWarningMinuteGF(Date time) {
if (!openHealth) {
return;
}
String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00"); String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
// Date date = DateUtils.dateAddHours(time, -8); // Date date = DateUtils.dateAddHours(time, -8);
log.info("光伏---------------------预警时间----" + time); log.info("光伏---------------------预警时间----" + time);
...@@ -548,7 +544,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -548,7 +544,6 @@ public class HealthStatusIndicatorServiceImpl {
// //
// } // }
@Async("async")
public void healthWarningMinuteGF(Date time, String gatewayId) { public void healthWarningMinuteGF(Date time, String gatewayId) {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -756,7 +751,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -756,7 +751,6 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
// @Scheduled(cron = "0 0 0/1 * * ?") // @Scheduled(cron = "0 0 0/1 * * ?")
@Async("async")
public void healthWarningHourGF() { public void healthWarningHourGF() {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -962,7 +956,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -962,7 +956,6 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 0/1 * * ?") // @Scheduled(cron = "0 0 0/1 * * ?")
// @Scheduled(cron = "0 0/5 * * * ?") // @Scheduled(cron = "0 0/5 * * * ?")
@Async("async")
public void healthWarningHourGFNew() { public void healthWarningHourGFNew() {
if (!openHealth) { if (!openHealth) {
...@@ -1184,7 +1177,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1184,7 +1177,6 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
// @Scheduled(cron = "0 0 0 0/1 * ? ") // @Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDayGF() { public void healthWarningDayGF() {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -1393,7 +1385,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1393,7 +1385,6 @@ public class HealthStatusIndicatorServiceImpl {
} }
// @Scheduled(cron = "0 0 0 0/1 * ? ") // @Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDayGFNew() { public void healthWarningDayGFNew() {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -1614,7 +1605,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1614,7 +1605,6 @@ public class HealthStatusIndicatorServiceImpl {
} }
// @Scheduled(cron = "0 0 */1 * * ?") // @Scheduled(cron = "0 0 */1 * * ?")
@Async("async")
public void healthWarningMinute(Date time) { public void healthWarningMinute(Date time) {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -1839,7 +1829,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1839,7 +1829,6 @@ public class HealthStatusIndicatorServiceImpl {
fetchDataFan(tdFanWarningRecordList, stationMap); fetchDataFan(tdFanWarningRecordList, stationMap);
} }
@Async("async")
// @PostConstruct // @PostConstruct
public void healthWarningMinute(Date time, String gatewayId) { public void healthWarningMinute(Date time, String gatewayId) {
if (!openHealth) { if (!openHealth) {
...@@ -2072,7 +2061,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2072,7 +2061,6 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
// @Scheduled(cron = "0 0 0/1 * * ?") // @Scheduled(cron = "0 0 0/1 * * ?")
@Async("async")
// @PostConstruct // @PostConstruct
public void healthWarningHour() { public void healthWarningHour() {
// if (!openHealth) { // if (!openHealth) {
...@@ -2297,7 +2285,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2297,7 +2285,6 @@ public class HealthStatusIndicatorServiceImpl {
} }
// @Scheduled(cron = "0 0 0/1 * * ?") // @Scheduled(cron = "0 0 0/1 * * ?")
@Async("async")
public void healthWarningHourNew() { public void healthWarningHourNew() {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -2520,7 +2507,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2520,7 +2507,6 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
// @Scheduled(cron = "0 0 0 0/1 * ? ") // @Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDay() { public void healthWarningDay() {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -2737,7 +2723,6 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2737,7 +2723,6 @@ public class HealthStatusIndicatorServiceImpl {
} }
// @Scheduled(cron = "0 0 0 0/1 * ? ") // @Scheduled(cron = "0 0 0 0/1 * ? ")
@Async("async")
public void healthWarningDayNew() { public void healthWarningDayNew() {
if (!openHealth) { if (!openHealth) {
return; return;
......
...@@ -66,6 +66,9 @@ public class EarningsForecastImpl { ...@@ -66,6 +66,9 @@ public class EarningsForecastImpl {
}); });
TreeMap<String, Double> map = commonService.getListDataByCondtionsSum(queryCondtion1,objects, ESMoonPowerGeneration.class,null); TreeMap<String, Double> map = commonService.getListDataByCondtionsSum(queryCondtion1,objects, ESMoonPowerGeneration.class,null);
if (null == map || map.isEmpty() ){
return null;
}
TreeMap<String, String> carbonDioxide = new TreeMap<>(); TreeMap<String, String> carbonDioxide = new TreeMap<>();
TreeMap<String, String> standardCoal = new TreeMap<>(); TreeMap<String, String> standardCoal = new TreeMap<>();
TreeMap<String, String> toner = new TreeMap<>(); TreeMap<String, String> toner = new TreeMap<>();
...@@ -162,6 +165,9 @@ public class EarningsForecastImpl { ...@@ -162,6 +165,9 @@ public class EarningsForecastImpl {
}); });
TreeMap<String, Double> map = commonService.getListDataByCondtionsSum(queryCondtion1,objects, ESMoonPowerGeneration.class,null); TreeMap<String, Double> map = commonService.getListDataByCondtionsSum(queryCondtion1,objects, ESMoonPowerGeneration.class,null);
if (null == map || map.isEmpty() ){
return null;
}
TreeMap<String, String> carbonDioxide = new TreeMap<>(); TreeMap<String, String> carbonDioxide = new TreeMap<>();
TreeMap<String, String> standardCoal = new TreeMap<>(); TreeMap<String, String> standardCoal = new TreeMap<>();
TreeMap<String, String> toner = new TreeMap<>(); TreeMap<String, String> toner = new TreeMap<>();
......
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