yangbin
2024-07-29 6d08eec100243e0be59a207d57ab4db7974e51e4
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
package org.jeecg.modules.mdc.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.mdc.entity.EquipmentSpindleStatistical;
import org.jeecg.modules.mdc.service.IEquipmentSpindleStatisticalService;
import org.jeecg.modules.mdc.vo.EquipmentSpindleStatisticalVo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
 
/**
 * @Description: 设备负载
 * @Author: lius
 * @Date: 2024-07-16
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "设备负载")
@RestController
@RequestMapping("/mdc/equipmentSpindleStatistical")
public class EquipmentSpindleStatisticalController extends JeecgController<EquipmentSpindleStatistical, IEquipmentSpindleStatisticalService> {
 
    @Resource
    private IEquipmentSpindleStatisticalService equipmentSpindleStatisticalService;
 
    /**
     * 分页列表查询
     *
     * @param equipmentSpindleStatisticalVo
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    @AutoLog(value = "设备负载-分页列表查询")
    @ApiOperation(value = "设备负载-分页列表查询", notes = "设备负载-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo,
                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                   HttpServletRequest req) {
        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String userId = user.getId();
        Page<EquipmentSpindleStatistical> page = new Page<EquipmentSpindleStatistical>(pageNo, pageSize);
        IPage<EquipmentSpindleStatistical> pageList = equipmentSpindleStatisticalService.pageList(userId, page, equipmentSpindleStatisticalVo, req);
        return Result.OK(pageList);
    }
 
    /**
     * 导出excel
     *
     * @param request
     * @param equipmentSpindleStatisticalVo
     */
    @AutoLog(value = "设备负载-导出")
    @ApiOperation(value = "设备负载-导出", notes = "设备负载-导出")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, EquipmentSpindleStatisticalVo equipmentSpindleStatisticalVo) {
        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String userId = user.getId();
        return equipmentSpindleStatisticalService.exportXls(userId, equipmentSpindleStatisticalVo);
    }
 
}