wangfei
2024-09-26 7dabf2870f3c4945478ac3da08959f10c93adddb
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/storagetask/controller/StorageTaskController.java
@@ -1,5 +1,7 @@
package com.mes.storagetask.controller;
import com.mes.shelfrack.entity.request.RawUsageAndShelfRack;
import com.mes.storagetask.entity.request.StorageTaskRequest;
import com.mes.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
@@ -15,6 +17,8 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
 *  
@@ -99,4 +103,27 @@
        return Result.success(result);
    }
    @ApiOperation(value = "任务查询",notes = "任务查询",produces = "application/json")
    @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
    @GetMapping("/findTasks")
    public Result findLatestTasks() {
        List<StorageTaskRequest> result = storageTaskService.Tasks();
        return Result.success(result);
    }
    @ApiOperation(value = "任务操作", notes = "任务操作")
    @PostMapping("/taskUpdate")
    public Result taskUpdate(@RequestBody Map<String, Object> storageTaskMap) {
        StorageTask task = new StorageTask();
        task.setType((String) storageTaskMap.get("Type")); // 假设Type是存储在Map中的一个键
        task.setId((int) storageTaskMap.get("id"));
        storageTaskService.taskUpdate(task);
        return Result.success();
    }
}