#
taisheng
3 天以前 bc48a855d98e360042a7e2fff5594a91a82578c6
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -38,6 +38,8 @@
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.ScaleThread;
import com.zy.core.thread.SiemensCrnThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -70,6 +72,8 @@
    private DeviceErrorService deviceErrorService;
    @Autowired
    private BasCrnpService basCrnpService;
    @Autowired
    private ConfigService configService;
    @PostMapping("/system/running/status")
    @ManagerAuth(memo = "系统运行状态")
@@ -96,6 +100,48 @@
        return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
    }
    @GetMapping("/switchDemo")
    public R switchDemo() {
        //切换演示模式
        Config demoEnableConfig = configService.selectByCode("demoEnable");
        if(demoEnableConfig == null){
            return R.error("演示模式参数不存在");
        }
        HashMap<String, Object> map = new HashMap<>();
        if (demoEnableConfig.getValue().equals("true")) {
            //开启状态,变更关闭
            demoEnableConfig.setValue("false");
            configService.updateById(demoEnableConfig);
            map.put("status", false);
        }else {
            //关闭状态,变更开启
            demoEnableConfig.setValue("true");
            configService.updateById(demoEnableConfig);
            map.put("status", true);
        }
        return R.ok().add(map);
    }
    @GetMapping("/getDemoStatus")
    public R getDemoStatus() {
        //切换演示模式
        Config demoEnableConfig = configService.selectByCode("demoEnable");
        if(demoEnableConfig == null){
            return R.error("演示模式参数不存在");
        }
        HashMap<String, Object> map = new HashMap<>();
        boolean status = false;
        if(demoEnableConfig.getValue().equals("true")){
            status = true;
        }
        map.put("status", status);
        return R.ok().add(map);
    }
    /****************************************************************/
    /************************** 实时数据 ******************************/
    /****************************************************************/