// 判断栈底有没有该作业工艺的slot
  public boolean isContinueSameTPBottom(WorkType wt, MOSlotBlock moSlotBlock) {
    boolean result = false;

    Map<Integer, MOSlotStack> bay01 = moSlotBlock.getBay01();
    Map<Integer, MOSlotStack> bay03 = moSlotBlock.getBay03();

    for (MOSlotStack moSlotStack : bay01.values()) {
      MOSlot moSlot = moSlotStack.getBottomMOSlot();
      if (moSlot != null) {
        if (moSlot.getMoveOrderSeq() == -1) { // 没有编过MoveOrder
          MOContainer moContainer = moSlot.getMoContainer();
          Set<MOSlotPosition> moSlotPositionSet = moSlot.getMoSlotPositionSet();
          if (moContainer != null && !moSlotPositionSet.isEmpty()) {
            if (moContainer.size.startsWith(wt.size) && wt.n == moSlotPositionSet.size()) {
              result = true;
            }
          } else {
            moSlotStack.bottomTierNoUpBy2();
          }
        } else {
          moSlotStack.bottomTierNoUpBy2();
        }
      }
    }

    for (MOSlotStack moSlotStack : bay03.values()) {
      MOSlot moSlot = moSlotStack.getBottomMOSlot();
      if (moSlot != null) {
        if (moSlot.getMoveOrderSeq() == -1) { // 没有编过MoveOrder
          MOContainer moContainer = moSlot.getMoContainer();
          Set<MOSlotPosition> moSlotPositionSet = moSlot.getMoSlotPositionSet();
          if (moContainer != null && !moSlotPositionSet.isEmpty()) {
            if (moContainer.size.startsWith(wt.size) && wt.n == moSlotPositionSet.size()) {
              result = true;
            }
          } else {
            moSlotStack.bottomTierNoUpBy2();
          }
        } else {
          moSlotStack.bottomTierNoUpBy2();
        }
      }
    }

    return result;
  }
  public MOSlotBlock processOrderBL(MOSlotBlock moSlotBlock) {

    Map<Integer, MOSlotStack> bay01 = moSlotBlock.getBay01();
    Map<Integer, MOSlotStack> bay03 = moSlotBlock.getBay03();

    WorkType[] workTypes =
        new WorkType[] {
          new WorkType(1, "2"),
          new WorkType(2, "2"),
          new WorkType(1, "4"),
          new WorkType(2, "4"),
          new WorkType(1, "4"),
          new WorkType(2, "2"),
          new WorkType(1, "2")
        };

    //        int n = 0;
    //        while (n < 10000) {
    //            n++;
    while (isAllMOSlotStackEmpty(moSlotBlock)) {
      int i = 0;
      while (i < workTypes.length) {
        WorkType wt = workTypes[i];
        if (isContinueSameTPBottom(wt, moSlotBlock)) {
          int count01 = -1, count03 = -1;
          W:
          while (isContinueSameTPBottomBay(wt, bay01)) {
            count01 = this.processL(wt, bay01, moSlotBlock);
            if (count01 == 0) {
              break W;
            }
          }
          W:
          while (isContinueSameTPBottomBay(wt, bay03)) {
            count03 = this.processL(wt, bay03, moSlotBlock);
            if (count03 == 0) {
              break W;
            }
          }
          if (count01 == 0 || count03 == 0) {
            i = 0;
          } else {
            if (!isContinueSameTPBottom(wt, moSlotBlock)) {
              i++;
            }
          }
        } else {
          i++;
        }
        //                if (isContinueSameTPBottom(wt, moSlotBlock)) {
        //                    int count01, count03;
        //                    //先从01贝开始
        //                    count01 = this.processL(wt, bay01, moSlotBlock);
        //                    //再从03贝开始
        //                    count03 = this.processL(wt, bay03, moSlotBlock);
        //                    if (count01 == 0 && count03 == 0) {
        //                        i = 0;
        //                    } else {
        //                        if (!isContinueSameTPBottom(wt, moSlotBlock)) {
        //                            i = 0;
        //                        }
        //                    }
        //                } else {
        //                    i++;
        //                }
      }
    }

    return moSlotBlock;
  }