yaowanxin
2025-08-11 1b5604f8a88000e2f51d4c989fd179989468ee67
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
package com.ruoyi.measuringinstrumentledger.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord;
import com.ruoyi.measuringinstrumentledger.service.MeasuringInstrumentLedgerRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
 
/**
 * @author :yys
 * @date : 2025/8/5 9:28
 */
@RestController
@Api(tags = "计量器具台账记录")
@RequestMapping("/measuringInstrumentLedgerRecord")
public class MeasuringInstrumentLedgerRecordController extends BaseController {
 
    @Autowired
    private MeasuringInstrumentLedgerRecordService measuringInstrumentLedgerRecordService;
 
 
    @GetMapping("/listPage")
    @ApiOperation("计量器具台账记录-分页查询")
    @Log(title = "计量器具台账记录-分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPage(Page page, MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord){
        IPage<MeasuringInstrumentLedgerRecord> listPage = measuringInstrumentLedgerRecordService.listPage(page, measuringInstrumentLedgerRecord);
        return AjaxResult.success(listPage);
    }
 
    @PostMapping("/update")
    @ApiOperation("计量器具台账记录-修改")
    @Log(title = "计量器具台账记录-修改", businessType = BusinessType.UPDATE)
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult update(@RequestBody MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord) throws IOException {
        boolean update = measuringInstrumentLedgerRecordService.updateMeasuringInstrumentLedgerRecord(measuringInstrumentLedgerRecord);
        if (update) {
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
 
    /**
     * 导出计量器具台账
     */
    @ApiOperation("计量器具台账记录-导出")
    @Log(title = "计量器具台账记录-导出", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response) {
        measuringInstrumentLedgerRecordService.export( response);
    }
 
}