第三方充电增加是否参与充电限制,优化订单结算,修改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 * @date 2022/3/4 11:21
* @since version-1.0 * @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 * @since version-1.0
*/ */
Long selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime( Long selectUserTotalCountByTenantIdsAndChargingStationIdsAndUserTypeAndCurrentTime(
@Param("tenantIdList") List<String> tenantIdList, @Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList, @Param("chargingStationIdList") List<Long> chargingStationIdList,
@Param("userType") Integer userType, @Param("userType") Integer userType,
@Param("currentTime") String currentTime); @Param("currentTime") String currentTime);
@ -45,11 +45,11 @@ public interface XhpcHistoryOrderMapper {
@Param("chargingStationIdList") List<Long> chargingStationIdList); @Param("chargingStationIdList") List<Long> chargingStationIdList);
Long selectCountByTenantIdsAndChargingStationIds( Long selectCountByTenantIdsAndChargingStationIds(
@Param("tenantIdList") List<String> tenantIdList, @Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList); @Param("chargingStationIdList") List<Long> chargingStationIdList);
Long selectOrderCountBy( Long selectOrderCountBy(
@Param("tenantIdList") List<String> tenantIdList, @Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList, @Param("chargingStationIdList") List<Long> chargingStationIdList,
@Param("userType") Integer userType, @Param("userType") Integer userType,
@Param("operatorId3rdptyEvcs") String operatorId3rdptyEvcs); @Param("operatorId3rdptyEvcs") String operatorId3rdptyEvcs);
@ -62,7 +62,7 @@ public interface XhpcHistoryOrderMapper {
* @since version-1.0 * @since version-1.0
*/ */
List<Map<String, Object>> selectOrderTrendByTenantIdsAndChargingStationIds( List<Map<String, Object>> selectOrderTrendByTenantIdsAndChargingStationIds(
@Param("tenantIdList") List<String> tenantIdList, @Param("tenantIdsStr") String tenantIdsStr,
@Param("chargingStationIdList") List<Long> chargingStationIdList); @Param("chargingStationIdList") List<Long> chargingStationIdList);
} }

View File

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

View File

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

View File

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

View File

@ -10,4 +10,7 @@ import org.apache.ibatis.annotations.Param;
public interface XhpcInternetUserMapper { public interface XhpcInternetUserMapper {
int selectByOperatorIdEvcs(@Param("operatorIdEvcs") String operatorIdEvcs); 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; 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(); StartChargingData startChargingData = new StartChargingData();
//500000 equals 500 yuan //500000 equals 500 yuan
startChargingData.setBalance(chargingAmt * 100); startChargingData.setBalance(chargingAmt * 100);

View File

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

View File

@ -13,4 +13,9 @@
and cooperation_end_time &gt;= now() and cooperation_end_time &gt;= now()
</select> </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> </mapper>

View File

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

View File

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

View File

@ -58,21 +58,12 @@ public class XhpcUserAccountStatementServiceImpl extends BaseService implements
* @return * @return
*/ */
@Override @Override
public List<Map<String, Object>> page(HttpServletRequest request) { public List<Map<String, Object>> page(Long appUserId) {
List<Map<String, Object>> list =new ArrayList<>(); List<Map<String, Object>> list =new ArrayList<>();
LoginUser loginUser = tokenService.getLoginUser(request); if(appUserId==null){
Long userid = loginUser.getUserid(); return list;
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);
}
} }
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 xau.`status` = 0 THEN '正常' else '禁用' end statusName,
CASE WHEN a.count > 0 THEN '老用户' else '新用户' end newUser CASE WHEN a.count > 0 THEN '老用户' else '新用户' end newUser
from xhpc_app_user xau 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 xau.app_user_id
WHERE xau.del_flag = 0 WHERE xau.del_flag = 0
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">