ZengTao
2025-05-12 4037c71a2e622e83735e8aecad71b77aae007b3a
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java
@@ -1,11 +1,15 @@
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 cn.hutool.json.JSONObject;
import com.mes.damage.entity.request.DamageRequest;
import com.mes.edgstoragecage.entity.vo.CutDrawingVO;
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;
@@ -13,66 +17,57 @@
/**
 * <p>
 *  前端控制器
 * 前端控制器
 * </p>
 *
 * @author zhoush
 * @since 2024-04-07
 */
@Api(tags = "识别显示")
@RestController
@RequestMapping("/taskCache")
public class TaskCacheController {
    @Autowired
    private EdgStorageCageServiceImpl edgStorageCageServiceImpl;
    private EdgStorageCageDetailsService edgStorageCageDetailsService;
    @Autowired
    private EdgStorageCageDetailsServiceImpl edgStorageCageDetailsServiceImpl;
    private TaskCacheService taskCacheService;
    @Autowired
    private HangzhoumesService hangzhoumesService;
    @PostMapping("/cutTerritory") // 查询切割版图信息-根据 工程号
    @ResponseBody
    public Result cutTerritory(String current) {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCurrentCutTerritory(current);
        return Result.build(200,"成功",h);
    @ApiOperation("查询钢化版图信息-根据 工程号   参数(工程号)")
    @PostMapping("/temperingTerritory")
    public Result temperingTerritory(String current) {
        List<Map<String, Object>> h = edgStorageCageDetailsService.selectTemperingTerritory(current);
        return Result.build(200, "成功", h);
    }
    @PostMapping("/currentCutTerritory") // 识别显示  当前版图
    @ResponseBody
    public Result currentCutTerritory() {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory();
        return Result.build(200,"成功",h);
    @ApiOperation("查询切割版图信息-根据工程号及版序,版序默认为1")
    @PostMapping("/queryCutDrawingByEngineerId")
    public Result queryCutDrawingByEngineerId(String engineerId, int patternSequence) {
//        List<List<Map<String, Object>>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current);
        Map<String, Object> map = edgStorageCageDetailsService.queryCutDrawingByEngineerId(engineerId, patternSequence);
        return Result.build(200, "成功", map);
    }
    @PostMapping("/selectCutTerritory") // 识别显示  特定版图
    @ResponseBody
    public Result selectCutTerritory(String TerritoryId) {
        List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory();
        return Result.build(200,"成功",h);
    @ApiOperation("识别显示:当前版图,需要当前卧式理片设备id、上片线路")
    @PostMapping("/queryCurrentCutDrawing")
    public Result<JSONObject> queryCurrentCutDrawing(int deviceId, int stationCell) {
        JSONObject jsonObject = edgStorageCageDetailsService.queryCurrentCutDrawing(deviceId, stationCell);
        return Result.build(200, "成功", jsonObject);
    }
    @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);
        return Result.build(200,"成功",issucess);
    @ApiOperation("识别操作:   破损/拿走     参数(ID,功能[9:拿走,8:破损])")
    @PostMapping("/identControls")
    public Result<String> identControls(@RequestBody @Validated DamageRequest request) {
        return Result.build(200, "成功", edgStorageCageDetailsService.identControls(request));
    }
    @PostMapping("/selectCageInfo") // 查询笼内信息
    @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");
        return Result.build(200,"成功",EdgTasks);
    @ApiOperation("磨边任务 参数()")
    @PostMapping("/selectEdgTask")
    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);
    }
}