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 1bacea1c..3f8aeaf6 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 @@ -76,7 +76,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { if(type ==null || userId ==null){ return new ArrayList<>(); } - if(userId !=1) { + if(logUserId !=1) { Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -91,7 +91,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { } } }else{ - list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,userId,0); + list = xhpcRealTimeOrderMapper.list(phone,transactionNumber,source,chargingStationName,terminalName,operatorId,startTime,endTime,number,status,logUserId,0); } return list; 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 e2244900..7fbc59b0 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 @@ -46,7 +46,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -61,7 +61,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,userId); + list =xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); } List> page =new ArrayList<>(); if(list !=null && list.size()>0){ @@ -168,7 +168,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -183,7 +183,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,userId); + list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, 0,logUserId); } return list; @@ -206,7 +206,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -221,7 +221,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,userId); + list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,0,logUserId); } @@ -241,7 +241,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -256,7 +256,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,userId); + list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, 0,logUserId); } return list; @@ -280,29 +280,25 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { @Override public List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { - if(getJudge(null,operatorId,type)){ - return new ArrayList<>(); - } - //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); List> list =new ArrayList<>(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ 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); + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 1,logOperatorId); }else{ //查询赋值的场站 - list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, type,logUserId); + list = xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 2,logUserId); } } } }else{ - list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, type,userId); + list =xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, 0,logUserId); } @@ -314,7 +310,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -329,7 +325,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, userId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, logUserId, 0)); } return AjaxResult.success(); } @@ -338,7 +334,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { public AjaxResult getOperatorList(Long operatorId, Long userId, Integer type) { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -353,7 +349,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, userId, 0)); + AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 0)); } return AjaxResult.success(); } @@ -368,7 +364,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { //获取登陆用户 Long logUserId = SecurityUtils.getUserId(); - if(userId !=1){ + if(logUserId !=1){ Map landUser = xhpcHistoryOrderService.getLandUser(logUserId); if(landUser !=null){ if(landUser.get("userType") !=null){ @@ -383,7 +379,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, userId, 0)); + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, logUserId, 0)); } diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 1c813676..63aacbbf 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -785,6 +785,7 @@ cs.operator_id as operatorId, te.charging_pile_id as chargingPileId, co.user_id as userId, + co.user_id as internetUserId, ho.create_time as createTime from xhpc_history_order ho left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id 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 f1bce3ad..f89ed156 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -266,7 +266,7 @@ DATE_FORMAT(ss.create_time,'%Y-%m-%d') createTime from xhpc_statistics_station as ss left join xhpc_internet_user as iu on iu.internet_user_id = ss.internet_user_id - where ss.del_flag=0 and ss.type=2 and ss.internet_user_id !=null + where ss.del_flag=0 and ss.type=2 and ss.internet_user_id is not null and ss.create_time >= #{startTime} @@ -316,10 +316,10 @@ and ss.create_time <= #{endTime} - + and cs.charging_station_id=#{chargingStationId} - + and te.terminal_id=#{terminalId}