diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index ad2dcea2..07c2571e 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -72,7 +72,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { Map landUser = xhpcChargingStationService.getLandUser(userId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long operatorId = Long.valueOf(landUser.get("operatorId").toString()); list= xhpcChargingPileMapper.selectXhpcChargingPileList(name, type, serialNumber, chargingStationId,operatorId,1); }else{ diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 44b4c04f..c93ef1ff 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -113,7 +113,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi Map landUser = xhpcChargingStationMapper.getLandUser(userId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long operatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcChargingStationMapper.selectXhpcChargingStationList(name, operatorName,operatorId,1); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index 8f492eb9..b04bd91b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -261,7 +261,16 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { } //获取充电订单号 XhpcChargeOrder order = xhpcChargeOrderMapper.getChargingOrderId(chargingOrderId); - + if(order ==null){ + return AjaxResult.error(1104, "无效的终端编号"); + }else{ + if(order.getSource()==1){ + return AjaxResult.error(1104, "请在启动方停止充电"); + } + if(!order.getUserId().equals(userId)){ + return AjaxResult.error(1104, "请登陆相应账号停止充电"); + } + } R oa = powerPileService.stopCharging(order.getSerialNumber(), xhpcTerminal.getPileSerialNumber(), xhpcTerminal.getSerialNumber(), version); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index cf8d9c38..6aaf1937 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -91,7 +91,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { Map landUser = xhpcHistoryOrderMapper.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcHistoryOrderMapper.getListPage(phone,transactionNumber,1,chargingStationName,operatorId,source,startTime,endTime,logOperatorId,type,number); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index c99bd834..4a125bc3 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -84,7 +84,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logOperatorId,1); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java index 892bc6ab..2009c8bf 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -45,7 +45,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); @@ -167,7 +167,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 1,logOperatorId); @@ -205,7 +205,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,1,logOperatorId); @@ -240,7 +240,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 1,logOperatorId); @@ -286,7 +286,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, type,logOperatorId); @@ -313,7 +313,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logOperatorId, 1)); @@ -337,7 +337,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logOperatorId, 1)); @@ -367,7 +367,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ - if("01".equals(landUser.get("userType").toString())){ + if("01".equals(landUser.get("userType").toString()) || "03".equals(landUser.get("userType").toString())){ Long logOperatorId = Long.valueOf(landUser.get("operatorId").toString()); //运营商看自己的场站 return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logOperatorId, 1)); diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index db4b0cf2..f1bce3ad 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -142,7 +142,7 @@ and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId}) - and internet_user_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) + and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId}) group by DATE_FORMAT(create_time,'%Y-%m-%d') order by DATE_FORMAT(create_time,'%Y-%m-%d') desc