fix:飞行员用户判断
This commit is contained in:
parent
bd11c5384a
commit
a8175c6883
@ -9,7 +9,6 @@ import com.aircraft.modules.aircraft.mapper.AircraftDeviceMapper;
|
||||
import com.aircraft.modules.aircraft.service.AircraftDeviceService;
|
||||
import com.aircraft.modules.system.domain.AttachmentMaterial;
|
||||
import com.aircraft.modules.system.service.AttachmentMaterialService;
|
||||
import com.aircraft.utils.PageUtil;
|
||||
import com.aircraft.utils.SecurityUtils;
|
||||
import com.aircraft.utils.enums.UserTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -45,7 +44,11 @@ public class AircraftDeviceServiceImpl extends ServiceImpl<AircraftDeviceMapper,
|
||||
|
||||
@Override
|
||||
public IPage<AircraftDevicePageVO> page(AircraftDevicePageDTO dto, Page page) {
|
||||
return baseMapper.page(dto,page);
|
||||
//飞行端用户只能看到自己名下
|
||||
if (UserTypeEnum.EMPLOYEES.equals(SecurityUtils.getCurrentUserType())) {
|
||||
dto.setEmployeesId(SecurityUtils.getCurrentUserId());
|
||||
}
|
||||
return baseMapper.page(dto, page);
|
||||
|
||||
}
|
||||
|
||||
@ -128,7 +131,6 @@ public class AircraftDeviceServiceImpl extends ServiceImpl<AircraftDeviceMapper,
|
||||
|
||||
/**
|
||||
* 检查型号是否重复
|
||||
*
|
||||
*/
|
||||
private void checkModelRepeat(AircraftDevice aircraftDevice) {
|
||||
LambdaQueryWrapper<AircraftDevice> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -34,7 +34,7 @@ public class AircraftMaintenanceServiceImpl extends ServiceImpl<AircraftMaintena
|
||||
@Override
|
||||
public void create(AircraftMaintenance aircraftMaintenance) {
|
||||
if (!UserTypeEnum.EMPLOYEES.equals(SecurityUtils.getCurrentUserType())){
|
||||
throw new BadRequestException("非飞行员用户!");
|
||||
throw new BadRequestException("非飞行端用户!");
|
||||
}
|
||||
aircraftMaintenance.setEmployeesId(SecurityUtils.getCurrentUserId());
|
||||
save(aircraftMaintenance);
|
||||
|
Loading…
Reference in New Issue
Block a user