|
@@ -1,12 +1,18 @@
|
|
|
package com.doc.web.controller.system;
|
|
package com.doc.web.controller.system;
|
|
|
|
|
|
|
|
|
|
+import com.doc.biz.domain.DocSpace;
|
|
|
|
|
+import com.doc.biz.service.IDocSpaceService;
|
|
|
import com.doc.common.annotation.Log;
|
|
import com.doc.common.annotation.Log;
|
|
|
import com.doc.common.constant.UserConstants;
|
|
import com.doc.common.constant.UserConstants;
|
|
|
import com.doc.common.core.controller.BaseController;
|
|
import com.doc.common.core.controller.BaseController;
|
|
|
import com.doc.common.core.domain.AjaxResult;
|
|
import com.doc.common.core.domain.AjaxResult;
|
|
|
import com.doc.common.core.domain.entity.SysDept;
|
|
import com.doc.common.core.domain.entity.SysDept;
|
|
|
|
|
+import com.doc.common.core.domain.entity.SysUser;
|
|
|
import com.doc.common.enums.BusinessType;
|
|
import com.doc.common.enums.BusinessType;
|
|
|
|
|
+import com.doc.common.enums.SpaceType;
|
|
|
|
|
+import com.doc.common.utils.SecurityUtils;
|
|
|
import com.doc.common.utils.StringUtils;
|
|
import com.doc.common.utils.StringUtils;
|
|
|
|
|
+import com.doc.system.service.ISysConfigService;
|
|
|
import com.doc.system.service.ISysDeptService;
|
|
import com.doc.system.service.ISysDeptService;
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -14,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -26,6 +33,10 @@ import java.util.List;
|
|
|
public class SysDeptController extends BaseController {
|
|
public class SysDeptController extends BaseController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private ISysDeptService deptService;
|
|
private ISysDeptService deptService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IDocSpaceService docSpaceService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取部门列表
|
|
* 获取部门列表
|
|
@@ -69,7 +80,9 @@ public class SysDeptController extends BaseController {
|
|
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
|
|
}
|
|
}
|
|
|
dept.setCreateBy(getUsername());
|
|
dept.setCreateBy(getUsername());
|
|
|
- return toAjax(deptService.insertDept(dept));
|
|
|
|
|
|
|
+ int i = deptService.insertDept(dept);
|
|
|
|
|
+ docSpaceService.initDeptSpace(dept);
|
|
|
|
|
+ return toAjax(i);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -88,6 +101,9 @@ public class SysDeptController extends BaseController {
|
|
|
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
|
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
|
|
return error("该部门包含未停用的子部门!");
|
|
return error("该部门包含未停用的子部门!");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ docSpaceService.initDeptSpace(dept);
|
|
|
|
|
+
|
|
|
dept.setUpdateBy(getUsername());
|
|
dept.setUpdateBy(getUsername());
|
|
|
return toAjax(deptService.updateDept(dept));
|
|
return toAjax(deptService.updateDept(dept));
|
|
|
}
|
|
}
|