zss
2025-01-13 8d85246f061e3da623c7b9eb4e323ee724b4de0b
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
package com.yuanchu.mom.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.dto.DeviceInspectionRecordDto;
import com.yuanchu.mom.pojo.DeviceInspectionRecord;
import com.yuanchu.mom.service.DeviceInspectionRecordService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
 
/**
 * <p>
 *  设备点检记录表
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2024-12-16 04:25:14
 */
@Api(tags = "设备点检记录")
@RestController
@RequestMapping("/deviceInspectionRecord")
public class DeviceInspectionRecordController {
    @Resource
    private DeviceInspectionRecordService deviceInspectionRecordService;
 
    /**
     * 分页查询设备点检记录
     * @param data 分页参数
     */
    @ApiOperation("分页查询设备点检记录")
    @PostMapping("/getDeviceInspectionRecordByPage")
    @SneakyThrows
    public Result<IPage<DeviceInspectionRecord>> getDeviceInspectionRecordByPage(@RequestBody Map<String, Object> data) {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        DeviceInspectionRecordDto itemParameter = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), DeviceInspectionRecordDto.class);
        return deviceInspectionRecordService.getDeviceInspectionRecordByPage(page, itemParameter);
    }
 
    /**
     * 查询点检详情
     */
    @ApiOperation("查询点检详情")
    @GetMapping("/getDeviceInspectionRecord")
    public Result getDeviceInspectionRecord(Integer inspectionRecordId) {
        return deviceInspectionRecordService.getDeviceInspectionRecord(inspectionRecordId);
    }
 
    /**
     * 新增设备点检记录
     * @param deviceInspectionRecord  设备点检记录
     */
    @ApiOperation("新增设备点检记录")
    @PostMapping("/addDeviceInspectionRecord")
    public Result addDeviceInspectionRecord(@RequestBody DeviceInspectionRecordDto deviceInspectionRecord) {
        return deviceInspectionRecordService.addDeviceInspectionRecord(deviceInspectionRecord);
    }
 
    /**
     * 修改设备点检记录
     */
    @ApiOperation("修改设备点检记录")
    @PostMapping("/updateDeviceInspectionRecord")
    public Result updateDeviceInspectionRecord(@RequestBody DeviceInspectionRecordDto deviceInspectionRecord) {
        return deviceInspectionRecordService.updateInspectionRecordAndDetails(deviceInspectionRecord);
    }
 
    /**
     * 删除设备点检记录
     */
    @ApiOperation("删除设备点检记录")
    @GetMapping("/deleteDeviceInspectionRecord")
    public Result deleteDeviceInspectionRecord(DeviceInspectionRecordDto deviceInspectionRecord) {
        return deviceInspectionRecordService.deleteDeviceInspectionRecordOrDetails(deviceInspectionRecord);
    }
 
 
    /**
     * 复核点检记录
     * @return
     */
    @ApiOperation(value = "复核核查记录")
    @PostMapping("/reviewDeviceInspectionRecord")
    public Result reviewDeviceInspectionRecord(@RequestBody DeviceInspectionRecordDto deviceExamineRecordDto){
        return deviceInspectionRecordService.reviewDeviceInspectionRecord(deviceExamineRecordDto);
    }
 
 
    /**
     * 导出设备点检记录
     */
    @ApiOperation("导出设备点检记录")
    @GetMapping("/exportDeviceInspectionRecord")
    public Result exportDeviceInspectionRecord(@RequestParam("inspectionRecordId") Integer inspectionRecordId, HttpServletResponse response) {
        return deviceInspectionRecordService.exportDeviceInspectionRecord(inspectionRecordId, response);
    }
}