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));
|
}
|
|
|
}
|