| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.alarmpoints.tube.domain.ArdTubes; |
| | | import com.ruoyi.alarmpoints.tube.domain.ArdTubesParam; |
| | | import com.ruoyi.alarmpoints.tube.service.IArdTubesService; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | { |
| | | @Resource |
| | | private IArdTubesService ardTubesService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | /** |
| | | * 查询管线管理列表 |
| | |
| | | { |
| | | return toAjax(ardTubesService.deleteArdTubesByIds(ids)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询单条管线数据 |
| | | */ |
| | | @GetMapping("/one/{id}") |
| | | @ApiOperation("查询单条管线数据") |
| | | public Results one(@PathVariable String id) { |
| | | return ardTubesService.tubeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询权限下全部管线数据 |
| | | */ |
| | | @GetMapping("/tobeList") |
| | | @ApiOperation("查询权限下全部管线数据") |
| | | public Results tobeList() { |
| | | String usersId = SecurityUtils.getUserId(); |
| | | //根据userId查询部门Id |
| | | SysUser sysUser = sysUserService.selectUserById(usersId); |
| | | //根据当前deptId或者当前及所属下级的所有deptId |
| | | List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId()); |
| | | //根据deptList获取所有管线数据 |
| | | return ardTubesService.tobeList(deptList); |
| | | } |
| | | |
| | | /** |
| | | * 查询并筛选权限下所有管线数据 |
| | | */ |
| | | @GetMapping("/conditionList") |
| | | @ApiOperation("查询并筛选权限下所有管线数据") |
| | | public Results conditionList(ArdTubesParam ardTubesParam) { |
| | | String usersId = SecurityUtils.getUserId(); |
| | | //根据userId查询部门Id |
| | | SysUser sysUser = sysUserService.selectUserById(usersId); |
| | | //根据当前deptId或者当前及所属下级的所有deptId |
| | | List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId()); |
| | | ardTubesParam.setDeptList(deptList); |
| | | return ardTubesService.conditionList(ardTubesParam); |
| | | } |
| | | |
| | | } |