邱宇豪
2023-09-25 d4ca39e076e00a768ad947f2c85b7185443c02e7
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
package com.thhy.materials.modules.biz.embedment.controller;
 
import com.thhy.general.common.BasicResult;
import com.thhy.materials.modules.biz.concret.entity.SysSteelRecord;
import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto;
import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity;
import com.thhy.materials.modules.biz.embedment.service.SysEmbedmentRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
/**
 * @Author QiuYuHao
 * @CreateDate 2023-09-22 15:39:54
 * 入库记录控制层
 */
@RestController
@RequestMapping(value = "embedmentInsetRecord")
public class SysInsetRecordsController {
 
    @Autowired
    private SysEmbedmentRecordService sysEmbedmentRecordService;
 
    /**
     * 新增记录
     * @param sysEmbedmentRecordEntity
     * @return
     */
    @PostMapping(value = "insert")
    public BasicResult insert (@RequestBody SysEmbedmentRecordEntity sysEmbedmentRecordEntity){
        return sysEmbedmentRecordService.insert(sysEmbedmentRecordEntity);
    }
 
    /**
     * 记录删除
     * @param id
     * @return
     */
    @GetMapping(value = "embedmentRecordDel")
    public BasicResult embedmentRecordDel (@RequestParam String id){
        return sysEmbedmentRecordService.embedmentRecordDel(id);
    }
 
    /**
     * 记录修改
     * @param sysEmbedmentRecordEntity
     * @return
     */
    @PostMapping(value = "update")
    BasicResult update(@RequestBody SysEmbedmentRecordEntity sysEmbedmentRecordEntity){
        return sysEmbedmentRecordService.update(sysEmbedmentRecordEntity);
    }
 
    /**
     * 入库记录查询
     * @param embedmentRecordDto
     * @return
     */
    @PostMapping(value = "embedmentRecordList")
    BasicResult embedmentRecordList(@RequestBody EmbedmentRecordDto embedmentRecordDto){
        return sysEmbedmentRecordService.embedmentRecordList(embedmentRecordDto);
    }
 
    /**
     * 出库记录查询
     * @param embedmentRecordDto
     * @return
     */
    @PostMapping(value = "embedmentRecordOutList")
    BasicResult embedmentRecordOutList(@RequestBody EmbedmentRecordDto embedmentRecordDto){
        return sysEmbedmentRecordService.embedmentRecordOutList(embedmentRecordDto);
    }
 
    /**
     * 出入库详情查询
     * @param id
     * @return
     */
    @GetMapping(value = "embedmentRecordInfo")
    public BasicResult embedmentRecordInfo (@RequestParam String id){
        return sysEmbedmentRecordService.embedmentRecordInfo(id);
    }
 
    /**
     * 导出
     * @param embedmentRecordDto
     * @param response
     */
    @PostMapping(value = "export")
    void export(@RequestBody EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response){
        this.sysEmbedmentRecordService.export(embedmentRecordDto,response);
    }
 
    /**
     * 导出模板
     * @param embedmentRecordDto
     * @param response
     */
    @PostMapping(value = "recordExportTemplate")
    void recordExportTemplate(@RequestBody EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response){
        this.sysEmbedmentRecordService.recordExportTemplate(embedmentRecordDto,response);
    }
 
    /**
     * 导入
     * @param file
     * @param request
     */
    @PostMapping(value = "variateExcel")
    void variateExcel(@RequestParam MultipartFile file, HttpServletRequest request){
        this.sysEmbedmentRecordService.variateExcel(file,request);
    }
}