自动化立体仓库 - WCS系统
luxiaotao1123
2020-08-28 99936813d924346e12bf1299a7bdcdbe485ea375
#v2.0
9个文件已修改
103 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ConsoleController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/SiteController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/CrnThread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/DevpThread.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/css/console.css 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/console.html 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/crn.html 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -73,7 +73,7 @@
                return R.error("口令错误");
            }
        }
        Thread.sleep(2000L);
        Thread.sleep(200L);
        SystemProperties.WCS_RUNNING_STATUS.set(param.getOperatorType()==1?Boolean.TRUE:Boolean.FALSE);
        return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
    }
@@ -126,7 +126,7 @@
//            Short totalBay = locMastMapper.selectTotalBay();
            vo.setOffset((double) new Random().nextInt(560));     //  堆垛机偏移量
            vo.setBay(crnProtocol.getBay());    //  当前列
            vo.setBay((short) (crnProtocol.getBay() - crn.getOffset()));    //  当前列
            /**
             * 堆垛机状态判断
             */
@@ -134,6 +134,8 @@
                WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo());
                if (wrkMast != null) {
                    vo.setCrnStatus(CrnStatusType.process(wrkMast.getIoType()));
                } else {
                    vo.setCrnStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO: CrnStatusType.MACHINE_UN_AUTO);
                }
            } else {
                vo.setCrnStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO: CrnStatusType.MACHINE_UN_AUTO);
src/main/java/com/zy/asrs/controller/SiteController.java
@@ -68,12 +68,15 @@
            Map<Integer, StaProtocol> station = devpThread.getStation();
            for(Map.Entry<Integer, StaProtocol> entry : station.entrySet()) {
                PlcErrorTableVo vo = new PlcErrorTableVo();
                vo.setNo(entry.getKey());   //  序号
                vo.setPlcDesc("");  //  todo:luxiaotao plc错误描述
                vo.setError("");    //  todo:luxiaotao 异常信息
                list.add(vo);
                StaProtocol staProtocol = entry.getValue();
//                if (staProtocol) {
//                    PlcErrorTableVo vo = new PlcErrorTableVo();
//                    vo.setNo(entry.getKey());   //  序号
//
//                    vo.setPlcDesc("");  //  todo:luxiaotao plc错误描述
//                    vo.setError("");    //  todo:luxiaotao 异常信息
//                    list.add(vo);
//                }
            }
        }
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -82,7 +82,7 @@
                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
                // 判断是否满足入库条件
                if (staProtocol.isAutoing() && staProtocol.isLoading()
                        && !staProtocol.isEmptyMk() && staProtocol.isInreq1() && staProtocol.getWorkNo()==0
                        && !staProtocol.isEmptyMk() && staProtocol.getWorkNo() == 0
                        && staProtocol.isPakMk() && !Cools.isEmpty(barcode)) {
                    // 判断重复工作档
                    WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
@@ -441,7 +441,7 @@
                continue;
            }
            // 判断堆垛机出库站状态
            if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting().equals("Y")
            if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() !=null && staDetl.getCanouting().equals("Y")
                    && staProtocol.getWorkNo() == 0) {
                // 命令下发区 --------------------------------------------------------------------------
@@ -542,8 +542,9 @@
                if (wrkMast.getWrkSts() == 3 || (wrkMast.getWrkSts() == 12 && wrkMast.getIoType() == 11)){
                    wrkMast.setWrkSts(4L);
                // 出库 + 拣料/盘点/并板出库中:12.吊车出库中 ==> 14.出库完成
                } else if (wrkMast.getWrkSts() == 12) {
                    wrkMast.setWrkSts(14L);
                    // todo:luxiaotao
//                } else if (wrkMast.getWrkSts() == 12) {
//                    wrkMast.setWrkSts(14L);
                } else  {
                    continue;
                }
src/main/java/com/zy/core/thread/CrnThread.java
@@ -183,7 +183,7 @@
        // 复位信号
        if (crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) {
            if (resetFlag) {
                if (melsecMcNet.Write("D2218", 1).IsSuccess) {
                if (melsecMcNet.Write("D2218", (short) 1).IsSuccess) {
                    resetFlag = false;
                }
            }
src/main/java/com/zy/core/thread/DevpThread.java
@@ -245,7 +245,13 @@
        slave.setPort(6000);
        DevpThread devpThread = new DevpThread(slave);
        devpThread.connect();
        devpThread.read();
        OperateResult d1021 = devpThread.melsecMcNet.Write("D102", (short) 234);
        if (d1021.IsSuccess) {
            System.out.println("success");
        }
        OperateResultExOne<Short> d102 = devpThread.melsecMcNet.ReadInt16("D102");
        System.out.println(d102.Content);
//        devpThread.read();
        System.out.println("第一次读");
        // 写
//        StaProtocol staProtocol = devpThread.getStation().get(1);
@@ -258,7 +264,7 @@
//        System.out.println("----------------------------------------");
        Thread.sleep(400);
        // 读
        devpThread.read();
//        devpThread.read();
        System.out.println("第二次读");
        System.out.println(JSON.toJSONString(devpThread.station));
src/main/resources/mapper/WrkMastMapper.xml
@@ -100,7 +100,7 @@
    </select>
    <select id="selectLocMove" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=11 and (io_type=11 or io_type=110) and crn_no=#{crnNo} order by io_time,wrk_no
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=11 and io_type=11 and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
</mapper>
src/main/webapp/static/css/console.css
@@ -266,37 +266,37 @@
/* 入库 */
.machine-put {
.machine-put-flag {
    background-color: #90d0f3;
}
/* 出库 */
.machine-take {
.machine-take-flag {
    background-color: yellow;
}
/* 库到库 */
.machine-stock-move {
.machine-stock-move-flag {
    background-color: #0c24fb;
    color: #fff;
}
/* 站到站 */
.machine-site-move {
.machine-site-move-flag {
    background-color: #faa328;
}
/* PToP */
.machine-p-move {
.machine-p-move-flag {
    background-color: #128014;
    color: #fff;
}
/* 异常 */
.machine-error {
.machine-error-flag {
    background-color: red;
}
/* 自动 */
.machine-auto {
.machine-auto-flag {
    background-color: rgb(42,253,47);
}
/* 非自动/收到 */
.machine-unauto {
.machine-unauto-flag {
    background-color: #aaaaaa;
}
src/main/webapp/views/console.html
@@ -51,14 +51,14 @@
            <div class="tips-item">
                <label>堆垛机状态颜色:&nbsp;</label>
                <div class="item-group">
                    <span class="machine-put">入库</span>
                    <span class="machine-take">出库</span>
                    <span class="machine-stock-move">库到库</span>
                    <span class="machine-site-move">站到站</span>
                    <span class="machine-p-move">PToP</span>
                    <span class="machine-error">异常</span>
                    <span class="machine-auto">自动</span>
                    <span class="machine-unauto">非自动/手动</span>
                    <span class="machine-put-flag">入库</span>
                    <span class="machine-take-flag">出库</span>
                    <span class="machine-stock-move-flag">库到库</span>
                    <span class="machine-site-move-flag">站到站</span>
                    <span class="machine-p-move-flag">PToP</span>
                    <span class="machine-error-flag">异常</span>
                    <span class="machine-auto-flag">自动</span>
                    <span class="machine-unauto-flag">非自动/手动</span>
                </div>
            </div>
            <div class="tips-item">
src/main/webapp/views/crn.html
@@ -39,7 +39,6 @@
            <thead>
                <tr>
                    <th>堆垛机</th>
                    <th>任务号</th>
                    <th>模式</th>
                    <th>状态</th>
                    <th>有物</th>
@@ -257,19 +256,18 @@
                    for (var i=1;i<=table.length;i++){
                        var tr = tableEl.find("tr").eq(i);
                        setVal(tr.children("td").eq(0), table[i-1].crnNo);
                        setVal(tr.children("td").eq(1), table[i-1].workNo);
                        setVal(tr.children("td").eq(2), table[i-1].statusType);
                        setVal(tr.children("td").eq(3), table[i-1].status);
                        setVal(tr.children("td").eq(4), table[i-1].loading);
                        setVal(tr.children("td").eq(5), table[i-1].bay);
                        setVal(tr.children("td").eq(6), table[i-1].lev);
                        setVal(tr.children("td").eq(7), table[i-1].xorigin);
                        setVal(tr.children("td").eq(8), table[i-1].yorigin);
                        setVal(tr.children("td").eq(9), table[i-1].forkOffset);
                        setVal(tr.children("td").eq(10), table[i-1].xlocation);
                        setVal(tr.children("td").eq(11), table[i-1].ylocation);
                        setVal(tr.children("td").eq(12), table[i-1].stop);
                        setVal(tr.children("td").eq(13), table[i-1].warnCode);
                        setVal(tr.children("td").eq(1), table[i-1].statusType);
                        setVal(tr.children("td").eq(2), table[i-1].status);
                        setVal(tr.children("td").eq(3), table[i-1].loading);
                        setVal(tr.children("td").eq(4), table[i-1].bay);
                        setVal(tr.children("td").eq(5), table[i-1].lev);
                        setVal(tr.children("td").eq(6), table[i-1].xorigin);
                        setVal(tr.children("td").eq(7), table[i-1].yorigin);
                        setVal(tr.children("td").eq(8), table[i-1].forkOffset);
                        setVal(tr.children("td").eq(9), table[i-1].xlocation);
                        setVal(tr.children("td").eq(10), table[i-1].ylocation);
                        setVal(tr.children("td").eq(11), table[i-1].stop);
                        setVal(tr.children("td").eq(12), table[i-1].warnCode);
                    }
                } else if (res.code === 403){
                    window.location.href = baseUrl+"/login";
@@ -466,7 +464,6 @@
        var html = "";
        for (var i = 0; i < line; i ++){
            html += " <tr>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +