ZengTao
2025-05-26 fcb8b8cc392b146aa11bbaab9e497f7f13f29d44
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
package com.mes.opctask.controller;
 
import com.mes.opctask.service.EdgStorageDeviceTaskService;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * @Author : zhoush
 * @Date: 2024/10/24 15:35
 * @Description:
 */
@Api(tags = "卧式理片笼任务")
@RestController
@RequestMapping("edgStorageDeviceTask")
public class EdgStorageDeviceController {
 
    /**
     * 服务对象
     */
    @Resource
    private EdgStorageDeviceTaskService edgStorageDeviceTaskService;
 
    @ApiOperation(value = "重置任务/任务失败处理:按照设备id重置任务")
    @PostMapping("/resetTask")
    public Result<Boolean> resetTask(Integer deviceId) {
        Boolean flag = edgStorageDeviceTaskService.resetTask(deviceId);
        if (flag) {
            return Result.build(200, "重置成功", flag);
        } else {
            return Result.build(200, "无任务,无需重置", flag);
        }
    }
 
    @ApiOperation("任务成功处理")
    @PostMapping("/taskSuccess")
    public Result<Boolean> taskSuccess(Integer deviceId) {
        return Result.build(200, "处理成功", edgStorageDeviceTaskService.taskSuccess(deviceId));
    }
}