增加运维人员的数据权限

This commit is contained in:
yuyang 2022-09-16 16:58:03 +08:00
parent 761a216aee
commit 244f2fce6f
6 changed files with 40 additions and 10 deletions

View File

@ -68,13 +68,19 @@ public class XhpcWorkHistoryOrderServiceImpl extends BaseService implements Xhpc
Long sysUserId = sysUser.getUserId();
//params.put("tenantId", loginUser.getTenantId());
//桩的统计该时段金额
if (UserTypeUtil.USER_ID !=sysUserId) {
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维管理人员
params.put("status", 3);
params.put("userId",sysUserId);
}else if (UserTypeUtil.USER_ID !=sysUserId) {
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())) {
Long logOperatorId = sysUser.getOperatorId();
params.put("status", 1);
params.put("userId",logOperatorId);
//运营商看自己的场站
} else {
params.put("status", 2);
params.put("userId",sysUserId);
//查询赋值的场站
}
} else {

View File

@ -171,7 +171,9 @@
<if test="params.status==2">
and co.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.userId})
</if>
<if test="params.status==3">
and find_in_set (ho.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{params.userId}))
</if>
<if test="params.tenantId !=null and '' !=params.tenantId">
and ho.tenant_id=#{params.tenantId}
</if>

View File

@ -48,6 +48,7 @@ public class XhpcEquipmenMonitorServiceImpl implements IXhpcEquipmenMonitorServi
if(tenantId !=null && !"".equals(tenantId)){
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维管理人员
map = xhpcEquipmenMonitorMapper.list(3,logUserId,tenantId,chargingStationId,equipmenName,equipmenNumber);
}else{
if(sysUser.getUserId() !=UserTypeUtil.USER_ID){
Long logOperatorId = sysUser.getOperatorId();

View File

@ -47,6 +47,9 @@
<if test="number !=0 and number ==2">
and xem.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="number !=0 and number ==3">
and find_in_set (xem.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
<if test="tenantId !=null and tenantId !=''">
and xem.tenant_id=#{tenantId}
</if>

View File

@ -1261,6 +1261,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
if(tenantId !=null && !"".equals(tenantId)){
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维管理人员
map= xhpcStatisticsServiceMapper.getChargingStationEmptyOrder(3,logUserId,tenantId,startTime,endTime);
}else{
if(chargingStationId==null){
if(sysUser.getUserId() !=UserTypeUtil.USER_ID){
@ -1380,6 +1381,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
if(tenantId !=null && !"".equals(tenantId)){
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维管理人员
if(type !=null && type==4){
map= xhpcStatisticsServiceMapper.getWorkHistoryOrderListYY(operatorId,chargingStationId,chargingPileId,terminalId,stopReason,3,logUserId,tenantId,conditionBeginOfDay,conditionEndOfDay,type);
}else{
map= xhpcStatisticsServiceMapper.getWorkHistoryOrderList(operatorId,chargingStationId,chargingPileId,terminalId,stopReason,3,logUserId,tenantId,conditionBeginOfDay,conditionEndOfDay,type);
}
}else{
if(sysUser.getUserId() !=UserTypeUtil.USER_ID){
Long logOperatorId = sysUser.getOperatorId();
@ -1429,6 +1435,11 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
if(tenantId !=null && !"".equals(tenantId)){
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维管理人员
map = xhpcStatisticsServiceMapper.getWorkOrderNumber(3,logUserId,tenantId);
//异常订单统计
map.add(xhpcStatisticsServiceMapper.getChargeOrderStatusNumber(3,logUserId,tenantId));
//退款订单统计
map.add(xhpcStatisticsServiceMapper.getRefundOderStatusNumber(3,logUserId,tenantId));
}else{
if(sysUser.getUserId() !=UserTypeUtil.USER_ID){
Long logOperatorId = sysUser.getOperatorId();

View File

@ -1457,6 +1457,9 @@
<if test="status==2">
and xh.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="status==3">
and find_in_set (xh.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
GROUP BY xh.charging_station_id
</select>
@ -1555,7 +1558,9 @@
<if test="status==2">
and xwho.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="status==3">
and find_in_set (xwho.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
GROUP BY DATE_FORMAT(xwho.end_time, '%Y-%m-%d')
order by xwho.end_time
@ -1620,7 +1625,9 @@
<if test="status==2">
and xwho.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="status==3">
and find_in_set (xwho.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
GROUP BY date_format(xwho.end_time, '%Y-%m')
order by xwho.end_time
@ -1641,6 +1648,9 @@
<if test="status==2">
and xwo.station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="status==3">
and find_in_set (xwo.station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
<if test="tenantId !=null and '' !=tenantId">
and xwo.tenant_id=#{tenantId}
</if>
@ -1659,6 +1669,9 @@
<if test="status==2">
and station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="status==3">
and find_in_set (station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
<if test="tenantId !=null and '' !=tenantId">
and tenant_id=#{tenantId}
</if>
@ -1670,12 +1683,6 @@
concat('30') type,
concat('退款问题') name
from xhpc_refund_order where status =0 and amount &gt; 200
<if test="status==1">
and station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
</if>
<if test="status==2">
and station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId})
</if>
<if test="tenantId !=null and '' !=tenantId">
and tenant_id=#{tenantId}
</if>