#
luxiaotao1123
2022-01-05 9338cdee4bae84f74825fbd86786e35ddfbd2d64
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -395,7 +395,7 @@
                    }
                    //  判断堆垛机状态等待确认
                    if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue())
                            && crnProtocol.getTaskFinish() == 1  // todo:luxiaotao 等待确认
                            && crnProtocol.statusType == CrnStatusType.WAITING
                            && crnProtocol.forkPosType == CrnForkPosType.HOME) {
                        // 命令下发区 --------------------------------------------------------------------------
@@ -746,8 +746,7 @@
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
            if (crnProtocol == null) { continue; }
            //  状态:等待确认 并且  任务完成位 = 1
            if (crnProtocol.getTaskFinish() == 1    // todo:luxiaotao 等待确认
                    && crnProtocol.getTaskNo() != 0) {
            if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) {
                // 获取入库待确认工作档
                WrkMast wrkMast = wrkMastMapper.selectPakInStep3(crnProtocol.getTaskNo().intValue());
                if (wrkMast == null) {
@@ -793,13 +792,13 @@
                    BasErrLog latest = basErrLogService.findLatestByTaskNo(crn.getId(), crnProtocol.getTaskNo().intValue());
                    // 有异常
                    if (latest == null) {
                        if (crnProtocol.getAlarm1() != null && crnProtocol.getAlarm1() > 0) {
                        if (crnProtocol.getAlarm() != null && crnProtocol.getAlarm() > 0) {
                            WrkMast wrkMast = wrkMastMapper.selectById(crnProtocol.getTaskNo());
                            if (wrkMast == null) {
                                continue;
                            }
                            BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1());
                            String errName = crnError==null? String.valueOf(crnProtocol.getAlarm1()):crnError.getErrName();
                            BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm());
                            String errName = crnError==null? String.valueOf(crnProtocol.getAlarm()):crnError.getErrName();
                            BasErrLog basErrLog = new BasErrLog(
                                    null,    // 编号
                                    wrkMast.getWrkNo(),    // 工作号
@@ -814,7 +813,7 @@
                                    wrkMast.getSourceStaNo(),    // 源站
                                    wrkMast.getSourceLocNo(),    // 源库位
                                    wrkMast.getBarcode(),    // 条码
                                    crnProtocol.getAlarm1(),    // 异常码
                                    (int) crnProtocol.getAlarm(),    // 异常码
                                    errName,    // 异常
                                    1,    // 异常情况
                                    now,    // 添加时间
@@ -829,7 +828,7 @@
                        }
                    } else {
                        // 异常修复
                        if (crnProtocol.getAlarm1() == null || crnProtocol.getAlarm1() == 0) {
                        if (crnProtocol.getAlarm() == null || crnProtocol.getAlarm() == 0) {
                            latest.setEndTime(now);
                            latest.setUpdateTime(now);
                            latest.setStatus(2);
@@ -842,11 +841,11 @@
                } else {
                    BasErrLog latest = basErrLogService.findLatest(crn.getId());
                    // 有异常
                    if (crnProtocol.getAlarm1() != null && crnProtocol.getAlarm1() > 0) {
                    if (crnProtocol.getAlarm() != null && crnProtocol.getAlarm() > 0) {
                        // 记录新异常
                        if (latest == null || (latest.getErrCode() != crnProtocol.getAlarm1().intValue())) {
                            BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1());
                            String errName = crnError==null? String.valueOf(crnProtocol.getAlarm1()):crnError.getErrName();
                        if (latest == null || (latest.getErrCode() != crnProtocol.getAlarm().intValue())) {
                            BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm());
                            String errName = crnError==null? String.valueOf(crnProtocol.getAlarm()):crnError.getErrName();
                            BasErrLog basErrLog = new BasErrLog(
                                    null,    // 编号
                                    null,    // 工作号
@@ -861,7 +860,7 @@
                                    null,    // 源站
                                    null,    // 源库位
                                    null,    // 条码
                                    crnProtocol.getAlarm1(),    // 异常码
                                    (int)crnProtocol.getAlarm(),    // 异常码
                                    errName,    // 异常
                                    1,    // 异常情况
                                    now,    // 添加时间