修改版本搜索问题

This commit is contained in:
yuyang 2022-09-30 10:27:19 +08:00
parent cb563320cf
commit caaf2bbc92
5 changed files with 19 additions and 10 deletions

View File

@ -88,14 +88,14 @@ public class SysLoginService
if(type==0){
if(user.getDataPowerType()!=0){
remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登陆地址错误");
throw new BaseException("登陆地址错误,请在管理员界面登陆");
throw new BaseException("登陆地址错误,请在运营商界面登陆");
}
}else{
if(user.getDataPowerType()==1 ||user.getDataPowerType()==2){
}else{
remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登陆地址错误");
throw new BaseException("登陆地址错误,请在运营商界面登陆");
throw new BaseException("登陆地址错误,请在管理员界面登陆");
}
}

View File

@ -12,7 +12,7 @@ import java.util.Map;
*/
public interface XhpcPileEditionMapper {
List<Map<String, Object>> list(@Param("chargingStationId")Long chargingStationId, @Param("chargingPileIds") String chargingPileIds,@Param("logOperatorId")Long logOperatorId, @Param("type")Integer type, @Param("tenantId")String tenantId);
List<Map<String, Object>> list(@Param("chargingStationId")Long chargingStationId,@Param("chargingPileIds") List chargingPileIds,@Param("logOperatorId")Long logOperatorId, @Param("type")Integer type, @Param("tenantId")String tenantId);
/**
*

View File

@ -44,24 +44,29 @@ public class XhpcPileEditionServiceImpl extends BaseService implements IXhpcPil
Long sysUserId = sysUser.getUserId();
String tenantId =loginUser.getTenantId();
//判断登录人的权限
List listPileIds = new ArrayList();
if(chargingPileIds !=null && !"".equals(chargingPileIds)){
String[] split = chargingPileIds.split(",");
listPileIds = Arrays.asList(split);
}
List<Map<String, Object>> list =new ArrayList<>();
if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){
//运维人员权限
list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,3,tenantId);
list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,3,tenantId);
}else{
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
// startPage();
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
Long logOperatorId = sysUser.getOperatorId();
//运营商看自己的场站
list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,logOperatorId,1,tenantId);
list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,logOperatorId,1,tenantId);
}else{
//查询赋值的场站
list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,2,tenantId);
list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,2,tenantId);
}
}else{
// startPage();
list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,0,tenantId);
list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,0,tenantId);
}
}
return list;

View File

@ -28,6 +28,7 @@
xem.equipmen_name as equipmenName,
xem.equipmen_number as equipmenNumber,
st.name as chargingStationName,
st.charging_station_id as chargingStationId,
xem.create_time as createTime
from xhpc_equipmen_monitor as xem
left join xhpc_charging_station as st on st.charging_station_id =xem.charging_station_id

View File

@ -37,9 +37,6 @@
<if test="chargingStationId !=null">
and xpe.charging_station_id = #{chargingStationId}
</if>
<if test="chargingPileIds !=null and chargingPileIds !=''">
and find_in_set(xpe.charging_pile_ids, #{chargingPileIds})
</if>
<if test="type ==1">
and xpe.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId})
</if>
@ -49,6 +46,12 @@
<if test="type ==3">
and find_in_set (xpe.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId}))
</if>
<if test="chargingPileIds.size()>0 and chargingPileIds !=null">
and
<foreach collection="chargingPileIds" separator="and" item="pileId" close=")" open="(">
find_in_set(#{pileId},xpe.charging_pile_ids)
</foreach>
</if>
<if test="tenantId !=null and tenantId !=''">
and xpe.tenant_id=#{tenantId}
</if>