修改终端统计

This commit is contained in:
yuyang 2021-11-25 13:26:08 +08:00
parent cccec12c80
commit 5673bd909d
4 changed files with 24 additions and 27 deletions

View File

@ -76,7 +76,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
if(type ==null || userId ==null){
return new ArrayList<>();
}
if(userId !=1) {
if(logUserId !=1) {
Map<String, Object> 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;

View File

@ -41,7 +41,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
//获取登陆用户
Long logUserId = SecurityUtils.getUserId();
List<Map<String, Object>> list =new ArrayList<>();
if(userId !=1){
if(logUserId !=1){
Map<String, Object> 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<Map<String, Object>> page =new ArrayList<>();
if(list !=null && list.size()>0){
@ -163,7 +163,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
//获取登陆用户
Long logUserId = SecurityUtils.getUserId();
List<Map<String, Object>> list =new ArrayList<>();
if(userId !=1){
if(logUserId !=1){
Map<String, Object> 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<Map<String, Object>> list =new ArrayList<>();
if(userId !=1){
if(logUserId !=1){
Map<String, Object> 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<Map<String, Object>> list =new ArrayList<>();
if(userId !=1){
if(logUserId !=1){
Map<String, Object> 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<Map<String, Object>> 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<Map<String, Object>> list =new ArrayList<>();
if(userId !=1){
if(logUserId !=1){
Map<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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));
}

View File

@ -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

View File

@ -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
<if test="startTime !=null and startTime !=''">
and ss.create_time &gt;= #{startTime}
</if>
@ -316,10 +316,10 @@
<if test="endTime !=null and endTime !=''">
and ss.create_time &lt;= #{endTime}
</if>
<if test="chargingStationId !=null">
<if test="chargingStationId !=null and chargingStationId !=''">
and cs.charging_station_id=#{chargingStationId}
</if>
<if test="terminalId !=null">
<if test="terminalId !=null and terminalId !=''">
and te.terminal_id=#{terminalId}
</if>
<if test="type==1">