自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-11-23 b53dff5d5ee6ab0d4ab138e14be643843869d00d
src/main/java/com/zy/asrs/controller/CrnController.java
@@ -3,9 +3,11 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.domain.enums.CrnStatusType;
import com.zy.asrs.domain.param.CrnDemoParam;
import com.zy.asrs.domain.param.CrnOperatorParam;
import com.zy.asrs.domain.vo.CommandLogVo;
import com.zy.asrs.domain.vo.CrnMsgTableVo;
@@ -16,6 +18,8 @@
import com.zy.asrs.mapper.BasCrnErrorMapper;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.service.impl.MainServiceImpl;
import com.zy.core.CrnThread;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
@@ -28,7 +32,7 @@
import com.zy.core.model.command.CrnCommand;
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.CrnThread;
import com.zy.core.properties.SystemProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -55,6 +59,8 @@
    private BasCrnErrorMapper basCrnErrorMapper;
    @Autowired
    private BasCrnpService basCrnpService;
    @Autowired
    private MainServiceImpl mainService;
    @ManagerAuth(memo = "进行中的命令")
@@ -188,6 +194,23 @@
        return R.ok().add(str.toString());
    }
    @PostMapping("/demo/switch")
    @ManagerAuth(memo = "堆垛机演示")
    public R crnDemo(CrnDemoParam param) throws InterruptedException {
        if (Cools.isEmpty(param.getCrnId())){
            return R.error();
        }
        if (Cools.isEmpty(param.getPassword())){
            return R.error("请输入口令");
        }
        if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
            return R.error("口令错误");
        }
        Thread.sleep(200L);
        mainService.crnDemoOfLocMove(param.getCrnId());
        return R.ok();
    }
    /****************************************************************/
    /************************** 手动操作 ******************************/