gaoluyang
2025-02-24 07524804b9d927556c18ce68d32eacf04c0e9445
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
package com.ruoyi.process.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.common.utils.JackSonUtil;
import com.ruoyi.inspect.pojo.InsOrder;
import com.ruoyi.process.dto.InspectionOrderDto;
import com.ruoyi.process.pojo.InspectionOrder;
import com.ruoyi.process.service.InspectionOrderService;
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.Map;
 
/**
 * <p>
 * 检验委托单 前端控制器
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2024-12-09
 */
@Api(tags = "检验委托单")
@AllArgsConstructor
@RestController
@RequestMapping("/inspectionOrder")
public class InspectionOrderController {
 
    private InspectionOrderService inspectionOrderService;
 
    /**
     * 委托单检验分页查询
     * @return
     */
    @ApiOperation(value = "委托单检验分页查询")
    @GetMapping("/pageInspectionOrder")
    public Result<IPage<InspectionOrderDto>> pageInspectionOrder(InspectionOrder inspectionOrder,Page page) throws Exception {
        return Result.success(inspectionOrderService.pageInspectionOrder(page, inspectionOrder));
    }
 
    /**
     * 委托单检验新增
     * @return
     */
 
    @ApiOperation(value = "委托单检验新增")
    @PostMapping("/addInspectionOrder")
    public Result addInspectionOrder(@RequestBody InspectionOrderDto InspectionOrder){
        return Result.success(inspectionOrderService.addInspectionOrder(InspectionOrder));
    }
 
    /**
     * 委托单检验修改
     * @return
     */
    @ApiOperation(value = "委托单检验修改")
    @PostMapping("/updateInspectionOrder")
    public Result updateInspectionOrder(@RequestBody InspectionOrderDto InspectionOrder){
        return Result.success(inspectionOrderService.updateInspectionOrder(InspectionOrder));
    }
 
    /**
     * 委托单检验删除
     * @return
     */
    @ApiOperation(value = "委托单检验删除")
    @DeleteMapping("/delInspectionOrder")
    public Result delInspectionOrder(Integer inspectionOrderId){
        return Result.success(inspectionOrderService.delInspectionOrder(inspectionOrderId));
    }
 
    /**
     * 委托单检验查看详情
     * @return
     */
    @ApiOperation(value = "委托单检验查看详情")
    @GetMapping("/getInspectionOrderOne")
    public Result<InspectionOrderDto> getInspectionOrderOne(Integer inspectionOrderId){
        return Result.success(inspectionOrderService.getInspectionOrderOne(inspectionOrderId));
    }
 
    /**
     * 委托单检验查看详情
     * @return
     */
    @ApiOperation(value = "根据成品订单查询委托单详情")
    @GetMapping("/getInspectionOrderByInsOderId")
    public Result<InspectionOrderDto> getInspectionOrderByInsOderId(Integer insOrderId){
        return Result.success(inspectionOrderService.getInspectionOrderByInsOderId(insOrderId));
    }
 
    /**
     * 委托单查询成品订单
     * @return
     */
    @ApiOperation(value = "委托单查询成品订单")
    @PostMapping("/getInsOrderOnInspection")
    public Result<IPage<InsOrder>> getInsOrderOnInspection(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        InsOrder insOrder = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsOrder.class);
        return Result.success(inspectionOrderService.getInsOrderOnInspection(page, insOrder));
    }
 
    /**
     * 委托单成品报告上传
     * @return
     */
    @ApiOperation(value = "委托单成品报告上传")
    @PostMapping("/uploadInspectionOrderFile")
    public Result uploadInspectionOrderFile(MultipartFile file, Integer inspectionOrderId) {
        return Result.success(inspectionOrderService.uploadInspectionOrderFile(file, inspectionOrderId));
    }
 
    /**
     * 导出检验委托单
     * @return
     */
    @ApiOperation(value = "导出检验委托单")
    @GetMapping("/exportInspectionOrder")
    public void exportInspectionOrder(Integer inspectionOrderId, HttpServletResponse response){
        inspectionOrderService.exportInspectionOrder(inspectionOrderId, response);
    }
}