自动化立体仓库 - WCS系统
#
zjj
2023-12-18 562c18ed0b3ac91589cf8d23511981675f59fabd
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -192,7 +192,10 @@
                            continue;
                        }
                        //StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta()));
                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() != workNo){
                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null){
                            if ( taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() == workNo ){
                                continue;
                            }
                            //获取堆垛机站点
                            StaDesc staDesc = new StaDesc();
                            if (devp.getId() <= 1){
@@ -740,11 +743,14 @@
                    commandInfo = commandInfoService.selectById(commandId);
                }
                if (commandInfo == null) {
                    //指令不存在
                    continue;
                }
                if (commandInfo.getCommandStatus() == 3){
                    continue;
                }
                commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//指令完成
                commandInfo.setCompleteTime(new Date());//指令完成时间
                if (commandInfoService.updateById(commandInfo)) {//修改成功后复位堆垛机
@@ -812,20 +818,20 @@
            if (crnProtocol == null) {
                continue;
            }
            if (true) {
            if (false) {
//            if (crnProtocol.getModeType() != CrnModeType.STOP) {
                // 有任务
                if (crnProtocol.getTaskNo() != 0) {
                    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(),    // 工作号
@@ -868,11 +874,11 @@
                } else {
                    BasErrLog latest = basErrLogService.findLatest(crn.getId());
                    // 有异常
                    if (crnProtocol.getAlarm1() != null && crnProtocol.getAlarm1() > 0) {
                    if (crnProtocol.getAlarm1() != 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,    // 工作号
@@ -944,7 +950,7 @@
        for (TaskWrk taskWrk : taskWrks) {
            //获取命令集合
            List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo());
            if (taskWrk.getCommandStep() != commandInfos.size()) {
            if (taskWrk.getCommandStep() < commandInfos.size()) {
                continue;//当前步序没有到达最后一条命令
            }