zhoushihao
2024-08-15 9454ccc4765c119474b9ee1f3654f97daf901588
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java
@@ -1,9 +1,13 @@
package com.mes.taskcache.controller;
import com.mes.taskcache.service.HangzhoumesService;
import com.mes.taskcache.service.PpService;
import com.mes.edgglasstask.entity.request.IdentWornRequest;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
import com.mes.taskcache.service.TaskCacheService;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -11,70 +15,54 @@
/**
 * <p>
 *  前端控制器
 * 前端控制器
 * </p>
 *
 * @author zhoush
 * @since 2024-04-07
 */
@Api(description = "识别显示")
@RestController
@RequestMapping("/taskCache")
public class TaskCacheController {
    @Autowired
    private PpService ppService;
    private EdgStorageCageDetailsService edgStorageCageDetailsService;
    @Autowired
    private HangzhoumesService hangzhoumesService;
    private TaskCacheService taskCacheService;
//    @GetMapping("/SelectTerritoryInfo") // 查询钢化版图信息-根据 工程号
//    @ResponseBody
//    public Result SelectTerritoryInfo(@RequestParam(name = "ProcessId", required = false) String ProcessId) {
//        List<Tempered> h = ppService.selectTemperedTerritory(ProcessId);
//        return Result.seccess(h);
//    }
    @GetMapping("/CutTerritory") // 查询切割版图信息-根据 工程号
    @ApiOperation("查询切割版图信息-根据 工程号   参数(工程号)")
    @PostMapping("/cutTerritory")
    @ResponseBody
    public Result CutTerritory(String ProcessId) {
        List<Map> h = ppService.selectCutTerritory(ProcessId);
        return Result.build(200,"成功",h);
    public Result cutTerritory(String current) {
        //engineerId=current;
        List<List<Map<String, Object>>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current);
        return Result.build(200, "成功", h);
    }
    @GetMapping("/CurrentCutTerritory") // 识别显示  当前版图
    @ApiOperation("识别显示  当前版图   参数()")
    @PostMapping("/currentCutTerritory")
    @ResponseBody
    public Result CurrentCutTerritory() {
        List<Map> h = ppService.selectCutTerritory();
        System.out.println(h);
        return Result.build(200,"成功",h);
    public Result currentCutTerritory() {
        List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory();
        return Result.build(200, "成功", h);
    }
    @GetMapping("/SelectCutTerritory") // 识别显示  特定版图
    @ApiOperation("识别操作:   破损/拿走     参数(ID,功能[9:拿走,8:破损])")
    @PostMapping("/identControls")
    @ResponseBody
    public Result SelectCutTerritory(String TerritoryId) {
        List<Map> h = ppService.selectCutTerritory(TerritoryId);
        return Result.build(200,"成功",h);
    public Result<String> identControls(@RequestBody @Validated IdentWornRequest request) {
        return Result.build(200, "成功", edgStorageCageDetailsService.identControls(request));
    }
    @GetMapping("/IdentControls") //   识别操作:   破损/拿走     参数(ID,功能[0:破损,1:拿走])
    @ApiOperation("磨边任务 参数()")
    @PostMapping("/selectEdgTask")
    @ResponseBody
    public Result Ident(@RequestParam(name = "IdentId", required = false) String ProcessId,@RequestParam(name = "ControlsId", required = false) String ControlsId) {
        List<Map> h = ppService.selectCutTerritory("P24032508");
        return Result.build(200,"成功",h);
    }
    @GetMapping("/SelectCageInfo") // 查询笼内信息
    @ResponseBody
    public Result SelectCageInfo(String ProcessId) {
        List<Map> h = hangzhoumesService.SelectCageInfo();
        return Result.build(200,"成功",h);
    }
    @GetMapping("/SelectEdgTask") //磨边任务
    @ResponseBody
    public Result SelectEdgTask(String ProcessId) {
        List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1");
        return Result.build(200,"成功",EdgTasks);
    public Result selectEdgTask(@RequestBody Map<String, String> arguments) {
        String line = arguments.get("line");
        List<Map<String, Object>> EdgTasks = taskCacheService.selectEdgInfo(line);
        return Result.build(200, "成功", EdgTasks);
    }
}