|  |  |  | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.annotation.trace.Trace; | 
|---|
|  |  |  | import com.doumee.core.constants.OperaType; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.QuerySystemUserDTO; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemDepartment; | 
|---|
|  |  |  | import com.doumee.dao.system.vo.SystemDepartmentListVO; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("system:department:create") | 
|---|
|  |  |  | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemDepartment systemDepartment) { | 
|---|
|  |  |  | systemDepartment.setCreateUser(getLoginUser().getId()); | 
|---|
|  |  |  | systemDepartment.setUpdateUser(getLoginUser().getId()); | 
|---|
|  |  |  | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemDepartment systemDepartment, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | systemDepartment.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemDepartment.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | return ApiResponse.success(systemDepartmentBiz.create(systemDepartment)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("修改") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("system:department:update") | 
|---|
|  |  |  | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemDepartment systemDepartment) { | 
|---|
|  |  |  | systemDepartment.setCreateUser(getLoginUser().getId()); | 
|---|
|  |  |  | systemDepartment.setUpdateUser(getLoginUser().getId()); | 
|---|
|  |  |  | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemDepartment systemDepartment, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | systemDepartment.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemDepartment.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemDepartmentBiz.updateById(systemDepartment); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|