4
hao
2025-04-16 c5fb1fbcbb2bf4d511773d348f9ef625855c61fc
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package com.web.spcBasic.controller;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import com.app.base.control.WebController;
import com.app.base.data.ApiResponseResult;
import com.web.spcBasic.service.ChartSpcService;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
 
/**
 * spc六合一图和柏拉图
 * @author fyx
 *2023-03-18
 */
@Api(description = "spc六合一图和柏拉图")
@RestController
@RequestMapping(value = "/spc/chart")
public class ChartSpcController extends WebController {
    @Autowired
    private ChartSpcService chartSpcService;
    
    @ApiOperation(value="获取产品信息", notes="获取产品信息")
    @RequestMapping(value = "/getProductList", method = RequestMethod.GET)
    public ApiResponseResult getProductList(String keyword) {
        try {
            Sort sort = new Sort(Sort.Direction.DESC,"id");
            return chartSpcService.getProductList(keyword,super.getPageRequest(sort));
        } catch (Exception e) {
            return ApiResponseResult.failure("获取产品信息失败!"+e.getMessage());
        }
    }
     
    @ApiOperation(value="获取料号信息", notes="获取料号信息")
    @RequestMapping(value = "/getItemnoList", method = RequestMethod.GET)
    public ApiResponseResult getItemnoList(String productCode,String keyword) {
        try {
            return chartSpcService.getItemnoList(productCode, keyword);
        } catch (Exception e) {
            return ApiResponseResult.failure("获取料号信息!"+e.getMessage());
        }
    }
    
    
    @ApiOperation(value="根据产品编码获取工序信息", notes="根据产品编码获取工序信息")
    @RequestMapping(value = "/getProcessList", method = RequestMethod.GET)
    public ApiResponseResult getProcessList(String productCode,String keyword) {
        try {
            return chartSpcService.getProcessList(productCode,keyword);
        } catch (Exception e) {
            return ApiResponseResult.failure("根据产品编码获取工序信息失败!"+e.getMessage());
        }
    }
    
    @ApiOperation(value="根据产品编码工序获取特性信息", notes="根据产品编码工序获取特性信息")
    @RequestMapping(value = "/getItemList", method = RequestMethod.GET)
    public ApiResponseResult getItemList(String productCode,String porcessCode,String keyword) {
        try {
            return chartSpcService.getItemList(productCode,porcessCode,keyword);
        } catch (Exception e) {
            return ApiResponseResult.failure("根据产品编码工序获取特性信息失败!"+e.getMessage());
        }
    }
    
    
    @ApiOperation(value="获取初始化六合一图", notes="获取初始化六合一图")
    @RequestMapping(value = "/getFirstInOneChart", method = RequestMethod.GET)
    public ApiResponseResult getFirstInOneChart(String process,String project,
            String item_id,String fdate,String tdate) {
        try {
            return chartSpcService.getFirstInOneChart(process, project, item_id,  fdate, tdate);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
    @ApiOperation(value="查询六合一图", notes="查询六合一图")
    @RequestMapping(value = "/getInOneChart", method = RequestMethod.GET)
    public ApiResponseResult getInOneChart(String process,String project,
        String item_id,String fdate,String tdate) {
        try {
            return chartSpcService.getInOneChart(process, project, item_id,  fdate, tdate);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
    
    
    @ApiOperation(value="查询SPC图形的原始数据", notes="查询SPC图形的原始数据")
    @RequestMapping(value = "/getSpcData", method = RequestMethod.GET)
    public ApiResponseResult getSpcData(String keyword, String suppCode,String prCode,
            String feId,String fdate,String tdate) {
        try {
            Sort sort = new Sort(Sort.Direction.ASC,"bsInputTime");
            return chartSpcService.getSpcData(keyword,suppCode, prCode, feId,  fdate, tdate,super.getPageRequest(sort));
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
    
    
    @ApiOperation(value="查询六合一图", notes="查询六合一图")
    @RequestMapping(value = "/getInOneChartAndItemnos", method = RequestMethod.GET)
    public ApiResponseResult getInOneChartAndItemnos(String process, String project, String item_nos, String item_id, String fdate, String tdate) {
        try {
            return chartSpcService.getInOneChartAndItemnos(process, project, item_nos, item_id, fdate, tdate);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
    
    
 
}