zss
2023-08-30 af9457d7ce94c7684a9439d46b0025bd6e66d8af
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
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;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @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<Map<String, Object>> maps = measureLedgerService.selectMeasureLedger(new Page<Object>(pageNo, pageSize), code, deviceName, meteringUnit);
        Map<String, Object> map = new HashMap<>();
        map.put("row", maps.getRecords());
        map.put("total", maps.getTotal());
        return Result.success(map);
    }
}