zss
2024-12-20 c9e36e23b3f95f6027d78483dfc23021d1ec6261
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
124
125
126
package com.yuanchu.mom.controller;
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.pojo.InternalReport;
import com.yuanchu.mom.service.InternalReportService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
 
 
/**
 * 内审报告表
 *
 * @author makejava
 * @since 2024-11-11
 */
@Api(tags = "内审报告")
@AllArgsConstructor
@RestController
@RequestMapping("/internalReport")
public class InternalReportController {
 
    private InternalReportService internalReportService;
 
    /**
     * 内审报告分页查询
     * @param data
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "内审报告分页查询")
    @PostMapping("/pageInternalReport")
    public Result<IPage<InternalReport>> pageInternalReport(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        InternalReport internalReport = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InternalReport.class);
        return Result.success(internalReportService.pageInternalReport(page, internalReport));
    }
 
    /**
     * 内审报告新增
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "内审报告新增")
    @PostMapping("/addInternalReport")
    public Result addInternalReport(@RequestBody InternalReport internalReport){
        return Result.success(internalReportService.save(internalReport));
    }
 
    /**
     * 内审报告修改
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "内审报告修改")
    @PostMapping("/updateInternalReport")
    public Result updateInternalReport(@RequestBody InternalReport internalReport){
        return Result.success(internalReportService.updateById(internalReport));
    }
 
    /**
     * 内审报告删除
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "内审报告删除")
    @GetMapping("/delInternalReport")
    public Result delInternalReport(Integer reportId){
        return Result.success(internalReportService.removeById(reportId));
    }
 
    /**
     * 内审报告查看详情
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "内审报告查看详情")
    @GetMapping("/getInternalReportOne")
    public Result<InternalReport> getInternalReportOne(Integer reportId){
        return Result.success(internalReportService.getById(reportId));
    }
 
    /**
     * 内审检查审核
     * @return
     */
    @ValueClassify("内审报告")
    @ApiOperation(value = "内审检查审核")
    @PostMapping("/examineInternalReport")
    public Result examineInternalReport(@RequestBody InternalReport internalReport){
        return Result.success(internalReportService.ratifyInternalCheck(internalReport));
    }
 
    /**
     * 内审报告质量负责人填写
     * @return
     */
    @ValueClassify("内审报告")
    @ApiOperation(value = "内审报告质量负责人填写")
    @PostMapping("/qualityInternalReport")
    public Result qualityInternalReport(@RequestBody InternalReport internalReport){
        return Result.success(internalReportService.qualityInternalReport(internalReport));
    }
 
    /**
     * 导出内审报告
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "导出内审报告")
    @GetMapping("/exportInternalReport")
    public void exportInternalReport(Integer reportId, HttpServletResponse response){
        internalReportService.exportInternalReport(reportId, response);
    }
 
}