|
@@ -16,7 +16,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -58,24 +60,30 @@ public class DepartmentController {
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation("获取部门分页")
|
|
|
- @GetMapping("/biz/department/page")
|
|
|
+ @GetMapping("/base/department/page")
|
|
|
public CommonResult<Page<Department>> page(DepartmentPageParam departmentPageParam) {
|
|
|
return CommonResult.data(departmentService.page(departmentPageParam));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加部门
|
|
|
- *
|
|
|
* @author newspaper
|
|
|
* @date 2023/12/13 08:44
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation("添加部门")
|
|
|
@CommonLog("添加部门")
|
|
|
- @PostMapping("/biz/department/add")
|
|
|
- public CommonResult<String> add(@RequestPart @Valid DepartmentAddParam departmentAddParam,
|
|
|
- @RequestPart(required = false) MultipartFile departmentImgUrl) {
|
|
|
- departmentService.add(departmentAddParam,departmentImgUrl);
|
|
|
+ @PostMapping("/base/department/add")
|
|
|
+ public CommonResult<String> add(@RequestParam @ApiParam(value = "部门名称") String departmentName,
|
|
|
+ @RequestParam @ApiParam(value = "上级部门ID") String parentId,
|
|
|
+ @RequestParam @ApiParam(value = "所在区域") String departmentRegion,
|
|
|
+ @RequestParam @ApiParam(value = "详细地址") String detailLocation,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "部门电话") String departmentPhone,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "部门负责人") String departmentManager,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "描述") String remarks,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "排序码") Integer sortCode,
|
|
|
+ @RequestParam(value = "departmentImgUrl", required = false) @ApiParam(value = "部门图片") MultipartFile departmentImgUrl) {
|
|
|
+ departmentService.add(departmentName,parentId,departmentRegion,detailLocation,departmentPhone,departmentManager,remarks,sortCode,departmentImgUrl);
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
@@ -88,10 +96,18 @@ public class DepartmentController {
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation("编辑部门")
|
|
|
@CommonLog("编辑部门")
|
|
|
- @PostMapping("/biz/department/edit")
|
|
|
- public CommonResult<String> edit(@RequestPart @Valid DepartmentEditParam departmentEditParam,
|
|
|
- @RequestPart(required = false) MultipartFile departmentImgUrl) {
|
|
|
- departmentService.edit(departmentEditParam,departmentImgUrl);
|
|
|
+ @PostMapping("/base/department/edit")
|
|
|
+ public CommonResult<String> edit(@RequestParam @ApiParam(value = "部门ID") String id,
|
|
|
+ @RequestParam @ApiParam(value = "部门名称") String departmentName,
|
|
|
+ @RequestParam @ApiParam(value = "上级部门ID") String parentId,
|
|
|
+ @RequestParam @ApiParam(value = "所在区域") String departmentRegion,
|
|
|
+ @RequestParam @ApiParam(value = "详细地址") String detailLocation,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "部门电话") String departmentPhone,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "部门负责人") String departmentManager,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "描述") String remarks,
|
|
|
+ @RequestParam(required = false) @ApiParam(value = "排序码") Integer sortCode,
|
|
|
+ @RequestParam(value = "departmentImgUrl", required = false) @ApiParam(value = "部门图片") MultipartFile departmentImgUrl) {
|
|
|
+ departmentService.edit(id,departmentName,parentId,departmentRegion,detailLocation,departmentPhone,departmentManager,remarks,sortCode,departmentImgUrl);
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
@@ -104,7 +120,7 @@ public class DepartmentController {
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation("删除部门")
|
|
|
@CommonLog("删除部门")
|
|
|
- @PostMapping("/biz/department/delete")
|
|
|
+ @PostMapping("/base/department/delete")
|
|
|
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
|
|
|
CommonValidList<DepartmentIdParam> departmentIdParamList) {
|
|
|
departmentService.delete(departmentIdParamList);
|
|
@@ -119,7 +135,7 @@ public class DepartmentController {
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation("获取部门详情")
|
|
|
- @GetMapping("/biz/department/detail")
|
|
|
+ @GetMapping("/base/department/detail")
|
|
|
public CommonResult<Department> detail(@Valid DepartmentIdParam departmentIdParam) {
|
|
|
return CommonResult.data(departmentService.detail(departmentIdParam));
|
|
|
}
|
|
@@ -132,7 +148,7 @@ public class DepartmentController {
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation("获取所有部门")
|
|
|
- @GetMapping("/biz/department/departmentSelector")
|
|
|
+ @GetMapping("/base/department/departmentSelector")
|
|
|
public CommonResult<List<Department>> departmentSelector() {
|
|
|
return CommonResult.data(departmentService.departmentSelector());
|
|
|
}
|