严智鑫
2024-09-13 ef9e8df8f911d53d1ec23bf920f1cd5ba8f18e13
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
package com.mes.md.controller;
 
 
import com.mes.md.entity.Tasking;
import com.mes.md.service.TaskingService;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * 工作任务操作记录明细 前端控制器
 * </p>
 *
 * @author wu
 * @since 2024-08-28
 */
    @RestController
    @RequestMapping("/tasking")
    public class TaskingController {
        @Autowired
        private TaskingService taskingService;
 
        @ApiOperation("切换模式")
        @PostMapping("/updateLoadState") //切换模式"
        @ResponseBody
        public Result<Boolean> updateStatus(@RequestBody Integer state) {
            if(state == 1){
                boolean result =taskingService.updateStatus(state);
                return Result.build(1,"定制模式",result);
            }else {
                boolean result =taskingService.updateStatus(state);
                return Result.build(0,"标准模式",result);
            }
        }
        @ApiOperation("点击暂停设备")
        @PostMapping("/updateLoadStatus") //点击暂停设备
        @ResponseBody
        public Result<Boolean> updateLoadStatus(@RequestBody Integer state) {
            if(state == 1){
                boolean result =taskingService.updateLoadState(state);
                return Result.build(1,"成功",result);
            }else {
                boolean result =taskingService.updateLoadState(state);
                return Result.build(0,"成功",result);
            }
        }
        @ApiOperation("点击破损")
        @PostMapping("/updateDamage") //暂停上片任务
        @ResponseBody
        public Result<Tasking> updateDamage(@RequestBody Tasking tasking) {
 
            boolean result =taskingService.updateDamage(tasking);
            return Result.build(1,"定制模式",null);
 
 
        }
        @ApiOperation("查询当前模式过去的玻璃")
        @PostMapping("/selectTasking") //暂停上片任务
        @ResponseBody
        public Result<List<Tasking>> selectTasking() {
 
            List<Tasking> tasking =taskingService.selectTasking();
            return Result.build(1,"定制模式",tasking);
        }
 
        @ApiOperation("查询当前工艺,某工作状态的线上任务")
        @PostMapping("/findCraftTasking")
        @ResponseBody
        public Result findCraftTasking(@RequestBody Tasking tasking) {
            List<Tasking> list =taskingService.findCraftTasking(tasking);
            return Result.build(200,"成功",list);
        }
 
        @ApiOperation("修改任务状态 【破损/失败/完工】")
        @PostMapping("/updateCraftTasking")
        @ResponseBody
        public Result updateCraftTasking(@RequestBody Tasking tasking) {
            int count =taskingService.updateCraftTasking(tasking);
            return Result.build(200,"修改成功:"+count,count);
        }
        @ApiOperation("修改当前设备 【开工/暂停】")
        @PostMapping("/updateMachineState")
        @ResponseBody
        public Result updateMachineState(@RequestBody Tasking tasking) {
            int count =taskingService.updateCraftTasking(tasking);
            return Result.build(200,"修改成功:"+count,count);
        }
        @ApiOperation("修改当前设备 【上线】")
        @PostMapping("/updateTopLine")
        @ResponseBody
        public Result updateTopLine(@RequestBody Tasking tasking) {
            int count =taskingService.updateCraftTasking(tasking);
            return Result.build(200,"修改成功:"+count,count);
        }
 
        @ApiOperation("修改当前设备 【下线】")
        @PostMapping("/updateDownLine")
        @ResponseBody
        public Result updateDownLine(@RequestBody Tasking tasking) {
            int count =taskingService.updateCraftTasking(tasking);
            return Result.build(200,"修改成功:"+count,count);
        }
 
 
}