| | |
| | | /** |
| | | * 导出体检单位部门列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:dept:export')") |
| | | // @PreAuthorize("@ss.hasPermi('hosp:dept:export')") |
| | | @Log(title = "体检单位部门", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, TjDwDept tjDwDept) { |
| | |
| | | @PostMapping |
| | | @ApiOperation(value = "新增单位部门信息") |
| | | public AjaxResult add(@RequestBody TjDwDept tjDwDept) { |
| | | if(null==tjDwDept.getDwDeptName()){ |
| | | return AjaxResult.error("部门名称不能为空!"); |
| | | } |
| | | return toAjax(dwDeptService.save(tjDwDept)); |
| | | } |
| | | |
| | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改单位部门信息") |
| | | public AjaxResult edit(@RequestBody TjDwDept tjDwDept) { |
| | | if(null==tjDwDept.getDwDeptName()){ |
| | | return AjaxResult.error("部门名称不能为空!"); |
| | | } |
| | | return toAjax(dwDeptService.updateById(tjDwDept)); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation(value = "删除单位部门信息") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | if (!dwGroupingService.list(new LambdaQueryWrapper<TjDwGrouping>().in(TjDwGrouping::getDwDeptId,Arrays.asList(ids))).isEmpty()){ |
| | | return AjaxResult.error("该部门下有分组信息,请先删除分组信息!"); |
| | | } |
| | | return toAjax(dwDeptService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |