自动化立体仓库 - WCS系统
18516761980
2022-08-16 9dfd1d48c8799354c58a1daa69962cf949e6705a
Merge branch 'hylywcs' of http://47.97.1.152:5880/r/zy-wcs into hylywcs
2个文件已修改
124 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/SiteController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pipeline.html 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/SiteController.java
@@ -16,6 +16,7 @@
import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.DevpThread;
import com.zy.core.thread.SiemensDevpThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -37,6 +38,21 @@
    @Autowired
    private BasDevpService basDevpService;
    @GetMapping("/io/mode/info/site")
    @ManagerAuth(memo = "入出库模式")
    public R ioMode(){
        List<Map<String, Object>> res = new ArrayList<>();
        for (DevpSlave devp : slaveProperties.getDevp()) {
            SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
            Map<String, Object> map2 = new HashMap<>();
            map2.put("floor", 2);
            map2.put("modeVal", devpThread.ioModeOf2F.id);
            map2.put("modeDesc", devpThread.ioModeOf2F.desc);
            res.add(map2);
        }
        return R.ok().add(res);
    }
    @PostMapping("/table/site")
    @ManagerAuth(memo = "站点信息表")
    public R siteTable(){
src/main/webapp/views/pipeline.html
@@ -13,7 +13,32 @@
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/layer/layer.js"></script>
    <style>
        .io-mode-box {
            float: left;
            width: 16%;
            text-align: center;
        }
        .io-mode-box label {
            font-weight: bolder;
        }
        .ioModeBtn {
            vertical-align: middle;
            width: 50%;
            height: 30px;
            left: 0;
            top: 0;
            text-shadow: inherit;
            font-size: 15px;
            margin-left: 5px;
            margin-right: 5px;
            display: inline-block;
            background-color: #FF5722;
            border: none;
            color: #FFF;
            box-shadow: 1px 1px 5px #B6B6B6;
            border-radius: 3px;
            cursor: pointer;
        }
    </style>
</head>
<body>
@@ -29,18 +54,31 @@
            <div id="plc-error" class="main-board" style="padding-left: 10px">
                <!-- 头部 -->
                <div class="plc-log-header">
                    <!-- 设备任务操作 -->
                    <div class="io-mode-oper">
                        <fieldset>
                            <legend>入出库模式(IO-Mode)</legend>
                            <div class="io-mode-box">
                                <label>2F</label>
                                <button id="io-mode-2" class="ioModeBtn" onclick="ioModeSwitch(this.id)"> - </button>
                            </div>
                        </fieldset>
                    </div>
                    <!--            <div style="height: 40%">-->
                    <!--                <span>东侧PLC执行指令</span>-->
                    <!--            </div>-->
                    <!--            <div style="height: 40%">-->
                    <!--                <span>西侧PLC执行指令</span>-->
                    <!--            </div>-->
                    <div>
                        <span style="color: #1E9FFF">PLC异常信息表:</span>
                    </div>
                    <!--                    <div>-->
                    <!--                        <span style="color: #1E9FFF">PLC异常信息表:</span>-->
                    <!--                    </div>-->
                </div>
                <!-- 主体 -->
                <div class="plc-log-body">
                    <div>
                        <span style="color: #1E9FFF">PLC异常信息表:</span>
                    </div>
                    <table id="plc-error-table">
                        <thead>
                        <tr>
@@ -132,6 +170,7 @@
    var siteTableFullRows = 0;
    var outputDom = document.getElementById("output");
    $(document).ready(function() {
        getIoModeInfo();
        initPlcErrorTable();
        getPlcError();
        initSiteTable();
@@ -141,18 +180,74 @@
    setInterval(function () {
        getPlcError();
        starGetSite();
        getIoModeInfo();
    }, 1000);
    setInterval(function () {
        getSiteOutput();
    },500);
    function starGetSite() {
        if (stop) {
            getSite();
            // return
            return
        } else {
            getSite();
        }
    }
    var ioModeData;
    function getIoModeInfo() {
        $.ajax({
            url: baseUrl+ "/site/io/mode/info/site",
            headers: {'token': localStorage.getItem('token')},
            method: 'GET',
            success: function (res) {
                if (res.code === 200){
                    ioModeData = res.data;
                    ioModeData.forEach(function (e) {
                        $("#io-mode-"+e.floor).html(e.modeDesc);
                    })
                } else if (res.code === 403){
                    window.location.href = baseUrl+"/login";
                }  else {
                    console.log(res.msg);
                }
            }
        });
    }
    /**
     * 强制切换入出库模式
     */
    function ioModeSwitch(el) {
        var floor = el.split("-")[2];
        if (ioModeData != null && ioModeData.length > 1) {
            ioModeData.forEach(function(e) {
                if (e.floor === Number(floor)) {
                    if (e.modeVal === 3 || e.modeVal === 4) {
                        layer.confirm('确定切换为入库模式吗?',function () {
                            $.ajax({
                                url: baseUrl+ "/site/io/mode/action/site",
                                headers: {'token': localStorage.getItem('token')},
                                data: {floor: e.floor},
                                method: 'POST',
                                success: function (res) {
                                    if (res.code === 200){
                                        layer.msg("暂时不能切换!", {icon: 1})
                                    } else if (res.code === 403){
                                        window.location.href = baseUrl+"/login";
                                    }  else {
                                        console.log(res.msg);
                                    }
                                }
                            });
                            layer.closeAll();
                        })
                    }
                }
            });
        }
    }
    // plc异常信息表获取
    function getPlcError() {
        var tableEl = $('#plc-error-table');
@@ -188,7 +283,6 @@
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    console.log(res)
                    var table = res.data;
                    if (table.length > siteTableBlankRows && table.length !== siteTableFullRows) {
                        initSiteTable(table.length-siteTableBlankRows);