自动化立体仓库 - WMS系统
zyh
昨天 701542ac0a90cf0e3a0a81ec2bb8066b5de68e75
src/main/java/com/zy/asrs/task/handler/AGVTaskReportHandler.java
@@ -7,6 +7,7 @@
import com.zy.asrs.service.RcsService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.common.properties.StationProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -20,6 +21,9 @@
@Service
@Transactional
public class AGVTaskReportHandler extends AbstractHandler<String> {
    @Resource
    private StationProperties stationProperties;
    @Resource
    private RcsService rcsService;
@@ -37,21 +41,65 @@
        }else if(task.getIoType()==5){
            SourceStaNoType = "ZONE";
        }
        String taskType = "NB";
        Boolean flag1 = false;
        Boolean flag2 = false;
        if(stationProperties.getStation().contains(task.getStaNo())){
            taskType = "YLIN";
            flag1 = true;
        }
        if (stationProperties.getStation().contains(task.getSourceStaNo())){
            taskType = "YLOUT";
            flag2 = true;
        }
        if(flag1&&flag2){
            taskType = "YLBOTH";
        }
        if (task.getSourceStaNo().equals("Z-LVL20")||task.getSourceStaNo().equals("Z-LVL21")||task.getSourceStaNo().equals("Z-LVL22")||
                task.getSourceStaNo().equals("Z-LVL23")||task.getSourceStaNo().equals("Z-LVL24")||task.getSourceStaNo().equals("Z-LVL25")||
                task.getSourceStaNo().equals("Z-LVL26")||task.getSourceStaNo().equals("Z-LVL27")||task.getSourceStaNo().equals("Z-LVL28")||
                task.getSourceStaNo().equals("Z-LVL29")||task.getSourceStaNo().equals("Z-LVL30")||task.getSourceStaNo().equals("Z-LVL31")){
            taskType = "HKCPIN";
        }
        if (task.getStaNo().equals("Z-LVL20")||task.getStaNo().equals("Z-LVL21")||task.getStaNo().equals("Z-LVL22")||
                task.getStaNo().equals("Z-LVL23")||task.getStaNo().equals("Z-LVL24")||task.getStaNo().equals("Z-LVL25")||
                task.getStaNo().equals("Z-LVL26")||task.getStaNo().equals("Z-LVL27")||task.getStaNo().equals("Z-LVL28")||
                task.getStaNo().equals("Z-LVL29")||task.getStaNo().equals("Z-LVL30")||task.getStaNo().equals("Z-LVL31")
        ){
            taskType = "HKCPOUT";
        }
        if (task.getIsPda() !=null && task.getIsPda().equals("Y")){
            taskType = "NB";
        }
        //AGV区域中无法用-
        String StaNo = task.getStaNo();
        String SourceStaNo = task.getSourceStaNo();
        if (task.getStaNo().split("-")[0].equals("Q")) {
            String[] split = task.getStaNo().split("-");
            StaNo = split[0]+split[1];
        }
        if (task.getSourceStaNo().split("-")[0].equals("Q")) {
            String[] split = task.getSourceStaNo().split("-");
            SourceStaNo = split[0]+split[1];
        }
        // 下发给RCS
        RcsTaskSubmit rcsTaskSubmit = new RcsTaskSubmit();
        rcsTaskSubmit.setRobotTaskCode(task.getTaskNo());
        rcsTaskSubmit.setTaskType(taskType);
        rcsTaskSubmit.setRobotTaskCode(task.getTaskNo()+"-"+task.getCtnType());
        rcsTaskSubmit.setInitPriority(10);  //默认10
        List<RcsTaskTargetRoute> targetRouteList = new ArrayList<>();
        RcsTaskTargetRoute startRoute = new RcsTaskTargetRoute();
        startRoute.setSeq(0);
        startRoute.setType(SourceStaNoType);
        startRoute.setCode(task.getSourceStaNo());
        startRoute.setCode(SourceStaNo);
        startRoute.setOperation("COLLECT");
        targetRouteList.add(startRoute);
        RcsTaskTargetRoute endRoute = new RcsTaskTargetRoute();
        endRoute.setSeq(1);
        endRoute.setType(TargetStaNoType);
        endRoute.setCode(task.getStaNo());
        endRoute.setCode(StaNo);
        endRoute.setOperation("DELIVERY");
        targetRouteList.add(endRoute);
        rcsTaskSubmit.setTargetRoute(targetRouteList);