第三方充电增加是否参与充电限制,优化订单结算,修改C端用户列表显示

This commit is contained in:
yuyang 2022-05-09 17:14:58 +08:00
parent 198c22192a
commit d9b223cbe3
13 changed files with 100 additions and 156 deletions

View File

@ -43,17 +43,17 @@ public interface XhpcChargingStationMapper {
* @date 2022/3/4 11:21
* @since version-1.0
*/
List<Long> selectChargingStationIds(@Param("tenantIdList") List<String> tenantIdList);
List<Long> selectChargingStationIds(@Param("tenantIdsStr") String tenantIdsStr);
/**
* 查询枪的使用率
*/
List<String> getTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIds")List<String> tenantIds);
List<String> getTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIdsStr")String tenantIdsStr);
/**
* 查询枪的使用率
*/
List<Map<String, Object>> getWorkOrderTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIds")List<String> tenantIds);
List<Map<String, Object>> getWorkOrderTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIdsStr")String tenantIdsStr);
}

View File

@ -28,7 +28,7 @@ public interface XhpcHistoryOrderMapper {
* @since version-1.0
*/
Long selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(
@Param("tenantIdList") List<String> tenantIdList,
@Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList,
@Param("userType") Integer userType,
@Param("currentTime") String currentTime);
@ -45,11 +45,11 @@ public interface XhpcHistoryOrderMapper {
@Param("chargingStationIdList") List<Long> chargingStationIdList);
Long selectCountByTenantIdsAndChargingStationIds(
@Param("tenantIdList") List<String> tenantIdList,
@Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList);
Long selectOrderCountBy(
@Param("tenantIdList") List<String> tenantIdList,
@Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList,
@Param("userType") Integer userType,
@Param("operatorId3rdptyEvcs") String operatorId3rdptyEvcs);
@ -62,7 +62,7 @@ public interface XhpcHistoryOrderMapper {
* @since version-1.0
*/
List<Map<String, Object>> selectOrderTrendByTenantIdsAndChargingStationIds(
@Param("tenantIdList") List<String> tenantIdList,
@Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList);
}

View File

@ -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(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdsStr);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdsStr);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdsStr);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, currentTime);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, currentTime);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, currentTime);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList);
List<Long> chargingStationIdList = xhpcChargingStationMapper.selectChargingStationIds(tenantIdsStr);
//0 C端用户 1 流量方用户 2社区用户 3B端用户
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, currentTime);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, currentTime);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, currentTime);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long communityUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long customerUserCount = xhpcHistoryOrderMapper.selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(tenantIdsStr, 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(tenantIdList, chargingStationIdList);
OrderRatio orderRatio = getOrderRatio(tenantIdsStr, 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(tenantIdList, chargingStationIdList);
OrderRatio orderRatio = getOrderRatio(tenantIdsStr, 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(tenantIdList, chargingStationIdList);
OrderRatio orderRatio = getOrderRatio(tenantIdsStr, 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,tenantIdList, map);
return getMapR(chargingStationIdList,tenantIdsStr, 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,tenantIdList, map);
return getMapR(chargingStationIdList,tenantIdsStr, 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> tenantIdList, Map<String, Object> map) {
List<String> terminal = xhpcChargingStationMapper.getTerminal(chargingStationIdList, tenantIdList);
private R<Map<String, Object>> getMapR(List<Long> chargingStationIdList,String tenantIdsStr, Map<String, Object> map) {
List<String> terminal = xhpcChargingStationMapper.getTerminal(chargingStationIdList, tenantIdsStr);
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(tenantIdList, chargingStationIdList);
return getOrderTrend(tenantIdsStr, 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(tenantIdList, chargingStationIdList);
return getOrderTrend(tenantIdsStr, 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(tenantIdList, chargingStationIdList);
return getOrderTrend(tenantIdsStr, 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,tenantIdList));
return R.ok(xhpcChargingStationMapper.getWorkOrderTerminal(chargingStationIdList,tenantIdsStr));
} 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,tenantIdList));
return R.ok(xhpcChargingStationMapper.getWorkOrderTerminal(chargingStationIdList,tenantIdsStr));
}
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,tenantIdList));
return R.ok(xhpcChargingStationMapper.getWorkOrderTerminal(chargingStationIdList,tenantIdsStr));
} else {
return R.fail("传入的参数有误");
}
@ -681,9 +647,9 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
}
}
private R<OrderTrend> getOrderTrend(List<String> tenantIdList, ArrayList<Long> chargingStationIdList) {
private R<OrderTrend> getOrderTrend(String tenantIdsStr, ArrayList<Long> chargingStationIdList) {
List<Map<String, Object>> orderTrendList = xhpcHistoryOrderMapper.selectOrderTrendByTenantIdsAndChargingStationIds(tenantIdList, chargingStationIdList);
List<Map<String, Object>> orderTrendList = xhpcHistoryOrderMapper.selectOrderTrendByTenantIdsAndChargingStationIds(tenantIdsStr, 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> tenantIdList, List<Long> chargingStationIdList) {
private OrderRatio getOrderRatio(String tenantIdsStr, List<Long> chargingStationIdList) {
Long totalCount = xhpcHistoryOrderMapper.selectCountByTenantIdsAndChargingStationIds(tenantIdList, chargingStationIdList);
Long totalCount = xhpcHistoryOrderMapper.selectCountByTenantIdsAndChargingStationIds(tenantIdsStr, chargingStationIdList);
OrderRatio orderRatio = new OrderRatio();
orderRatio.setTotalCount(totalCount);
Long stClientNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdList, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
Long stClientNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, chargingStationIdList, UserTypeUtil.COMMUNIT_TYPE, null);
double stClientNumberDouble = stClientNumber.doubleValue();
long stClientRatio = (long) (stClientNumberDouble / totalCount * 100);
orderRatio.setStClientRatio(stClientRatio);
Long bClientNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdList, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
Long bClientNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, chargingStationIdList, UserTypeUtil.CUSTOMERS_TYPE, null);
double bClientNumberDouble = bClientNumber.doubleValue();
long bClientRatio = (long) (bClientNumberDouble / totalCount * 100);
orderRatio.setBClientRatio(bClientRatio);
Long kuaiDianNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdList, chargingStationIdList, UserTypeUtil.INTERNET_TYPE, ConstantClass.KUAI_DIAN_EVCS);
Long kuaiDianNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.INTERNET_TYPE, ConstantClass.HENG_DA_EVCS);
Long hengDaNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.INTERNET_TYPE, ConstantClass.XIN_DIAN_TU_EVCS);
Long xinDianTuNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, 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(tenantIdList, chargingStationIdList, UserTypeUtil.INTERNET_TYPE, ConstantClass.XIAO_JU_EVCS);
Long xiaoJuNumber = xhpcHistoryOrderMapper.selectOrderCountBy(tenantIdsStr, chargingStationIdList, UserTypeUtil.INTERNET_TYPE, ConstantClass.XIAO_JU_EVCS);
double xiaoJuNumberDouble = xiaoJuNumber.doubleValue();
long xiaoJuRatio = (long) (xiaoJuNumberDouble / totalCount * 100);
orderRatio.setXiaoJuRatio(xiaoJuRatio);

View File

@ -110,11 +110,8 @@
FROM
xhpc_charging_station
<where>
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
and tenant_id in
<foreach collection="tenantIdList" item="tenantId" open="(" close=")" separator=",">
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
</where>
</select>
@ -483,16 +480,13 @@
select serial_number as serialNumber
from xhpc_terminal
where del_flag = 0
<if test="tenantIds !=null and tenantIds.size()>0">
and tenant_id in
<foreach collection="tenantIds" open="(" item="tenantId" separator="," close=")" >
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
and charging_station_id in
<foreach collection="chargingStationIds" open="(" item="chargingStationId" separator="," close=")" >
#{tenantId}
#{chargingStationId}
</foreach>
</if>
</select>
@ -504,18 +498,8 @@
status
from xhpc_work_order
where 1=1
<if test="tenantIds !=null and tenantIds.size()>0">
and tenant_id in
<foreach collection="tenantIds" open="(" item="tenantId" separator="," close=")" >
#{tenantId}
</foreach>
</if>
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
and find_in_set((select serial_number from xhpc_terminal where charging_station_id in
<foreach collection="tenantIds" open="(" item="tenantId" separator="," close=")" >
#{tenantId}
</foreach>
),serial_number)
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
order by create_time desc
</select>

View File

@ -89,14 +89,11 @@
xhpc_history_order
WHERE
del_flag = 0
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
AND tenant_id IN
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
<if test="chargingStationIdList!=null and chargingStationIdList.size()!=0 ">
AND tenant_id IN
AND charging_station_id IN
<foreach collection="chargingStationIdList" separator="," open="(" close=")" item="chargingStationId">
#{chargingStationId}
</foreach>
@ -111,7 +108,7 @@
</select>
<select id="selectTotalElectricQuantity" resultType="java.lang.Long">
SELECT
sum( total_power ) AS totalPower
ifnull(sum(total_power),0) AS totalPower
FROM
xhpc_history_order
WHERE
@ -133,11 +130,8 @@
xhpc_history_order
WHERE
del_flag = 0
<if test="tenantIdList!=null and tenantIdList.size()!=0">
and tenant_id in
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
<if test="chargingStationIdList!=null and chargingStationIdList.size()!=0 ">
and charging_station_id in
@ -159,11 +153,8 @@
and operator_id3rdpty_evcs = #{operatorId3rdptyEvcs}
</if>
</if>
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
AND tenant_id IN
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
<if test="chargingStationIdList!=null and chargingStationIdList.size()!=0 ">
AND charging_station_id IN
@ -193,11 +184,8 @@
xhpc_history_order
WHERE
del_flag = 0
<if test="tenantIdList!=null and tenantIdList.size()!=0 ">
AND tenant_id IN
<foreach collection="tenantIdList" separator="," open="(" close=")" item="tenantId">
#{tenantId}
</foreach>
<if test="tenantIdsStr!=null and tenantIdsStr!='' ">
and find_in_set(tenant_id, #{tenantIdsStr})
</if>
<if test="chargingStationIdList!=null and chargingStationIdList.size()!=0 ">
AND charging_station_id IN

View File

@ -10,4 +10,7 @@ import org.apache.ibatis.annotations.Param;
public interface XhpcInternetUserMapper {
int selectByOperatorIdEvcs(@Param("operatorIdEvcs") String operatorIdEvcs);
//运营商该场站是否参与第三方充电
int getXhpcStationInternetBlacklist(@Param("operatorIdEvcs")String operatorIdEvcs,@Param("connectorId") String connectorId);
}

View File

@ -470,6 +470,13 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
return r;
}
//运营商该场站是否参与第三方充电
int black = xhpcInternetUserMapper.getXhpcStationInternetBlacklist(internetSerialNumber.substring(0, 9), connectorId);
if (black > 0) {
r.setCode(500);
r.setMsg("场站不支持该流量方充电");
return r;
}
StartChargingData startChargingData = new StartChargingData();
//500000 equals 500 yuan
startChargingData.setBalance(chargingAmt * 100);

View File

@ -496,7 +496,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
if(betweenDay>0){
activityInternet1 = activityStationTime.get(0);
activityFormulaTime1 = xhpcRealTimeOrderMapper.getActivityFormulaTime(activityInternet1.getActivityId(), start, "24:00:00");
activityFormulaTime2 = xhpcRealTimeOrderMapper.getActivityFormulaTime(activityInternet1.getActivityId(), "00:00:00", start);
activityFormulaTime2 = xhpcRealTimeOrderMapper.getActivityFormulaTime(activityInternet1.getActivityId(), "00:00:00", end);
activityId =activityInternet1.getActivityId()+"";
}else{
activityInternet1 = activityStationTime.get(0);

View File

@ -13,4 +13,9 @@
and cooperation_end_time &gt;= now()
</select>
<select id="getXhpcStationInternetBlacklist" resultType="int">
SELECT COUNT(*) FROM xhpc_station_internet_blacklist
where internet_user_id = (select internet_user_id from xhpc_internet_user where operator_id_evcs = #{operatorIdEvcs} and del_flag=0 limit 1)
and status =0 and charging_station_id =(select charging_station_id from xhpc_terminal where serial_number=#{connectorId} and del_flag=0 and status=0 limit 1)
</select>
</mapper>

View File

@ -31,8 +31,9 @@ public class XhpcUserAccountStatementController extends BaseController {
*/
@ApiOperation(value = "用户流水分页列表")
@GetMapping("/page")
public TableDataInfo page(HttpServletRequest request) {
List<Map<String, Object>> list = iXhpcUserAccountStatementService.page(request);
public TableDataInfo page(Long appUserId) {
startPage();
List<Map<String, Object>> list = iXhpcUserAccountStatementService.page(appUserId);
return getDataTable(list);
}

View File

@ -26,7 +26,7 @@ public interface IXhpcUserAccountStatementService {
* @param appUserId C端用户id
* @return
*/
public List<Map<String, Object>> page(HttpServletRequest request);
public List<Map<String, Object>> page(Long appUserId);
/**
* 用户流水列表

View File

@ -58,22 +58,13 @@ public class XhpcUserAccountStatementServiceImpl extends BaseService implements
* @return
*/
@Override
public List<Map<String, Object>> page(HttpServletRequest request) {
public List<Map<String, Object>> page(Long appUserId) {
List<Map<String, Object>> list =new ArrayList<>();
LoginUser loginUser = tokenService.getLoginUser(request);
Long userid = loginUser.getUserid();
String tenantId = loginUser.getTenantId();
Integer userType = loginUser.getUserType();
R user = userTypeService.getUser(null, userid, userType, null, tenantId);
if(user !=null && user.getData() !=null){
Map<String, Object> userMessage = (Map<String, Object>)user.getData();
if (userMessage != null) {
startPage();
return xhpcUserAccountStatementMapper.page(userid,userType,tenantId);
}
}
if(appUserId==null){
return list;
}
return xhpcUserAccountStatementMapper.page(appUserId,0,null);
}
/**
* 用户费用变化产生流水

View File

@ -196,7 +196,7 @@
CASE WHEN xau.`status` = 0 THEN '正常' else '禁用' end statusName,
CASE WHEN a.count > 0 THEN '老用户' else '新用户' end newUser
from xhpc_app_user xau
LEFT JOIN (select count(1) count ,user_id from xhpc_charge_order where del_flag = 0 ) a on a.user_id =
LEFT JOIN (select count(1) count ,user_id from xhpc_charge_order where del_flag = 0 and source =0 GROUP BY user_id) a on a.user_id =
xau.app_user_id
WHERE xau.del_flag = 0
<if test="phone != null and phone != ''">