自动化立体仓库 - WCS系统
zc
4 天以前 f0a87eee6f609121e595e10c30bef4c8c4f9907d
src/main/java/com/zy/asrs/controller/TVController.java
@@ -10,7 +10,6 @@
import com.zy.asrs.domain.dto.AxisBean;
import com.zy.asrs.domain.dto.WorkChartAxis;
import com.zy.asrs.domain.dto.LocChartPie;
import com.zy.asrs.domain.dto.WrkDetl;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.BasShuttleErr;
@@ -26,11 +25,14 @@
import com.zy.common.utils.HttpHandler;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.LedSlave;
import com.zy.core.model.ShuttleSlave;
import com.zy.core.model.command.LedCommand;
import com.zy.core.model.protocol.ShuttleProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.LedThread;
import com.zy.core.thread.ShuttleThread;
import com.zy.core.thread.impl.NormalLedThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
@@ -223,7 +225,17 @@
     */
    @GetMapping("/led")
    public R monitorLed(@RequestParam("ledId") Integer ledId) {
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId));
        int dev_no = 1012;
        if (ledId == 1) {
            dev_no = 1012;
        } else if (ledId == 2) {
            dev_no = 1014;
        } else if (ledId == 3) {
            dev_no = 1022;
        } else if (ledId == 4) {
            dev_no = 1025;
        }
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", dev_no));
        if (Cools.isEmpty(basDevp)) {
            return R.ok();
        }
@@ -308,22 +320,48 @@
     */
    @GetMapping("/led/error")
    public R monitorLedError(@RequestParam("ledId") Integer ledId) {
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId));
        if (Cools.isEmpty(basDevp)) {
            return R.ok();
        String errorMsg = "";
        for (LedSlave slave : slaveProperties.getLed()) {
            if (slave.getId() == ledId) {
                NormalLedThread ledThread = (NormalLedThread) SlaveConnection.get(SlaveType.Led, slave.getId());
                if (null != ledThread) {
                    errorMsg = ledThread.getErrorMsg().toString();
        }
        if (Cools.isEmpty(basDevp.getArea())) {
            return R.ok();
        }
        if (basDevp.getLoading().equals("N")) {
            basDevp.setArea("");
            basDevpService.updateById(basDevp);
            return R.ok();
        }
        String errorMsg = basDevp.getArea();
        return R.ok().add(errorMsg);
    }
    /**
     * 异常通知
     */
//    @GetMapping("/led/error")
//    public R monitorLedError(@RequestParam("ledId") Integer ledId) {
//        int dev_no = 1012;
//        if (ledId == 1) {
//            dev_no = 1012;
//        } else if (ledId == 2) {
//            dev_no = 1014;
//        } else if (ledId == 3) {
//            dev_no = 1022;
//        } else if (ledId == 4) {
//            dev_no = 1025;
//        }
//        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", dev_no));
//        if (Cools.isEmpty(basDevp)) {
//            return R.ok();
//        }
//        if (Cools.isEmpty(basDevp.getArea())) {
//            return R.ok();
//        }
//        if (basDevp.getLoading().equals("N")) {
//            basDevp.setArea("");
//            basDevpService.updateById(basDevp);
//            return R.ok();
//        }
//        String errorMsg = basDevp.getArea();
//
//        return R.ok().add(errorMsg);
//    }
    /**
     * 设备异常通知