@ -44,8 +44,6 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
if ( coreParam . getParamType ( ) = = null ) {
return R . fail ( " ParamType不能为null " ) ;
@ -97,9 +95,6 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
@ -107,18 +102,18 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
/ / get user count of c client
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId Li st) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId sS tr ) ;
/ / ( 0 C端用户 1 流量方用户 2社区用户 3B端用户 )
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
/ / get user count of c client
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId Li st) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId sS tr ) ;
/ / ( 0 C端用户 1 流量方用户 2社区用户 3B端用户 )
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
}
/ / query charging station infos of whole area
@ -136,8 +131,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
xhpcChargingStationList = xhpcChargingStationMapper . selectByTenantIdAndAreaCode ( tenantIdsStr , areaCode , number ) ;
@ -146,8 +141,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
}
case 2 :
@ -162,8 +157,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
@ -180,8 +175,6 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
String currentTime = MyDateUtil . getCurrentDateStrInYyyyMmDdHhMmSsFormat ( ) ;
/ / judge care param function
@ -191,18 +184,18 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
/ / get user count of c client
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , currentTime ) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId Li st) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId sS tr ) ;
/ / ( 0 C端用户 1 流量方用户 2社区用户 3B端用户 )
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , currentTime ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , currentTime ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , currentTime ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , currentTime ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
/ / get user count of c client
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , currentTime ) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId Li st) ;
List < Long > chargingStationIdList = xhpcChargingStationMapper . selectChargingStationIds ( tenantId sS tr ) ;
/ / ( 0 C端用户 1 流量方用户 2社区用户 3B端用户 )
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , currentTime ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , currentTime ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , currentTime ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , currentTime ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
}
/ / query charging station infos of whole area
@ -220,8 +213,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
xhpcChargingStationList = xhpcChargingStationMapper . selectByTenantIdAndAreaCode ( tenantIdsStr , areaCode , number ) ;
@ -230,8 +223,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
}
case 2 :
@ -246,8 +239,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
Long appUserCount = xhpcAppUserMapper . selectTotalCountByTenantIdAndCurrentTime ( tenantIdsStr , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long communityUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long customerUserCount = xhpcHistoryOrderMapper . selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
return R . ok ( appUserCount + communityUserCount + customerUserCount ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
@ -264,9 +257,6 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
@ -331,16 +321,12 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
tenantIdsStr = coreParam . getTenantIds ( ) ;
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
tenantIdArray = tenantIdsStr . split ( " , " ) ;
tenantIdList = Arrays . stream ( tenantIdArray ) . collect ( Collectors . toList ( ) ) ;
OrderRatio orderRatio = getOrderRatio ( tenantIdList , null ) ;
OrderRatio orderRatio = getOrderRatio ( tenantIdsStr , null ) ;
return R . ok ( orderRatio ) ;
} else {
OrderRatio orderRatio = getOrderRatio ( null , null ) ;
@ -360,7 +346,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
OrderRatio orderRatio = getOrderRatio ( tenantId Li st, chargingStationIdList ) ;
OrderRatio orderRatio = getOrderRatio ( tenantId sS tr , chargingStationIdList ) ;
return R . ok ( orderRatio ) ;
} else {
xhpcChargingStationList = xhpcChargingStationMapper . selectByTenantIdAndAreaCode ( tenantIdsStr , areaCode , number ) ;
@ -368,7 +354,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
OrderRatio orderRatio = getOrderRatio ( tenantId Li st, chargingStationIdList ) ;
OrderRatio orderRatio = getOrderRatio ( tenantId sS tr , chargingStationIdList ) ;
return R . ok ( orderRatio ) ;
}
case 2 :
@ -382,7 +368,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
OrderRatio orderRatio = getOrderRatio ( tenantId Li st, chargingStationIdList ) ;
OrderRatio orderRatio = getOrderRatio ( tenantId sS tr , chargingStationIdList ) ;
return R . ok ( orderRatio ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
@ -404,19 +390,13 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
public R queryTerminalGun ( CoreParam coreParam ) {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
Map < String , Object > map = new HashMap < > ( ) ;
ArrayList < Long > chargingStationIdList = new ArrayList < > ( ) ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 : / / 全国
tenantIdsStr = coreParam . getTenantIds ( ) ;
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
tenantIdArray = tenantIdsStr . split ( " , " ) ;
tenantIdList = Arrays . stream ( tenantIdArray ) . collect ( Collectors . toList ( ) ) ;
}
return getMapR ( chargingStationIdList , tenantIdList , map ) ;
return getMapR ( chargingStationIdList , tenantIdsStr , map ) ;
/ / query charging station infos of whole area
case 1 : / / 省市区
Integer areaCode = coreParam . getAreaCode ( ) ;
@ -436,7 +416,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
}
return getMapR ( chargingStationIdList , tenantId Li st, map ) ;
return getMapR ( chargingStationIdList , tenantId sS tr , map ) ;
case 2 : / / 场站
/ / query location info of special charging station of special tenant
tenantIdsStr = coreParam . getTenantIds ( ) ;
@ -447,7 +427,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return getMapR ( chargingStationIdList , tenantId Li st, map ) ;
return getMapR ( chargingStationIdList , tenantId sS tr , map ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
}
@ -458,8 +438,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
return R . ok ( ) ;
}
private R < Map < String , Object > > getMapR ( List < Long > chargingStationIdList , List< String> tenantId Li st, Map < String , Object > map ) {
List < String > terminal = xhpcChargingStationMapper . getTerminal ( chargingStationIdList , tenantId Li st) ;
private R < Map < String , Object > > getMapR ( List < Long > chargingStationIdList , String tenantId sS tr , Map < String , Object > map ) {
List < String > terminal = xhpcChargingStationMapper . getTerminal ( chargingStationIdList , tenantId sS tr ) ;
int total = terminal . size ( ) ; / / 离线
int offLine = 0 ; / / 离线
int fault = 0 ; / / 故障
@ -506,8 +486,6 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
@ -570,17 +548,11 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
tenantIdsStr = coreParam . getTenantIds ( ) ;
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
tenantIdArray = tenantIdsStr . split ( " , " ) ;
tenantIdList = Arrays . stream ( tenantIdArray ) . collect ( Collectors . toList ( ) ) ;
}
return getOrderTrend ( tenantIdList , null ) ;
return getOrderTrend ( tenantIdsStr , null ) ;
case 1 :
Integer areaCode = coreParam . getAreaCode ( ) ;
tenantIdsStr = coreParam . getTenantIds ( ) ;
@ -594,14 +566,14 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return getOrderTrend ( tenantId Li st, chargingStationIdList ) ;
return getOrderTrend ( tenantId sS tr , chargingStationIdList ) ;
} else {
xhpcChargingStationList = xhpcChargingStationMapper . selectByTenantIdAndAreaCode ( tenantIdsStr , areaCode , number ) ;
ArrayList < Long > chargingStationIdList = new ArrayList < > ( ) ;
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return getOrderTrend ( tenantId Li st, chargingStationIdList ) ;
return getOrderTrend ( tenantId sS tr , chargingStationIdList ) ;
}
case 2 :
/ / query location info of special charging station of special tenant
@ -614,7 +586,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return getOrderTrend ( tenantId Li st, chargingStationIdList ) ;
return getOrderTrend ( tenantId sS tr , chargingStationIdList ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
}
@ -627,17 +599,11 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
public R queryWorkOrder ( CoreParam coreParam ) {
String tenantIdsStr = null ;
List < Map < String , Object > > xhpcChargingStationList = null ;
List < String > tenantIdList = null ;
String [ ] tenantIdArray = null ;
/ / judge care param function
switch ( coreParam . getParamType ( ) ) {
case 0 :
tenantIdsStr = coreParam . getTenantIds ( ) ;
if ( ! " " . equals ( tenantIdsStr ) & & tenantIdsStr ! = null ) {
tenantIdArray = tenantIdsStr . split ( " , " ) ;
tenantIdList = Arrays . stream ( tenantIdArray ) . collect ( Collectors . toList ( ) ) ;
}
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( null , tenantIdList ) ) ;
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( null , tenantIdsStr ) ) ;
/ / query charging station infos of whole area
case 1 :
Integer areaCode = coreParam . getAreaCode ( ) ;
@ -652,14 +618,14 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId Li st) ) ;
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId sS tr ) ) ;
} else {
xhpcChargingStationList = xhpcChargingStationMapper . selectByTenantIdAndAreaCode ( tenantIdsStr , areaCode , number ) ;
ArrayList < Long > chargingStationIdList = new ArrayList < > ( ) ;
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId Li st) ) ;
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId sS tr ) ) ;
}
case 2 :
/ / query location info of special charging station of special tenant
@ -672,7 +638,7 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
for ( Map < String , Object > chargingStation : xhpcChargingStationList ) {
chargingStationIdList . add ( ( Long ) chargingStation . get ( ConstantClass . CHARGING_STATION_ID ) ) ;
}
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId Li st) ) ;
return R . ok ( xhpcChargingStationMapper . getWorkOrderTerminal ( chargingStationIdList , tenantId sS tr ) ) ;
} else {
return R . fail ( " 传入的参数有误 " ) ;
}
@ -681,9 +647,9 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
}
}
private R < OrderTrend > getOrderTrend ( List< String> tenantId Li st, ArrayList < Long > chargingStationIdList ) {
private R < OrderTrend > getOrderTrend ( String tenantId sS tr , ArrayList < Long > chargingStationIdList ) {
List < Map < String , Object > > orderTrendList = xhpcHistoryOrderMapper . selectOrderTrendByTenantIdsAndChargingStationIds ( tenantId Li st, chargingStationIdList ) ;
List < Map < String , Object > > orderTrendList = xhpcHistoryOrderMapper . selectOrderTrendByTenantIdsAndChargingStationIds ( tenantId sS tr , chargingStationIdList ) ;
OrderTrend orderTrend = new OrderTrend ( ) ;
orderTrend . setData ( new ArrayList < > ( ) ) ;
orderTrend . setTotalItems ( 0L ) ;
@ -740,38 +706,37 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
/ * *
* 获取订单来源比例方法
*
* @param tenantIdList 租户id集合
* @param chargingStationIdList 电站id集合
* @author WH
* @date 2022 / 3 / 15 17 : 08
* @since version - 1 . 0
* /
private OrderRatio getOrderRatio ( List< String> tenantId Li st, List < Long > chargingStationIdList ) {
private OrderRatio getOrderRatio ( String tenantId sS tr , List < Long > chargingStationIdList ) {
Long totalCount = xhpcHistoryOrderMapper . selectCountByTenantIdsAndChargingStationIds ( tenantId Li st, chargingStationIdList ) ;
Long totalCount = xhpcHistoryOrderMapper . selectCountByTenantIdsAndChargingStationIds ( tenantId sS tr , chargingStationIdList ) ;
OrderRatio orderRatio = new OrderRatio ( ) ;
orderRatio . setTotalCount ( totalCount ) ;
Long stClientNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
Long stClientNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . COMMUNIT_TYPE , null ) ;
double stClientNumberDouble = stClientNumber . doubleValue ( ) ;
long stClientRatio = ( long ) ( stClientNumberDouble / totalCount * 100 ) ;
orderRatio . setStClientRatio ( stClientRatio ) ;
Long bClientNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
Long bClientNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . CUSTOMERS_TYPE , null ) ;
double bClientNumberDouble = bClientNumber . doubleValue ( ) ;
long bClientRatio = ( long ) ( bClientNumberDouble / totalCount * 100 ) ;
orderRatio . setBClientRatio ( bClientRatio ) ;
Long kuaiDianNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . KUAI_DIAN_EVCS ) ;
Long kuaiDianNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . KUAI_DIAN_EVCS ) ;
double kuaiDianNumberDouble = kuaiDianNumber . doubleValue ( ) ;
long kuaiDianRatio = ( long ) ( kuaiDianNumberDouble / totalCount * 100 ) ;
orderRatio . setKuaiDianRatio ( kuaiDianRatio ) ;
Long hengDaNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . HENG_DA_EVCS ) ;
Long hengDaNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . HENG_DA_EVCS ) ;
double hengDaNumberDouble = hengDaNumber . doubleValue ( ) ;
long hengDaRatio = ( long ) ( hengDaNumberDouble / totalCount * 100 ) ;
orderRatio . setHengDaRatio ( hengDaRatio ) ;
Long xinDianTuNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . XIN_DIAN_TU_EVCS ) ;
Long xinDianTuNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . XIN_DIAN_TU_EVCS ) ;
double xinDianTuNumberDouble = xinDianTuNumber . doubleValue ( ) ;
long xinDianTuRatio = ( long ) ( xinDianTuNumberDouble / totalCount * 100 ) ;
orderRatio . setXinDianTuRatio ( xinDianTuRatio ) ;
Long xiaoJuNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId Li st, chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . XIAO_JU_EVCS ) ;
Long xiaoJuNumber = xhpcHistoryOrderMapper . selectOrderCountBy ( tenantId sS tr , chargingStationIdList , UserTypeUtil . INTERNET_TYPE , ConstantClass . XIAO_JU_EVCS ) ;
double xiaoJuNumberDouble = xiaoJuNumber . doubleValue ( ) ;
long xiaoJuRatio = ( long ) ( xiaoJuNumberDouble / totalCount * 100 ) ;
orderRatio . setXiaoJuRatio ( xiaoJuRatio ) ;