DgArchivesController.java
4.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.pashanhoo.archive.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pashanhoo.archive.entity.vo.*;
import com.pashanhoo.archive.service.DgArchivesService;
import com.pashanhoo.catalog.entity.vo.DgArchivesCatalogListVO;
import com.pashanhoo.catalog.entity.vo.UpdateDgArchivesCatalogRequest;
import com.pashanhoo.common.Result;
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/dgArchives/")
@Api(tags = "案卷基本信息接口")
public class DgArchivesController {
@Autowired
private DgArchivesService dgarchivesService;
@PostMapping("insertDgArchives")
@ApiOperation("新增案卷基本信息")
public Result insertDgArchives(@RequestBody AddDgArchivesRequest request) {
if (dgarchivesService.insertDgArchives(request)) {
return Result.ok();
}
return Result.error("新增失败");
}
@DeleteMapping("deleteDgArchivesByIds")
@ApiOperation(value = "批量删除案卷基本信息")
public Result deleteDgArchivesByIds(@ApiParam("案卷基本信息ID列表") @RequestParam(value = "idList") List<String> idList) {
if (dgarchivesService.removeByIds(idList)) {
return Result.ok("删除成功");
}
return Result.error("删除失败");
}
@PutMapping("updateDgArchives")
@ApiOperation("修改案卷基本信息,业务信息,不动产信息")
public Result updateDgArchives(@RequestBody UpdateArchiveAndOtherInfoRequest request) {
if (dgarchivesService.updateDgArchivesReplenish(request)) {
return Result.ok("修改成功");
}
return Result.error("修改失败");
}
@GetMapping("getDgArchivesDetailById")
@ApiOperation(value = "案卷基本信息")
public Result getDgArchivesDetailById(@ApiParam("案卷标识码") @RequestParam String bsmArchive) {
return Result.ok(dgarchivesService.getDgArchivesDetailById(bsmArchive));
}
@PostMapping("searchArchives")
@ApiOperation(value = "档案查找")
public Result<IPage<SearchArchiveVO>> searchArchives(@RequestBody SearchArchiveRequest request) {
return Result.ok(dgarchivesService.searchArchive(request));
}
@GetMapping("searchArchivesCover")
@ApiOperation(value = "案卷封皮信息查找")
public Result<ArchiveDetailAndCoverVO> searchArchivesCover(@ApiParam("档案标识码") @RequestParam String bsmArchive) {
return Result.ok(dgarchivesService.searchArchivesCover(bsmArchive));
}
/**
* 通过案卷标识码加载左菜单目录
*
* @param bsmArchives 案卷标识码
* @return
*/
@GetMapping("getLifeMenu")
@ApiOperation(value = "通过案卷标识码加载左菜单目录")
public Result getArchiveLiftMenu(@ApiParam("案卷标识码") @RequestParam String bsmArchives) {
return Result.ok(dgarchivesService.getArchiveLiftMenu(bsmArchives));
}
/**
* 目录修改保存
* 1.比对新增的记录数据库是否存在,如果不存在则新增
* 2.比对数据库的数据是否存在前端传递的集合中,不存在则删除,并且删除对应的电子附件数据
* 3.如果目录记录标识码与数据库一致,直接更新当前的记录
*
* @param requests
* @return
*/
@PostMapping("saveCatalogs")
@ApiOperation(value = "目录修改保存")
public Result saveCatalogs(@RequestBody List<UpdateDgArchivesCatalogRequest> requests) {
if (dgarchivesService.updateCatalog(requests)) {
return Result.ok("修改成功");
}
return Result.error("修改失败");
}
/**
* 档案目录查找
*
* @param bsmArchive
* @return
*/
@GetMapping("searchCatalog")
@ApiOperation(value = "查询档案目录")
public Result<List<DgArchivesCatalogListVO>> searchCatalog(@RequestParam String bsmArchive) {
return Result.ok(dgarchivesService.searchCatalog(bsmArchive));
}
}