ZengTao
2024-08-06 ae2a52a69dd83930c7c91a16b0c521c6349ccaf3
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java
@@ -1,15 +1,19 @@
package com.mes.taskcache.controller;
import com.mes.edgstoragecage.service.impl.EdgStorageCageDetailsServiceImpl;
import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl;
import com.mes.taskcache.service.HangzhoumesService;
import com.mes.taskcache.service.PpService;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
import com.mes.edgstoragecage.service.EdgStorageCageService;
import com.mes.taskcache.entity.TaskCache;
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.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static com.mes.job.CacheGlassTask.engineerId;
/**
 * <p>
@@ -19,59 +23,52 @@
 * @author zhoush
 * @since 2024-04-07
 */
@Api(description = "识别显示")
@RestController
@RequestMapping("/taskCache")
public class TaskCacheController {
    @Autowired
    private EdgStorageCageServiceImpl edgStorageCageServiceImpl;
    private EdgStorageCageDetailsService edgStorageCageDetailsService;
    @Autowired
    private EdgStorageCageDetailsServiceImpl edgStorageCageDetailsServiceImpl;
    private EdgStorageCageService edgStorageCageService;
    @Autowired
    private HangzhoumesService hangzhoumesService;
    private TaskCacheService taskCacheService;
    @PostMapping("/cutTerritory") // 查询切割版图信息-根据 工程号
    @ApiOperation("查询切割版图信息-根据 工程号   参数(工程号)")
    @PostMapping("/cutTerritory")
    @ResponseBody
    public Result cutTerritory(String current) {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCurrentCutTerritory(current);
        //engineerId=current;
        List<List<Map<String, Object>>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current);
        return Result.build(200,"成功",h);
    }
    @PostMapping("/currentCutTerritory") // 识别显示  当前版图
    @ApiOperation("识别显示  当前版图   参数()")
    @PostMapping("/currentCutTerritory")
    @ResponseBody
    public Result currentCutTerritory() {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory();
        List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory();
        return Result.build(200,"成功",h);
    }
    @PostMapping("/selectCutTerritory") // 识别显示  特定版图
    @ApiOperation("识别操作:   破损/拿走     参数(ID,功能[200:拿走,201:破损])")
    @PostMapping("/identControls")
    @ResponseBody
    public Result selectCutTerritory(String TerritoryId) {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory();
        return Result.build(200,"成功",h);
    }
    @PostMapping("/identControls") //   识别操作:   破损/拿走     参数(ID,功能[0:破损,1:拿走])
    @ResponseBody
    public Result identControls(@RequestParam(name = "identId", required = false) String identId,@RequestParam(name = "controlsId", required = false) int controlsId) {
        boolean issucess = edgStorageCageDetailsServiceImpl.identWorn(identId,controlsId);
    public Result identControls(@RequestBody Map<String, String> arguments) {
       /* arguments.put("glassId","玻璃ID");
        arguments.put("controlsId","功能号[200拿走/201破损]");*/
        /*arguments.put("line","1001");
        arguments.put("machine","识别");*/
        boolean issucess = edgStorageCageDetailsService.identWorn(arguments);
        return Result.build(200,"成功",issucess);
    }
    @PostMapping("/selectCageInfo") // 查询笼内信息
    @ApiOperation("磨边任务 参数()")
    @PostMapping("/selectEdgTask")
    @ResponseBody
    public Result selectCageInfo(String ProcessId) {
        List<Map> h = hangzhoumesService.SelectCageInfo();
        return Result.build(200,"成功",h);
    }
    @PostMapping("/selectEdgTask") //磨边任务
    @ResponseBody
    public Result selectEdgTask(String ProcessId) {
        List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1");
    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);
    }