#
luxiaotao1123
2021-01-11 9042e885de0413ccfa89d231fc77ddf70c9e58d5
#
4个文件已修改
135 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/CrnController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/crn.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/CrnController.java
@@ -119,7 +119,11 @@
//
//            }
            vo.setStatusType(crnProtocol.modeType.desc);   //  模式状态
            vo.setStatus(crnProtocol.getStatusType().desc);     //  状态
            if (crnProtocol.getTaskFinish() == 1) {
                vo.setStatus("等待确认");
            } else {
                vo.setStatus(crnProtocol.getStatusType().desc);     //  状态
            }
            vo.setLoading(crnProtocol.getLoaded()==1?"有物":"无物");  //  有物
            vo.setBay(crnProtocol.getBay());    //  列
            vo.setLev(crnProtocol.getLevel());  //  层
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -246,63 +246,6 @@
        if (command.getTaskNo() == 0) {
            command.setTaskNo((short) 9999);
        }
        // 代理
        switch (command.getSourcePosX()) {
            case 1:
                command.setSourcePosX((short) 4);
                break;
            case 2:
                command.setSourcePosX((short) 3);
                break;
            case 3:
                command.setSourcePosX((short) 2);
                break;
            case 4:
                command.setSourcePosX((short) 1);
                break;
            case 5:
                command.setSourcePosX((short) 4);
                break;
            case 6:
                command.setSourcePosX((short) 3);
                break;
            case 7:
                command.setSourcePosX((short) 2);
                break;
            case 8:
                command.setSourcePosX((short) 1);
                break;
            default:
                log.info("{}号堆垛机下方命令错误,源排:{}", command.getCrnNo(), command.getSourcePosX());
        }
        switch (command.getDestinationPosX()) {
            case 1:
                command.setDestinationPosX((short) 4);
                break;
            case 2:
                command.setDestinationPosX((short) 3);
                break;
            case 3:
                command.setDestinationPosX((short) 2);
                break;
            case 4:
                command.setDestinationPosX((short) 1);
                break;
            case 5:
                command.setDestinationPosX((short) 4);
                break;
            case 6:
                command.setDestinationPosX((short) 3);
                break;
            case 7:
                command.setDestinationPosX((short) 2);
                break;
            case 8:
                command.setDestinationPosX((short) 1);
                break;
            default:
                log.info("{}号堆垛机下方命令错误,目标排:{}", command.getCrnNo(), command.getSourcePosX());
        }
        command.setCrnNo(slave.getId());
        short[] array = new short[9];
        if (!command.getTaskModeType().equals(CrnTaskModeType.CLEAR)) {
@@ -319,15 +262,14 @@
        array[7] = command.getSourceStaNo();
        array[8] = command.getDestinationStaNo();
        // 作业信息
        OperateResult result = siemensNet.Write("DB10.0", array);
        OperateResult result = siemensNet.Write("DB1000.0", array);
        // 任务号
        OperateResult result1 = siemensNet.Write("DB10.24", command.getTaskNo());
        OperateResult result1 = siemensNet.Write("DB1000.24", command.getTaskNo());
        // 结束位
        OperateResult result2 = siemensNet.Write("DB10.28.1", true);
        if (result.IsSuccess && result1.IsSuccess && result2.IsSuccess) {
            try {
                // 日志记录
        OperateResult result2 = siemensNet.Write("DB1000.28.1", true);
        // 日志记录
        try {
            if (command.getAckFinish() != 1) {
                BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class);
                BasCrnOpt basCrnOpt = new BasCrnOpt(
                        command.getTaskNo().intValue(),    // 任务号
@@ -337,17 +279,20 @@
                        command.getSourcePosX().intValue(),    // 源排
                        command.getSourcePosY().intValue(),    // 源列
                        command.getSourcePosZ().intValue(),    // 源层
                        command.getSourceStaNo().intValue(),    // 源站
                        null,    // 源站
                        command.getDestinationPosX().intValue(),    // 目标排
                        command.getDestinationPosY().intValue(),    // 目标列
                        command.getDestinationPosZ().intValue(),    // 目标层
                        command.getDestinationStaNo().intValue(),    // 目标站
                        null,    // 目标站
                        null,    // 响应结果
                        null,    // 修改时间
                        null    // 修改人员
                );
                bean.insert(basCrnOpt);
            } catch (Exception ignore) {}
            }
        } catch (Exception ignore) {}
        if (result.IsSuccess && result1.IsSuccess && result2.IsSuccess) {
            log.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
            OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
src/main/resources/application.yml
@@ -53,15 +53,29 @@
    # 堆垛机入库站点
    crnInStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 5
      staNo: 205
      row: 2
      bay: 65
      lev: 1
    # 堆垛机入库站点
    crnInStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 118
      row: 2
      bay: 0
      lev: 1
    # 堆垛机出库站点
    crnOutStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 6
      row: 1
      staNo: 203
      row: 3
      bay: 65
      lev: 1
    # 堆垛机出库站点
    crnOutStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 120
      row: 3
      bay: 0
      lev: 1
  # 堆垛机2
@@ -76,15 +90,29 @@
    # 堆垛机入库站点
    crnInStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 107
      row: 4
      staNo: 202
      row: 6
      bay: 65
      lev: 1
    # 堆垛机入库站点
    crnInStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 124
      row: 6
      bay: 0
      lev: 1
    # 堆垛机出库站点
    crnOutStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 101
      row: 3
      staNo: 200
      row: 7
      bay: 65
      lev: 1
    # 堆垛机出库站点
    crnOutStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 100
      row: 7
      bay: 0
      lev: 1
  # 输送线
src/main/webapp/views/crn.html
@@ -100,10 +100,10 @@
                <th>走行速度(m/min)</th>
                <th>升降速度(m/min)</th>
                <th>叉牙速度(m/min)</th>
                <th>走行距离(Km)</th>
                <th>升降距离(Km)</th>
                <th>走行时长(H)</th>
                <th>升降时长(H)</th>
                <th>走行距离(m)</th>
                <th>升降距离(m)</th>
                <th>走行时长(s)</th>
                <th>升降时长(s)</th>
            </tr>
        </thead>
        <tbody>