yangys
2024-02-02 b82c71a3e3a97a78bd18ff598d27f3062600d22a
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
package com.qianwen.mdc.controller.workshop;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qianwen.mdc.common.OpResult;
import com.qianwen.mdc.dto.workshop.WorkshopFullDTO;
import com.qianwen.mdc.dto.workshop.WorkshopQueryDTO;
import com.qianwen.mdc.service.sysaccount.AccountTokenService;
import com.qianwen.mdc.service.workshop.WorkshopService;
 
 
/**
 * 车间查询控制器
 */
@RestController
@CrossOrigin
@RequestMapping(value = "/workshop")
public class WorkshopQueryController {
    @Autowired
    private AccountTokenService accountTokenService;
    @Autowired
    private WorkshopService workshopService;
 
    public static final Logger logger = LoggerFactory.getLogger(WorkshopQueryController.class);
    
    
 
    @PostMapping(value = "/pageQuery")
    public OpResult<Page<WorkshopFullDTO>> pageQuery(@RequestBody WorkshopQueryDTO dto) {
        try {
            return OpResult.success(workshopService.pageQuery(dto));
        }catch(Exception e) {
            logger.error("车间分页查询异常",e);
            return OpResult.fail(e.getMessage());
        }
    }
    
    
}