修改数据权限

This commit is contained in:
yuyang 2021-11-23 17:10:02 +08:00
parent 4426e69be6
commit 5e2ea9ddc9
7 changed files with 23 additions and 14 deletions

View File

@ -72,7 +72,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
Map<String, Object> 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{

View File

@ -113,7 +113,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
Map<String, Object> 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);

View File

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

View File

@ -91,7 +91,7 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
Map<String, Object> 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);

View File

@ -84,7 +84,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
Map<String, Object> 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);

View File

@ -45,7 +45,7 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService {
Map<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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));

View File

@ -142,7 +142,7 @@
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
</if>
<if test="type==2">
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})
</if>
group by DATE_FORMAT(create_time,'%Y-%m-%d')
order by DATE_FORMAT(create_time,'%Y-%m-%d') desc