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);
|
}
|
|
}
|