|
|
|
@ -94,13 +94,32 @@ public class StationScreenServiceImpl implements StationScreenService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public StationMonthChargeAnalysis getMonthChargeAnalysis(String thingCode) { |
|
|
|
public StationMonthChargeAnalysis getMonthChargeAnalysis(String thingCode, String dateType) { |
|
|
|
Long startTs = DateTimeUtils.monthStartTs(); |
|
|
|
Long endTs = DateTimeUtils.monthStartTs(); |
|
|
|
List<String> code; |
|
|
|
if (StringUtils.equals(dateType, "yy")) { |
|
|
|
startTs = DateTimeUtils.yearStartTs(); |
|
|
|
endTs = DateTimeUtils.yearEndTs(); |
|
|
|
code = List.of("A29mm", "A202mm", "A201mm"); |
|
|
|
} else if (StringUtils.equals(dateType, "mm")) { |
|
|
|
startTs = DateTimeUtils.monthStartTs(); |
|
|
|
endTs = DateTimeUtils.monthEndTs(); |
|
|
|
code = List.of("A29dd", "A202dd", "A201dd"); |
|
|
|
} else { |
|
|
|
startTs = DateTimeUtils.todayStartTs(); |
|
|
|
endTs = DateTimeUtils.yearEndTs(); |
|
|
|
code = List.of("A29hh", "A202hh", "A201hh"); |
|
|
|
} |
|
|
|
List<TsKvDTO> tskvList = |
|
|
|
tsKvService.findTsKvByCodeAndAttrs( |
|
|
|
thingCode, |
|
|
|
StationMonthChargeAnalysis.DAILY_ATTR_CODES, |
|
|
|
/* StationMonthChargeAnalysis.DAILY_ATTR_CODES, |
|
|
|
DateTimeUtils.monthStartTs(), |
|
|
|
System.currentTimeMillis(), |
|
|
|
System.currentTimeMillis(),*/ |
|
|
|
code, |
|
|
|
startTs, |
|
|
|
endTs, |
|
|
|
true); |
|
|
|
return StationMonthChargeAnalysis.assemble(tskvList); |
|
|
|
} |
|
|
|
@ -121,31 +140,15 @@ public class StationScreenServiceImpl implements StationScreenService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public StationMonthUsageAnalysis getMonthUsageAnalysis(String thingCode,String dateType) { |
|
|
|
public StationMonthUsageAnalysis getMonthUsageAnalysis(String thingCode) { |
|
|
|
Integer gunCount = |
|
|
|
connectorInfoService.getCountByStationIds(Collections.singletonList(thingCode)); |
|
|
|
String code = "A201mm"; |
|
|
|
Long startTs = DateTimeUtils.monthStartTs(); |
|
|
|
Long endTs = DateTimeUtils.monthStartTs(); |
|
|
|
if(StringUtils.equals(dateType,"yy")){ |
|
|
|
startTs = DateTimeUtils.yearStartTs(); |
|
|
|
endTs = DateTimeUtils.yearEndTs(); |
|
|
|
} else if (StringUtils.equals(dateType,"mm")) { |
|
|
|
startTs = DateTimeUtils.monthStartTs(); |
|
|
|
endTs = DateTimeUtils.monthEndTs(); |
|
|
|
code= "A201dd"; |
|
|
|
}else{ |
|
|
|
startTs = DateTimeUtils.todayStartTs(); |
|
|
|
endTs = DateTimeUtils.yearEndTs(); |
|
|
|
code= "A201hh"; |
|
|
|
} |
|
|
|
|
|
|
|
List<TsKvDTO> tskvList = |
|
|
|
tsKvService.findTsKvByCodeAndAttr( |
|
|
|
thingCode, |
|
|
|
code, |
|
|
|
startTs, |
|
|
|
endTs, |
|
|
|
StationChargeStatus.DAILY_DURATION_CODE, |
|
|
|
DateTimeUtils.monthStartTs(), |
|
|
|
DateTimeUtils.todayStartTs(), |
|
|
|
true); |
|
|
|
return StationMonthUsageAnalysis.assemble(tskvList, gunCount); |
|
|
|
} |
|
|
|
|