package com.yuanchu.mom.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yuanchu.mom.service.MeasureLedgerService; import com.yuanchu.mom.vo.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; /** *

* 前端控制器 *

* * @author 江苏鵷雏网络科技有限公司 * @since 2023-08-16 11:41:09 */ @Api(tags = "QMS管理-->计量管理") @RestController @RequestMapping("/measureLedger") public class MeasureLedgerController { @Autowired private MeasureLedgerService measureLedgerService; @ApiOperation(value = "计量预测-->分页表格") @ApiImplicitParams(value = { @ApiImplicitParam(name = "pageNo", value = "条数/页", dataTypeClass = Integer.class, required = true), @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true), @ApiImplicitParam(name = "code", value = "计量编号", dataTypeClass = String.class), @ApiImplicitParam(name = "deviceName", value = "仪器设备名称", dataTypeClass = String.class), @ApiImplicitParam(name = "meteringUnit", value = "计量单位", dataTypeClass = String.class) }) @GetMapping("/metering_table") public Result selectMeasureLedger(Integer pageNo, Integer pageSize, String code, String deviceName, String meteringUnit){ IPage> maps = measureLedgerService.selectMeasureLedger(new Page(pageNo, pageSize), code, deviceName, meteringUnit); Map map = new HashMap<>(); map.put("row", maps.getRecords()); map.put("total", maps.getTotal()); return Result.success(map); } }