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
package com.web.pda.lyt.lytPda.controller;
 
import com.app.base.control.WebController;
import com.app.base.data.ApiResponseResult;
 
import com.web.pda.lyt.lytPda.service.CoatItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
 
@Api(description = "涂布项目")
@CrossOrigin
@ControllerAdvice
//@RestController
@Controller
@RequestMapping(value = "coat_item")
public class CoatItemController extends WebController {
 
    @Autowired
    private CoatItemService coatItemService;
    
    @ApiOperation(value = "获取主表数据", notes = "获取主表数据")
    @RequestMapping(value = "/getMainTable", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getMainTable(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "keyword") String keyword,
            @RequestParam(value = "page") int page,
            @RequestParam(value = "size") int size) {
        try {
            return coatItemService.getMainTable(factory, company, keyword,page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    
    @ApiOperation(value = "获取从表数据", notes = "获取从表数据 ")
    @RequestMapping(value = "/getSubTable", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getSubTable(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "mid") String mid) {
        try {
            return coatItemService.getSubTable(factory, company,mid);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    
    @ApiOperation(value = "修改从表数据", notes = "修改从表数据")
    @RequestMapping(value = "/updateSubTable", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult updateSubTable(
            @RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "did") String did,
            @RequestParam(value = "stValue") String stValue,
            @RequestParam(value = "lowValue") String lowValue,
            @RequestParam(value = "upValue") String upValue,
            @RequestParam(value = "lowPercent") String lowPercent,
            @RequestParam(value = "upPercent") String upPercent,
            @RequestParam(value = "flow") String flow,
            @RequestParam(value = "fup") String fup,
            @RequestParam(value = "lowCon") String lowCon,
            @RequestParam(value = "upCon") String upCon) {
        try {
            return coatItemService.updateSubTable(factory, company, did, stValue,lowValue,upValue,
                    lowPercent,upPercent,flow,fup,lowCon,upCon);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
}