|
@@ -17,7 +17,7 @@ import com.persagy.ems.pojo.wz.DayStaticMoreRecord;
|
|
|
import com.persagy.ems.pojo.wz.DayStaticRecord;
|
|
|
import com.persagy.ems.pojo.wz.HourRecordData;
|
|
|
import com.persagy.framework.util.DateUtils;
|
|
|
-import com.persagy.functions.weather.constant.ConstStaticType;
|
|
|
+import com.persagy.functions.weather.constant.ConstStatisticType;
|
|
|
import com.persagy.functions.weather.dto.NumAvgDTO;
|
|
|
import com.persagy.functions.weather.service.DayStaticService;
|
|
|
import com.persagy.functions.weather.service.HourRecordService;
|
|
@@ -174,12 +174,12 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
|
|
|
@Override
|
|
|
public boolean staticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist) throws Exception {
|
|
|
- return staticHourToDay(cityId, dayTime, sourcelist, ConstStaticType.All);
|
|
|
+ return staticHourToDay(cityId, dayTime, sourcelist, ConstStatisticType.All);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public boolean restaticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist) throws Exception {
|
|
|
- return restaticHourToDay(cityId, dayTime, sourcelist, ConstStaticType.All);
|
|
|
+ return restaticHourToDay(cityId, dayTime, sourcelist, ConstStatisticType.All);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -246,16 +246,16 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean staticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist, ConstStaticType type)
|
|
|
+ public boolean staticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist, ConstStatisticType type)
|
|
|
throws Exception {
|
|
|
if ((sourcelist == null) || (sourcelist.isEmpty())) {
|
|
|
log.error("day static error." + DateUtils.date2Str(dayTime, "yyyy-MM-dd") + " cityId=" + cityId
|
|
|
+ ", no hour records.");
|
|
|
} else {
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Max == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Max == type) {
|
|
|
save(getMaxStaticObjFromHourData(cityId, dayTime, sourcelist));
|
|
|
}
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Avg == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Avg == type) {
|
|
|
save(getAvgStaticObjFromHourData(cityId, dayTime, sourcelist));
|
|
|
}
|
|
|
|
|
@@ -266,11 +266,11 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
|
|
|
@Override
|
|
|
public boolean staticHourToDay(String cityId, Map<Date, List<HourRecordData>> sourceData,
|
|
|
- ConstStaticType type) throws Exception {
|
|
|
+ ConstStatisticType type) throws Exception {
|
|
|
if ((sourceData == null) || (sourceData.isEmpty())) {
|
|
|
log.error("day static error. no hour records.");
|
|
|
}else {
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Max == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Max == type) {
|
|
|
List<DayStaticRecord> saveList = new ArrayList<>();
|
|
|
for(Date dayTime : sourceData.keySet()) {
|
|
|
saveList.add(getMaxStaticObjFromHourData(cityId, dayTime, sourceData.get(dayTime)));
|
|
@@ -279,7 +279,7 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
save(saveList);
|
|
|
}
|
|
|
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Avg == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Avg == type) {
|
|
|
List<DayStaticMoreRecord> saveList = new ArrayList<>();
|
|
|
for(Date dayTime : sourceData.keySet()) {
|
|
|
saveList.add(getAvgStaticObjFromHourData(cityId, dayTime, sourceData.get(dayTime)));
|
|
@@ -293,13 +293,13 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean restaticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist, ConstStaticType type)
|
|
|
+ public boolean restaticHourToDay(String cityId, Date dayTime, List<HourRecordData> sourcelist, ConstStatisticType type)
|
|
|
throws Exception {
|
|
|
if ((sourcelist == null) || (sourcelist.isEmpty())) {
|
|
|
log.error("day static error." + DateUtils.date2Str(dayTime, "yyyy-MM-dd") + " cityId=" + cityId
|
|
|
+ ", no hour records.");
|
|
|
} else {
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Max == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Max == type) {
|
|
|
DayStaticRecord queryObj = new DayStaticRecord();
|
|
|
queryObj.setCityId(cityId);
|
|
|
queryObj.setDayTime(dayTime);
|
|
@@ -307,7 +307,7 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
coreService.remove(queryObj);
|
|
|
save(getMaxStaticObjFromHourData(cityId, dayTime, sourcelist));
|
|
|
}
|
|
|
- if(ConstStaticType.All == type || ConstStaticType.Avg == type) {
|
|
|
+ if(ConstStatisticType.All == type || ConstStatisticType.Avg == type) {
|
|
|
DayStaticMoreRecord moreObj = new DayStaticMoreRecord();
|
|
|
moreObj.setCityId(cityId);
|
|
|
moreObj.setDayTime(dayTime);
|
|
@@ -322,7 +322,7 @@ public class DayStaticServiceImpl implements DayStaticService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean restaticHourToDay(String cityId, Map<Date, List<HourRecordData>> sourceData, ConstStaticType type)
|
|
|
+ public boolean restaticHourToDay(String cityId, Map<Date, List<HourRecordData>> sourceData, ConstStatisticType type)
|
|
|
throws Exception {
|
|
|
if ((sourceData == null) || (sourceData.isEmpty())) {
|
|
|
log.error("day static error. no hour records.");
|