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 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 taskSuccess(Integer deviceId) { return Result.build(200, "处理成功", edgStorageDeviceTaskService.taskSuccess(deviceId)); } }