From 5673bd909d249521d9802267e7959533b93328e9 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Thu, 25 Nov 2021 13:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=88=E7=AB=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/XhpcRealTimeOrderServiceImpl.java | 4 +- .../impl/XhpcStatisticsServiceImpl.java | 40 +++++++++---------- .../mapper/XhpcHistoryOrderMapper.xml | 1 + .../resources/mapper/XhpcStatisticsMapper.xml | 6 +-- 4 files changed, 24 insertions(+), 27 deletions(-) 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 2009c8bf..e8915086 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 @@ -41,7 +41,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){ @@ -56,7 +56,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){ @@ -163,7 +163,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){ @@ -178,7 +178,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; @@ -201,7 +201,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){ @@ -216,7 +216,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); } @@ -236,7 +236,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){ @@ -251,7 +251,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; @@ -275,29 +275,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); } @@ -309,7 +305,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){ @@ -324,7 +320,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(); } @@ -333,7 +329,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){ @@ -348,7 +344,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { } } }else{ - AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, userId, 0)); + AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, logUserId, 0)); } return AjaxResult.success(); } @@ -363,7 +359,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){ @@ -378,7 +374,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}