zss
6 天以前 51ec98113c6d49d0f7eec4e3c030e55e337e97db
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
package com.yuanchu.mom.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.CustomClazzName;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.pojo.ManageRecordCancel;
import com.yuanchu.mom.pojo.ManageRecordIssueRecycle;
import com.yuanchu.mom.service.ManageRecordCancelService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.Map;
 
/**
 * <p>
 * 作废文件销魂记录 前端控制器
 * </p>
 *
 * @author
 * @since 2024-11-13 01:27:22
 */
@RestController
@RequestMapping("/manageRecordCancel")
 
public class ManageRecordCancelController {
 
    @Resource
    private ManageRecordCancelService manageRecordCancelService;
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "分页查询作废文件销毁记录")
    @PostMapping("/pageManageRecordCancel")
    public Result pageManageRecordCancel(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        ManageRecordCancel manageRecordCancel = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), ManageRecordCancel.class);
        return Result.success(manageRecordCancelService.pageManageRecordCancel(page, manageRecordCancel));
    }
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "新增作废文件销毁记录")
    @PostMapping("/addManageRecordCancel")
    public Result addManageRecordCancel(@RequestBody ManageRecordCancel manageRecordCancel){
        manageRecordCancel.setCreateTime(LocalDate.now());
        return Result.success(manageRecordCancelService.save(manageRecordCancel));
    }
 
    @ValueAuth
    @ApiOperation(value = "编辑作废文件销毁记录")
    @PostMapping("/doManageRecordCancel")
    public Result doManageRecordCancel(@RequestBody ManageRecordCancel manageRecordCancel){
        return Result.success(manageRecordCancelService.updateById(manageRecordCancel));
    }
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "删除作废文件销毁记录")
    @PostMapping("/delManageRecordCancel")
    public Result delManageRecordCancel(Integer id){
        return Result.success(manageRecordCancelService.removeById(id));
    }
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "批准作废文件销毁记录")
    @PostMapping("/ratifyManageRecordCancel")
    public Result ratifyManageRecordCancel(Integer id,String ratifyState){
        return Result.success(manageRecordCancelService.ratifyManageRecordCancel(id,ratifyState));
    }
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "导出作废文件销毁记录")
    @PostMapping("/exportOutManageRecordCancel")
    public Result exportOutManageRecordCancel(@RequestBody Map<String, Object> data, HttpServletResponse response) throws Exception {
        ManageRecordCancel manageRecordCancel = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), ManageRecordCancel.class);
        return Result.success(manageRecordCancelService.exportOutManageRecordCancel(manageRecordCancel,response));
    }
 
    @ValueClassify(value = "记录的控制")
    @ApiOperation(value = "导入作废文件销毁记录")
    @PostMapping("/exportInManageRecordCancel")
    public Result exportInManageRecordCancel(MultipartFile file){
        return Result.success(manageRecordCancelService.exportInManageRecordCancel(file));
    }
 
 
 
}