zss
2024-12-20 69c6770472178e64975806f8344c2e0260427c6e
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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.dto.ProcessMethodVerifyDto;
import com.yuanchu.mom.pojo.ProcessMethodVerify;
import com.yuanchu.mom.pojo.ProcessMethodVerifyMethodFile;
import com.yuanchu.mom.service.ProcessMethodVerifyMethodFileService;
import com.yuanchu.mom.service.ProcessMethodVerifyService;
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 org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
 
 
/**
 * 标准方法验证
 *
 * @author zhuo
 * @since 2024-11-05
 */
@RestController
@RequestMapping("/processMethodVerify")
@Api(tags = "标准方法验证")
@AllArgsConstructor
public class ProcessMethodVerifyController {
 
 
    private ProcessMethodVerifyService ProcessMethodVerifyService;
 
    private ProcessMethodVerifyMethodFileService processMethodVerifyMethodFileService;
 
 
 
    /**
     * 标准查新列表
     * @param data
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "标准方法更新验证列表")
    @PostMapping("/pagesMethodVerify")
    public Result<IPage<ProcessMethodVerify>> pagesMethodVerify(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        ProcessMethodVerifyDto methodVerifyDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), ProcessMethodVerifyDto.class);
        return Result.success(ProcessMethodVerifyService.pagesMethodVerify(page, methodVerifyDto));
    }
 
    /**
     * 新增标准方法验证
     * @param methodVerifyDto
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "新增标准方法验证")
    @PostMapping("/addMethodVerify")
    public Result addMethodVerify(@RequestBody ProcessMethodVerifyDto methodVerifyDto ) {
        return Result.success(ProcessMethodVerifyService.addMethodSearchNew(methodVerifyDto));
    }
 
    /**
     * 查询标准方法验证详情
     * @param methodVerifyId
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "查询标准方法验证详情")
    @GetMapping("/getMethodVerifyOne")
    public Result<ProcessMethodVerifyDto> getMethodVerifyOne(Integer methodVerifyId) {
        return Result.success(ProcessMethodVerifyService.getMethodVerifyOne(methodVerifyId));
    }
 
 
    /**
     * 修改标准方法验证
     * @param methodVerifyDto
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "修改标准方法验证")
    @PostMapping("/updateMethodVerify")
    public Result updateMethodVerify(@RequestBody ProcessMethodVerifyDto methodVerifyDto ) {
        return Result.success(ProcessMethodVerifyService.updateMethodVerify(methodVerifyDto));
    }
 
    /**
     * 删除标准方法更新验证
     * @param methodVerifyId
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "删除标准方法更新验证")
    @GetMapping("/delMethodVerify")
    public Result delMethodVerify(Integer methodVerifyId){
        return Result.success(ProcessMethodVerifyService.delMethodVerify(methodVerifyId));
    }
 
    /**
     * 导出标准方法更新验证
     * @param methodVerifyId 标准方法验证id
     */
    @ValueAuth
    @ApiOperation(value = "导出标准方法更新验证")
    @GetMapping("/exportMethodVerify")
    public void exportMethodVerify(Integer methodVerifyId, HttpServletResponse response){
        ProcessMethodVerifyService.exportMethodVerify(methodVerifyId, response);
    }
 
    /**
     * 验证确认
     * @param methodVerifyId
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "验证确认")
    @GetMapping("/methodVerifyAffirm")
    public Result methodVerifyAffirm(Integer methodVerifyId) {
        return Result.success(ProcessMethodVerifyService.methodVerifyAffirm(methodVerifyId));
    }
 
    /**
     * 方法验证新增原始记录
     * @param methodVerifyId
     * @param file
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "方法验证新增原始记录")
    @PostMapping("/uploadVerifyMethodFile")
    public Result<?> uploadVerifyMethodFile(Integer methodVerifyId, MultipartFile file) {
        return Result.success(ProcessMethodVerifyService.uploadVerifyMethodFile(methodVerifyId, file));
    }
 
 
    /**
     * 标准方法更新验证原始记录列表
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "标准方法更新验证原始记录列表")
    @GetMapping("/getVerifyMethodFileList")
    public Result<List<ProcessMethodVerifyMethodFile>> getVerifyMethodFileList(Integer methodVerifyId){
        return Result.success(ProcessMethodVerifyService.getVerifyMethodFileList(methodVerifyId));
    }
 
    /**
     * 标准方法删除验证原始记录列表
     * @return
     */
    @ValueAuth
    @ApiOperation(value = "标准方法删除验证原始记录列表")
    @GetMapping("/delVerifyMethodFileList")
    public Result delVerifyMethodFileList(Integer methodFileId){
        return Result.success(processMethodVerifyMethodFileService.removeById(methodFileId));
    }
 
 
}