| | |
| | | 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; |
| | | |
| | | // /** |
| | | // * æ¥è¯¢ç®¡çº¿ç®¡çå表 |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:list')") |
| | | // @GetMapping("/list") |
| | | // @ApiOperation("æ¥è¯¢ç®¡çº¿ç®¡çå表") |
| | | // public TableDataInfo list(ArdTubes ardTubes) |
| | | // { |
| | | // startPage(); |
| | | // List<ArdTubes> list = ardTubesService.selectArdTubesList(ardTubes); |
| | | // return getDataTable(list); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 导åºç®¡çº¿ç®¡çå表 |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:export')") |
| | | // @Log(title = "管线管ç", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/export") |
| | | // @ApiOperation("导åºç®¡çº¿ç®¡çå表") |
| | | // public void export(HttpServletResponse response, ArdTubes ardTubes) |
| | | // { |
| | | // List<ArdTubes> list = ardTubesService.selectArdTubesList(ardTubes); |
| | | // ExcelUtil<ArdTubes> util = new ExcelUtil<ArdTubes>(ArdTubes.class); |
| | | // util.exportExcel(response, list, "ç®¡çº¿ç®¡çæ°æ®"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * è·å管线管ç详ç»ä¿¡æ¯ |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:query')") |
| | | // @GetMapping(value = "/{id}") |
| | | // @ApiOperation("éè¿IDè·å管线管ç详ç»ä¿¡æ¯") |
| | | // public AjaxResult getInfo(@PathVariable("id") String id) |
| | | // { |
| | | // return success(ardTubesService.selectArdTubesById(id)); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ°å¢ç®¡çº¿ç®¡ç |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:add')") |
| | | // @Log(title = "管线管ç", businessType = BusinessType.INSERT) |
| | | // @PostMapping |
| | | // @ApiOperation("æ°å¢ç®¡çº¿ç®¡ç") |
| | | // public AjaxResult add(@RequestBody ArdTubes ardTubes) |
| | | // { |
| | | // return toAjax(ardTubesService.insertArdTubes(ardTubes)); |
| | | // } |
| | | // |
| | | // /** |
| | | // * ä¿®æ¹ç®¡çº¿ç®¡ç |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:edit')") |
| | | // @Log(title = "管线管ç", businessType = BusinessType.UPDATE) |
| | | // @PutMapping |
| | | // @ApiOperation("ä¿®æ¹ç®¡çº¿ç®¡ç") |
| | | // public AjaxResult edit(@RequestBody ArdTubes ardTubes) |
| | | // { |
| | | // return toAjax(ardTubesService.updateArdTubes(ardTubes)); |
| | | // } |
| | | // |
| | | // /** |
| | | // * å é¤ç®¡çº¿ç®¡ç |
| | | // */ |
| | | // @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:remove')") |
| | | // @Log(title = "管线管ç", businessType = BusinessType.DELETE) |
| | | // @DeleteMapping("/{ids}") |
| | | // @ApiOperation("å é¤ç®¡çº¿ç®¡ç") |
| | | // public AjaxResult remove(@PathVariable String[] ids) |
| | | // { |
| | | // return toAjax(ardTubesService.deleteArdTubesByIds(ids)); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡çº¿ç®¡çå表 |
| | | * æ¥è¯¢åæ¡ç®¡çº¿æ°æ® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:list')") |
| | | @GetMapping("/list") |
| | | @ApiOperation("æ¥è¯¢ç®¡çº¿ç®¡çå表") |
| | | public TableDataInfo list(ArdTubes ardTubes) |
| | | { |
| | | startPage(); |
| | | List<ArdTubes> list = ardTubesService.selectArdTubesList(ardTubes); |
| | | return getDataTable(list); |
| | | @GetMapping("/one/{id}") |
| | | @ApiOperation("æ¥è¯¢åæ¡ç®¡çº¿æ°æ®") |
| | | public Results one(@PathVariable String id) { |
| | | return ardTubesService.tubeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç®¡çº¿ç®¡çå表 |
| | | * æ¥è¯¢æéä¸å
¨é¨ç®¡çº¿æ°æ® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:export')") |
| | | @Log(title = "管线管ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åºç®¡çº¿ç®¡çå表") |
| | | public void export(HttpServletResponse response, ArdTubes ardTubes) |
| | | { |
| | | List<ArdTubes> list = ardTubesService.selectArdTubesList(ardTubes); |
| | | ExcelUtil<ArdTubes> util = new ExcelUtil<ArdTubes>(ArdTubes.class); |
| | | util.exportExcel(response, list, "ç®¡çº¿ç®¡çæ°æ®"); |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | | * è·å管线管ç详ç»ä¿¡æ¯ |
| | | * æ¥è¯¢å¹¶çéæé䏿æç®¡çº¿æ°æ® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:query')") |
| | | @GetMapping(value = "/{id}") |
| | | @ApiOperation("éè¿IDè·å管线管ç详ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) |
| | | { |
| | | return success(ardTubesService.selectArdTubesById(id)); |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç®¡çº¿ç®¡ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:add')") |
| | | @Log(title = "管线管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @ApiOperation("æ°å¢ç®¡çº¿ç®¡ç") |
| | | public AjaxResult add(@RequestBody ArdTubes ardTubes) |
| | | { |
| | | return toAjax(ardTubesService.insertArdTubes(ardTubes)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡çº¿ç®¡ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:edit')") |
| | | @Log(title = "管线管ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @ApiOperation("ä¿®æ¹ç®¡çº¿ç®¡ç") |
| | | public AjaxResult edit(@RequestBody ArdTubes ardTubes) |
| | | { |
| | | return toAjax(ardTubesService.updateArdTubes(ardTubes)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç®¡çº¿ç®¡ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('alarmpoints:tubes:remove')") |
| | | @Log(title = "管线管ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation("å é¤ç®¡çº¿ç®¡ç") |
| | | public AjaxResult remove(@PathVariable String[] ids) |
| | | { |
| | | return toAjax(ardTubesService.deleteArdTubesByIds(ids)); |
| | | } |
| | | } |