wu
2024-08-02 928fa3682fcd0bcb59e3ca3da8770ecbb06cf315
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -1,13 +1,19 @@
package com.mes.bigstorage.controller;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.common.utils.RedisUtil;
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 org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@@ -28,6 +34,8 @@
    private BigStorageCageDetailsService bigStorageCageDetailsService;
    @Autowired
    private BigStorageCageService bigStorageCageService;
    @Resource
    private RedisUtil redisUtil;
    @ApiOperation("玻璃详情查询")
@@ -78,19 +86,26 @@
    @ApiOperation("指定钢化")
    @PostMapping("/TemperingGlass")
    public Result TemperingGlass(@RequestBody String temperingLayoutId,@RequestBody String engineerId) {
        boolean result=bigStorageCageDetailsService.TemperingGlass(temperingLayoutId,engineerId);
        if(result==true){
            return Result.build(200,"指定钢化成功",1);
        }else {
            return Result.build(200, "已存在钢化任务", 1);
    public Result temperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) {
        boolean result = bigStorageCageDetailsService.temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId());
        if (result == true) {
            return Result.build(200, "指定钢化成功", 1);
        } else {
            return Result.build(200, "已存在钢化任务,请等待钢化完成再指定钢化", 1);
        }
    }
    @ApiOperation("钢化查询")
    @PostMapping("/selectTemperingGlass")
    public Result selectTemperingGlass() {
        return Result.build(200,"查询成功",bigStorageCageDetailsService.selectTemperingGlass());
        return Result.build(200, "查询成功", bigStorageCageDetailsService.selectTemperingGlass());
    }
    @ApiOperation("是否钢化开关")
    @PostMapping("/temperingSwitch")
    public Result temperingSwitch(Boolean flag) {
        bigStorageCageDetailsService.temperingSwitch(flag);
        return Result.build(200, "修改成功", redisUtil.getCacheObject("temperingSwitch"));
    }
}