zhaowenxuan
2 天以前 dedacd79c93f8ef95e0cb986f5e7fbd27ddbd907
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjDwDeptController.java
@@ -55,7 +55,7 @@
    /**
     * 导出体检单位部门列表
     */
    @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) {
@@ -89,6 +89,9 @@
    @PostMapping
    @ApiOperation(value = "新增单位部门信息")
    public AjaxResult add(@RequestBody TjDwDept tjDwDept) {
        if(null==tjDwDept.getDwDeptName()){
            return AjaxResult.error("部门名称不能为空!");
        }
        return toAjax(dwDeptService.save(tjDwDept));
    }
@@ -100,6 +103,9 @@
    @PutMapping
    @ApiOperation(value = "修改单位部门信息")
    public AjaxResult edit(@RequestBody TjDwDept tjDwDept) {
        if(null==tjDwDept.getDwDeptName()){
            return AjaxResult.error("部门名称不能为空!");
        }
        return toAjax(dwDeptService.updateById(tjDwDept));
    }
@@ -111,6 +117,9 @@
    @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)));
    }