|
@@ -4,7 +4,10 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.archive.entity.ArchiveInspection;
|
|
|
+import org.springblade.archive.service.IArchiveInspectionService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -14,6 +17,50 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@Api(value = "档案检查信息", tags = "档案检查信息")
|
|
|
public class ArchiveInspectionController extends BladeController {
|
|
|
|
|
|
+ private IArchiveInspectionService archiveInspectionService;
|
|
|
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "获取档案检查详情", notes = "传入archiveInspection")
|
|
|
+ public R<ArchiveInspection> getArchiveInspectionDetail(@RequestParam Long id) {
|
|
|
+ ArchiveInspection archiveInspection = archiveInspectionService.getById(id);
|
|
|
+ return R.data(archiveInspection);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/add")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "新增档案检查", notes = "传入archiveInspection")
|
|
|
+ public R addArchiveInspection(@RequestBody ArchiveInspection archiveInspection) {
|
|
|
+ boolean success = archiveInspectionService.save(archiveInspection);
|
|
|
+ return success ? R.success("新增成功") : R.fail("新增失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "删除档案检查", notes = "传入id")
|
|
|
+ public R deleteArchiveInspection(@RequestParam Long id) {
|
|
|
+ boolean success = archiveInspectionService.removeById(id);
|
|
|
+ return success ? R.success("删除成功") : R.fail("删除失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/submit")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "修改档案检查", notes = "传入archiveInspection")
|
|
|
+ public R submit(@RequestBody ArchiveInspection archiveInspection) {
|
|
|
+ return R.status(archiveInspectionService.saveOrUpdate(archiveInspection));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/opinion")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "获取抽检意见", notes = "传入fileId和userId")
|
|
|
+ public R<String> getOpinion(@RequestParam Long fileId) {
|
|
|
+ Long userId = AuthUtil.getUserId();
|
|
|
+ ArchiveInspection archiveInspection = archiveInspectionService.getbyFileId(fileId, userId);
|
|
|
+ String opinion = "";
|
|
|
+ if (archiveInspection != null) {
|
|
|
+ opinion = archiveInspection.getOpinion();
|
|
|
+ }
|
|
|
+ return R.data(opinion);
|
|
|
+ }
|
|
|
|
|
|
}
|