严智鑫
2024-08-19 de46cb80b7c4d1fb74a4b72d8fc4406e7e3144e7
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/controller/DownWorkstationController.java
@@ -1,6 +1,7 @@
package com.mes.downworkstation.controller;
import com.mes.common.utils.RedisUtil;
import com.mes.downworkstation.entity.DownWorkstation;
import com.mes.downworkstation.entity.request.DownWorkRequest;
import com.mes.downworkstation.service.DownWorkstationService;
@@ -11,6 +12,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@@ -32,6 +34,8 @@
    private DownWorkstationService downWorkstationService;
    @Autowired
    private GlassInfoService glassInfoService;
    @Resource
    private RedisUtil redisUtil;
    @ApiOperation("获取工位信息")
    @GetMapping("/getone")
@@ -77,9 +81,8 @@
        // 调用 DownWorkstationService 中的方法清除指定工位ID的信息
        int workstationId = (int) requestData.get("workstationId");
            downWorkstationService.clearFlowCardId(workstationId);
            return Result.build(200, "清除工位信息成功", 1);
        downWorkstationService.clearFlowCardId(workstationId);
        return Result.build(200, "清除工位信息成功", 1);
        // 构建响应数据
@@ -120,6 +123,20 @@
        return Result.build(200, "更换成功", isSucess);
    }
    @ApiOperation("关闭工位已满警报")
    @PostMapping("/closeAlarmSignal")
    @ResponseBody
    public Result<String> closeAlarmSignal() {
        return Result.build(200, "更换成功", downWorkstationService.closeAlarmSignal());
    }
    @ApiOperation("是否自动打印")
    @PostMapping("/autoPrint")
    public Result autoPrint(Boolean flag) {
        downWorkstationService.autoPrint(flag);
        return Result.build(200, "修改成功", redisUtil.getCacheObject("autoPrint"));
    }
}