DgDestructionCatalogController.java
3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.pashanhoo.destroycatalog.controller;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
import com.pashanhoo.destroycatalog.entity.vo.UpdateDgDestructionCatalogRequest;
import com.pashanhoo.destroycatalog.entity.vo.DgDestructionCatalogSearchRequest;
import com.pashanhoo.destroycatalog.service.DgDestructionCatalogService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* <p>
* 档案销毁目录 前端控制器
* </p>
*
* @author
* @since 2021-11-05
*/
@RestController
@RequestMapping("/system/dgDestructionCatalog/")
public class DgDestructionCatalogController {
@Autowired
private DgDestructionCatalogService dgdestructioncatalogService;
@PostMapping("saveBatchDestructionCatalog")
@ApiOperation("新增档案销毁目录")
public Result saveBatchDestructionCatalog(@ApiParam("档案销毁目录ID列表") @RequestParam(value = "idList") List<String> idList,@ApiParam("档案销毁信息ID") String bsm_destruction){
boolean flag=dgdestructioncatalogService.saveBatchDestructionCatalog(idList,bsm_destruction);
if(flag){
return Result.ok("批量新增目录成功");
}else{
return Result.error("批量新增目录失败");
}
}
@DeleteMapping("deleteDgDestructionCatalogByIds")
@ApiOperation(value = "批量删除档案销毁目录")
public Result deleteDgDestructionCatalogByIds(@ApiParam("档案销毁目录ID列表") @RequestParam(value = "idList") List<String> idList) {
if(dgdestructioncatalogService.removeByIds(idList)) {
return Result.ok("删除成功");
}
return Result.error("删除失败");
}
@PutMapping("updateDgDestructionCatalog")
@ApiOperation("修改档案销毁目录")
public Result updateDgDestructionCatalog(@RequestBody UpdateDgDestructionCatalogRequest request){
if(dgdestructioncatalogService.updateDgDestructionCatalog(request)) {
return Result.ok("修改成功");
}
return Result.error("修改失败");
}
@GetMapping("getDgDestructionCatalogDetailById")
@ApiOperation(value = "读取明细")
public Result getDgDestructionCatalogDetailById(@ApiParam("档案销毁目录ID") @RequestParam String id){
return Result.ok(dgdestructioncatalogService.getDgDestructionCatalogDetailById(id));
}
@PostMapping("search")
@ApiOperation(value = "根据条件进行列表查询")
public Result searchDgDestructionCatalogList(@RequestBody DgDestructionCatalogSearchRequest request) {
//TODO 默认排序条件设置
request.defaultFillPageProp("","");
return Result.ok(dgdestructioncatalogService.searchDgDestructionCatalogList(request));
}
}