#
zjj
2024-05-02 64e3ed8867c2646bef997d23b5e2990e3a25d945
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -196,7 +196,15 @@
                        }
                        //StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta()));
                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null){
                        boolean sign = true;
                        if (inSta.getBarcode() == 7 || inSta.getBarcode() == 8){
                        }else {
                            if (taskWrk.getCrnNo() != inSta.getBarcode()){
                                sign = false;
                            }
                        }
                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && sign){
                            if ( taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() == workNo ){
                                continue;
                            }
@@ -261,6 +269,11 @@
                                taskWrk.setOriginTargetPoint(getWmsDto.getTargetLocationCode());
                                taskWrk.setTargetPoint(Utils.getWcsLocNo(getWmsDto.getTargetLocationCode()));
                                taskWrk.setStartPoint(String.valueOf(inSta.getBackSta()));
                                if (inSta.getBarcode() == 7 || inSta.getBarcode() == 8){
                                }else {
                                    taskWrk.setCrnNo(inSta.getBarcode());
                                }
                                if (!taskWrkService.updateById(taskWrk)){
                                    log.error("保存wms库位号失败");
                                }
@@ -792,27 +805,27 @@
                }
                //获取指令ID
                Integer commandId = crnProtocol.getCommandId();
                CommandInfo commandInfo = new CommandInfo();
                if (Cools.isEmpty(commandId)){
                    commandInfo = commandInfoService.selectOne(new EntityWrapper<CommandInfo>()
                            .eq("wrk_no",crnProtocol.getTaskNo())
                            .eq("device","Crn"));
                }else {
                    commandInfo = commandInfoService.selectById(commandId);
                }
//                Integer commandId = crnProtocol.getCommandId();
//                CommandInfo commandInfo = new CommandInfo();
//                if (Cools.isEmpty(commandId)){
//                    commandInfo = commandInfoService.selectOne(new EntityWrapper<CommandInfo>()
//                            .eq("wrk_no",crnProtocol.getTaskNo())
//                            .eq("device","Crn"));
//                }else {
//                    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)) {//修改成功后复位堆垛机
//                if (commandInfo == null) {
//                    //指令不存在
//                    continue;
//                }
//                if (commandInfo.getCommandStatus() == 3){
//                    continue;
//                }
//                commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//指令完成
//                commandInfo.setCompleteTime(new Date());//指令完成时间
//                if (commandInfoService.updateById(commandInfo)) {//修改成功后复位堆垛机
                    // 堆垛机复位
                    crnThread.setResetFlag(true);
                    if (taskWrk.getIoType() == 1 || taskWrk.getIoType() == 3){
@@ -823,7 +836,7 @@
                    if (!taskWrkService.updateById(taskWrk)){
                        log.error(taskWrk.getTaskNo()+ " 堆垛机任务完成,改变任务状态失败");
                    }
                }
//                }
            }
        }
    }