Example usage for java.math BigInteger equals

List of usage examples for java.math BigInteger equals

Introduction

In this page you can find the example usage for java.math BigInteger equals.

Prototype

public boolean equals(Object x) 

Source Link

Document

Compares this BigInteger with the specified Object for equality.

Usage

From source file:com.peterbochs.PeterBochsDebugger.java

private String[] getCCode(BigInteger pc, boolean getFile) {
    for (Dwarf dwarf : sourceLevelDebugger.peterDwarfPanel.dwarfs) {
        try {//from w w  w .j  a  va  2s. c o  m
            //            if (pc.equals(BigInteger.valueOf(0x1600000))) {
            //               System.out.println("test");
            //            }
            //            if (pc.equals(BigInteger.valueOf(0x160000c))) {
            //               System.out.println("test");
            //            }
            //            if (pc.equals(BigInteger.valueOf(0x160000f))) {
            //               System.out.println("test");
            //            }
            if (pc.equals(BigInteger.valueOf(0x1600943))) {
                System.out.println("test");
            }
            DwarfLine startLine = null;
            DwarfLine endLine = null;
            DwarfDebugLineHeader startHeader = null;

            outerloop: for (DwarfDebugLineHeader header : dwarf.headers) {
                //               Vector<DwarfLine> norepeatedline = new Vector<DwarfLine>();
                //               DwarfLine lastLine = null;
                //               for (DwarfLine line : header.lines) {
                //                  if (lastLine != null && lastLine.address == line.address) {
                //                     norepeatedline.remove(norepeatedline.size() - 1);
                //                     norepeatedline.add(line);
                //                  } else {
                //                     norepeatedline.add(line);
                //                  }
                //                  lastLine = line;
                //               }

                boolean toggle = false;
                for (DwarfLine line : header.lines) {
                    if (!toggle && line.address.equals(pc)) {
                        startLine = line;
                        if (startLine == null) {
                            System.out.println("NULL AR");
                        }
                        startHeader = header;
                        toggle = true;
                        continue;
                    }
                    if (toggle && !line.address.equals(startLine.address)
                            && line.line_num != startLine.line_num) {
                        endLine = line;
                        break outerloop;
                    }
                }
                startLine = null;
                endLine = null;
            }
            if (startHeader == null || startLine == null) {
                return null;
            }

            File file = startHeader.filenames.get((int) startLine.file_num).file;
            List<String> sourceLines = CacheStructure.fileCaches.get(file);
            if (sourceLines == null) {
                sourceLines = FileUtils.readLines(file);
                CacheStructure.fileCaches.put(file, sourceLines);
            }

            int endLineNo = 0;
            if (endLine == null) {
                endLineNo = sourceLines.size() - startLine.line_num;
            } else {
                endLineNo = endLine.line_num - 1;
            }
            //            if (endLineNo - startLine.line_num < 0) {
            //               endLineNo = startLine.line_num;
            //            }

            //            System.out.println(pc.toString(16) + ", " + startLine.line_num + ", " + endLineNo);
            String s[] = new String[endLineNo - startLine.line_num + 1];
            for (int z = startLine.line_num - 1, index = 0; z < endLineNo
                    && z < sourceLines.size(); z++, index++) {
                if (getFile) {
                    s[index] = startHeader.filenames.get((int) startLine.file_num).file.getName() + " : "
                            + (z + 1);
                } else {
                    String cCode = sourceLines.get(z);
                    s[index] = cCode;
                }
            }
            return s;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    return null;
}

From source file:service.actions.OrderSearch.java

private List<List<String>> getTestAdminOrderListData(Set<Long> rightBranchIds, OrderStatus status,
        List<OrderStatus> commonAvailebleStatusList, OrderSearchData searchData, User authUser, Integer start,
        Integer numberOfRecords, List<OrderStatus> rightStatusList, Boolean overdue) {

    Long starttime = System.currentTimeMillis();

    User currentUser = authManager.getCurrentUser();
    String currentDate = getCurrentDateToString();
    OrderCssManager ocm = new OrderCssManager(currentUser);
    ViewResolver vr = new ViewResolver(currentUser, branchRightsHolder);
    HashMap<Long, HashMap<String, Boolean>> br = branchRightsHolder.getBranchRights();
    HashMap<Rights, Boolean> cr = new HashMap();
    for (Rights r : Rights.values()) {
        cr.put(r, UserRightsUtil.isRight(r));
    }/*from w w w  .  jav  a  2  s. c om*/
    List<Long> toWork = branchRightsHolder.getBranches(BranchRights.ORDER_NEW_TO_WORK);
    List<Long> toReject = branchRightsHolder.getBranches(BranchRights.ORDER_NEW_TO_REJECT);
    Authentication a = SecurityContextHolder.getContext().getAuthentication();

    SimpleDateFormat df = new SimpleDateFormat("dd/MM");
    DateFormatter fullDateFormatter = new DateFormatter();

    //LinkedHashMap<Long, HashMap> rawRes = new LinkedHashMap();
    List<List<String>> result = new ArrayList();

    List<Object[]> preRes = orderDao.getTestOrdersAndCountsForAdminBySql(rightBranchIds, status, searchData,
            authUser.getUserId(), start, numberOfRecords, rightStatusList, overdue);

    Set<Long> orderIds = new HashSet();
    for (Object[] rawOrder : preRes) {
        Long orderId = getLong(rawOrder[0]);
        orderIds.add(orderId);
    }

    HashMap<Long, List<HashMap>> otherOrders = new HashMap();
    HashMap<Long, List<HashMap>> orderDirections = new HashMap();
    HashMap<Long, List<HashMap>> orderSalaries = new HashMap();

    //log.warn("searchLogicTime1:" + Long.valueOf(System.currentTimeMillis() - starttime));

    List<Object[]> otherOrdersRawRes = orderDao.getTestOtherOrdersForAdminBySql(orderIds);
    //log.warn("searchLogicTime2:" + Long.valueOf(System.currentTimeMillis() - starttime));
    for (Object[] rawOtherOrder : otherOrdersRawRes) {
        Long orderId = getLong(rawOtherOrder[0]);

        List<HashMap> otherOrdersList = otherOrders.get(orderId);
        if (otherOrdersList == null) {
            otherOrdersList = new ArrayList();
        }
        if (otherOrdersList.size() < 5) {
            HashMap<String, Object> otherOrderData = new HashMap();

            Long otherOrderId = getLong(rawOtherOrder[1]);
            Long otherOrderBranchId = getLong(rawOtherOrder[2]);
            String otherOrderOldId = (String) rawOtherOrder[3];
            String otherOrderNumber = otherOrderOldId;
            if (otherOrderOldId == null || otherOrderOldId.equals("")) {
                otherOrderNumber = otherOrderId.toString();
            }

            otherOrderData.put("orderId", otherOrderId);
            otherOrderData.put("branchId", otherOrderBranchId);
            otherOrderData.put("number", otherOrderNumber);
            otherOrdersList.add(otherOrderData);
            otherOrders.put(orderId, otherOrdersList);
        }
    }

    List<Object[]> orderDirectionRawRes = orderDao.getTestDirectionsForAdminBySql(orderIds);
    for (Object[] rawDirectionData : orderDirectionRawRes) {
        Long orderId = getLong(rawDirectionData[0]);

        List<HashMap> directionsList = orderDirections.get(orderId);
        if (directionsList == null) {
            directionsList = new ArrayList();
        }
        HashMap<String, Object> directionData = new HashMap();

        Long directionId = getLong(rawDirectionData[1]);
        String directionName = (String) rawDirectionData[2];

        directionData.put("directionId", directionId);
        directionData.put("directionName", directionName);
        directionsList.add(directionData);
        orderDirections.put(orderId, directionsList);
    }

    List<Object[]> authorSalariesRawRes = orderDao.getTestSalariesForAdminBySql(orderIds);
    for (Object[] rawSalaryData : authorSalariesRawRes) {
        Long orderId = getLong(rawSalaryData[0]);

        List<HashMap> salaryList = orderSalaries.get(orderId);
        if (salaryList == null) {
            salaryList = new ArrayList();
        }
        HashMap<String, Object> salaryData = new HashMap();

        Double authorSalaryCost = (Double) rawSalaryData[1];
        Long authorSalaryId = getLong(rawSalaryData[2]);

        salaryData.put("salaryId", authorSalaryId);
        salaryData.put("cost", authorSalaryCost);
        salaryList.add(salaryData);
        orderSalaries.put(orderId, salaryList);
    }
    //log.warn("rawRes= "+rawRes.size());

    /*for (Map.Entry<Long, HashMap> order : rawRes.entrySet()) {
     Long orderId = order.getKey();
     HashMap orderData = order.getValue();
     List<HashMap> otherOrdersData = otherOrders.get(orderId);
     List<HashMap> directionsData = orderDirections.get(orderId);
     List<HashMap> SalaryData = orderSalaries.get(orderId);
     if (otherOrdersData == null) {
     otherOrdersData = new ArrayList();
     }
     if (directionsData == null) {
     directionsData = new ArrayList();
     }
     if (SalaryData == null) {
     SalaryData = new ArrayList();
     }
     orderData.put("otherOrders", otherOrdersData);
     orderData.put("directions", directionsData);
     orderData.put("authorSalaries", SalaryData);
            
     result.add(orderData);
     }*/
    for (Object[] rawOrder : preRes) {
        List<String> orderData = new ArrayList();
        Long orderId = getLong(rawOrder[0]);

        Date deadlineDate = (Date) rawOrder[1];
        Date realDate = (Date) rawOrder[2];
        String clientFio = (String) rawOrder[3];
        String clientPhone = (String) rawOrder[4];
        String clientEmail = (String) rawOrder[5];
        String city = (String) rawOrder[6];
        Double cost = (Double) rawOrder[7];
        Double authorSalary = (Double) rawOrder[8];
        Boolean firstFlag = (Boolean) rawOrder[9];
        Boolean secondFlag = (Boolean) rawOrder[10];
        String statusStr = (String) rawOrder[11];
        OrderStatus orderStatus = OrderStatus.valueOf(statusStr);
        Long branchId = getLong(rawOrder[12]);
        Long orderTypeId = getLong(rawOrder[13]);
        Long authorId = getLong(rawOrder[14]);
        String comment = (String) rawOrder[15];
        String authorComment = (String) rawOrder[16];
        Date readyDate = (Date) rawOrder[17];
        String commentToAuthorSalary = (String) rawOrder[18];
        Boolean unloadedInShop = (Boolean) rawOrder[19];
        Long parentOrderId = getLong(rawOrder[20]);
        Boolean selected = (Boolean) rawOrder[21];
        Boolean childSelected = (Boolean) rawOrder[22];
        Boolean statusOfUser = (Boolean) rawOrder[23];
        /*log.warn("");
         log.warn("oid:"+orderId);
         log.warn("statusOfUser:"+statusOfUser);*/

        String oldId = (String) rawOrder[24];
        String number = oldId;
        if (oldId == null || oldId.equals("")) {
            number = orderId.toString();
        }

        String subject = (String) rawOrder[25];
        Date orderDate = (Date) rawOrder[26];
        String branchName = (String) rawOrder[27];
        String abbrevation = (String) rawOrder[28];
        String orderTypeName = (String) rawOrder[29];
        String authorLogin = (String) rawOrder[30];
        String authorName = (String) rawOrder[31];
        String authorSurname = (String) rawOrder[32];

        Boolean existReject = false;

        BigInteger bi = (BigInteger) rawOrder[33];
        Integer countMess = (bi != null ? bi.intValue() : null);

        Double paymentSum = (Double) rawOrder[34];
        paymentSum = (paymentSum != null ? paymentSum : 0D);

        BigInteger countAllAuthorMess = (BigInteger) rawOrder[35];
        BigInteger countAllAdminMess = (BigInteger) rawOrder[36];
        BigInteger countNotReadyAdminMess = (BigInteger) rawOrder[37];
        BigInteger countAllDelegateMess = (BigInteger) rawOrder[38];
        BigInteger countNotReadyDelegateMess = (BigInteger) rawOrder[39];

        BigInteger countNotReadyAuthorMessages = new BigInteger("0");
        if (countMess != null) {
            countNotReadyAuthorMessages = bi;
        }
        if (countNotReadyDelegateMess != null) {
            countNotReadyAuthorMessages = countNotReadyAuthorMessages.add(countNotReadyDelegateMess);
        }

        List<OrderStatus> availableStatusList = new ArrayList(commonAvailebleStatusList);
        if (statusStr.equals(OrderStatus.NEW.name())) {
            if (!toWork.contains(branchId)) {
                availableStatusList.remove(OrderStatus.WORKING);
            }
            if (!toReject.contains(branchId)) {
                availableStatusList.remove(OrderStatus.REJECTION);
            }
        }

        List<HashMap> otherOrdersData = otherOrders.get(orderId);
        List<HashMap> directionsData = orderDirections.get(orderId);
        List<HashMap> SalaryData = orderSalaries.get(orderId);
        if (otherOrdersData == null) {
            otherOrdersData = new ArrayList();
        }
        if (directionsData == null) {
            directionsData = new ArrayList();
        }
        if (SalaryData == null) {
            SalaryData = new ArrayList();
        }

        HashMap<String, Boolean> branchRights = br.get(branchId);
        boolean rightChangeOrder = false;
        if ((childSelected == null || !childSelected) && branchRights.get("CHANGE_ORDER")
                && webPrivs.isAllowed("/Order/change", a)) {
            rightChangeOrder = true;
        }

        String rowClass = ocm.getRowClass(selected, authorId, cost, statusOfUser, orderStatus, SalaryData,
                null);

        orderData.add("<tr class=" + rowClass + ">");

        /*log.warn("sou:"+statusOfUser+";");
         log.warn("cost:"+StringAdapter.getString(cost)+";");
         if(cost!=null){
         log.warn("costcomp:"+(cost>0D)+";");
         }*/
        String col = "";
        if (cr.get(Rights.TABLE_FLAGS)) {
            col = "<td><a class='info red " + (firstFlag != null && firstFlag ? "active" : "")
                    + "' data-orderId=" + orderId + " onclick='return changeFirstFlag(this);'></a>";
            col += "<br/>";
            col += "<a class='info blue " + (secondFlag != null && secondFlag ? "active" : "")
                    + "' data-orderId=" + orderId + " onclick='return changeSecondFlag(this);'></a></td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_NUMBER)) {
            if (branchRights.get("GET_ORDER") && webPrivs.isAllowed("/Order/get", a)) {
                col = "<td><a href='#' class='orderShow flat' data-id=" + orderId + " data-number=" + number
                        + ">";
                col += "<p class='order-num'><span class='orderCount'>" + abbrevation + "</span>" + number
                        + "</p></a></td>";
            } else {
                col = "<td>" + StringAdapter.getString(number) + "</td>";
            }
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_DIRECTIONS)) {
            col = "<td class='directionsTd' data-orderId=" + orderId + ">";
            if (branchRights.get("ORDER_CHANGE_DIRECTIONS") && (childSelected == null || !childSelected)) {
                col += "<div class='directionDiv add-order-select' data-orderId=" + orderId + ">";
                for (HashMap dir : directionsData) {
                    col += "<select class='directionSelect' data-orderId=" + orderId + " data-value="
                            + dir.get("directionId") + ">";
                    col += "<option value=''></option>";
                    for (Direction d : directionService.getAll()) {
                        col += "<option value=" + d.getDirectionId() + " "
                                + (d.getDirectionId().equals(dir.get("directionId")) ? "selected" : "") + ">"
                                + d.getName() + "</option>";
                    }
                    col += "</select></br>";
                }
                col += "</div>";
                col += "<a class='add-direction addDirectionSubmit info add active' data-orderId=" + orderId
                        + ">+</a>";
            } else {
                for (HashMap d : directionsData) {
                    col += d.get("directionName");
                }
            }
            col += "</td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_TYPE)) {
            col = "<td><div class='changeDiv dbl-area-select' data-orderId=" + orderId
                    + " data-parameterName='orderType' data-isRight=" + rightChangeOrder + ">";
            col += "<div class='text'>" + orderTypeName + "</div>";
            col += "<select>";
            for (OrderType ot : orderTypeService.getAll()) {
                col += "<option value=" + ot.getOrderTypeId() + " "
                        + (ot.getOrderTypeId().equals(orderTypeId) ? "selected" : "") + ">" + ot.getName()
                        + "</option>";
            }
            col += "</select></div></td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_SUBJECT)) {
            col = "<td><div class='changeDiv dbl-area-auto' data-orderId=" + orderId
                    + " data-parameterName='subject' data-isRight=" + rightChangeOrder + ">";
            col += "<div class='text'>" + subject + "</div>";
            col += "<textarea>" + subject + "</textarea></div></td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_DATE)) {
            col = "<td><div data-fromTable='true' class='changeDiv dbl-area' data-orderId=" + orderId
                    + " data-parameterName='deadlineDate' style='width: inherit;' data-isRight="
                    + rightChangeOrder + ">";
            col += "<div style='font-size: 0.8em;'>" + (deadlineDate != null ? df.format(deadlineDate) : "")
                    + "</div>";
            col += "<input type='text' class='date' value="
                    + (deadlineDate != null ? fullDateFormatter.date(deadlineDate) : "") + "></div>";
            col += "<div data-fromTable='true' class='changeDiv dbl-area' data-orderId=" + orderId
                    + " data-parameterName='realDate' style='width: inherit;' data-isRight=" + rightChangeOrder
                    + ">";
            col += "<div style='font-size: 0.8em;'>" + (realDate != null ? df.format(realDate) : "") + "</div>";
            col += "<input type='text' class='date' value="
                    + (realDate != null ? fullDateFormatter.date(realDate) : "") + "></div></td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_CLIENT)) {
            col = "<td>";
            if (parentOrderId == null) {
                col += "<div class='changeDiv dbl-area-auto' data-orderId=" + orderId
                        + " data-parameterName='clientFio' data-isRight=" + rightChangeOrder + ">";
                col += "<div class='text'>" + clientFio + "</div>";
                col += "<input type='text' value='" + clientFio + "'></div>";
                if (branchRights.get("ORDER_SHOW_CLIENT_EMAIL") != null) {
                    col += "<div class='changeDiv dbl-area-auto' data-orderId=" + orderId
                            + " data-parameterName='clientEmail' data-isRight=" + rightChangeOrder + ">";
                    col += "<div class='text'>" + clientEmail + "</div>";
                    col += "<input type='text' value=" + clientEmail + "></div>";
                }
                if (branchRights.get("ORDER_SHOW_CLIENT_PHONE") != null) {
                    col += "<div class='changeDiv dbl-area-auto' data-orderId=" + orderId
                            + " data-parameterName='clientPhone' data-isRight=" + rightChangeOrder + ">";
                    col += "<div class='text'>" + clientPhone + "</div>";
                    col += "<input type='text' value=" + clientPhone + "></div>";
                }
                if (vr.showButtonsDivInTable(branchId, clientEmail, clientPhone)) {
                    col += "<div class='icon-contacts' style='width: 80px;'>";
                    if (vr.showSendEmailButtomInTable(branchId, clientEmail)
                            && webPrivs.isAllowed("/Notice/addEmailByClient", a)) {
                        col += "<a href='' class='mail orderEmailLink' ";
                        if (webPrivs.isAllowed("/Order/showClientEmailTitle", a)
                                && branchRights.get("ORDER_SHOW_CLIENT_EMAIL_TITLE") != null) {
                            col += " data=" + clientEmail + " title=" + clientEmail + " ";
                        }
                        col += " onclick='createWindowEmailNotice('/Notice/addEmailByClient?orderId=" + orderId
                                + "'); return false;' > </a>";
                    }
                    if (vr.showSendSmsButtomInTable(branchId, clientPhone)
                            && webPrivs.isAllowed("/Notice/addSmsByClient", a)) {
                        col += "<a href='' class='sms orderSmsLink' ";
                        if (webPrivs.isAllowed("/Order/showClientPhoneTitle", a)
                                && branchRights.get("ORDER_SHOW_CLIENT_PHONE_TITLE") != null) {
                            col += " data=" + clientPhone + " title=" + clientPhone + " ";
                        }
                        col += " onclick='createFloatWindow('/Notice/addSmsByClient?orderId=" + orderId
                                + "'); return false;' > </a>";
                    }
                }
                col += "<div class='clearfix'></div>";
                if (!otherOrdersData.isEmpty()) {
                    col += "<div class='other-order'>";
                    col += "<a class='other-title' onclick='$(this).next().toggle()'> </a>";
                    col += "<ul style='display: none;' > ";
                    for (HashMap od : otherOrdersData) {
                        if (webPrivs.isAllowed("/Order/get", a)
                                && br.get((Long) od.get("branchId")).get("GET_ORDER") != null) {
                            col += "<li><a href='#' class='orderShow' data-url='/Order/get?orderId="
                                    + od.get("orderId") + "&ajax=1' data-id=" + od.get("orderId")
                                    + " data-number=" + od.get("number") + " > #" + od.get("number")
                                    + "</a></li>";
                        }
                    }
                    col += "</ul>";
                }
            } else {
                col += "";
            }
            col += "</td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_PRICE)) {
            if (webPrivs.isAllowed("/Order/changeCost", a) && branchRights.get("ORDER_CHANGE_COST") != null) {
                col = "<td id='updatableCostTd" + orderId
                        + "' class='updatableTd dbl-area' data-type='cost' data-orderId=" + orderId + ">"
                        + (cost != null ? cost : "") + "</td>";
            } else {
                if (webPrivs.isAllowed("/Order/showCost", a) && branchRights.get("ORDER_SHOW_COST") != null) {
                    col = "<td><div class='dbl-area'>" + (cost != null ? cost : "") + "</div></td>";
                }
            }
            orderData.add(col);
        }

        String userString = authUser.getSurname() + " " + authUser.getName();
        if (cr.get(Rights.TABLE_PREPAYMENT)) {
            col = "<td>";
            if (webPrivs.isAllowed("/Payment/search", a) && branchRights.get("PAYMENT_SEARCH") != null) {
                col += "<div class='advance-payment modal-window'>";
                col += "<form id='paymentObj' onsubmit='return false;' data-orderid=" + orderId
                        + " class='add-payment-form' action='" + SystemVariables.BASE_URL
                        + "/Payment/add?ajax=true' method='post' enctype='multipart/form-data'>";
                col += "<div class='value'><span>" + paymentSum + "</span>";
                col += "<div class='modal-content'><table><tr><td class='title'>?</td><td>"
                        + userString + "</td></tr>";
                col += "<tr><td class='title'></td><td>" + (currentDate != null ? currentDate : "")
                        + "</td></tr>";
                col += "<tr><td class='title'></td><td><input id='amount' name='amount' type='text' value='' autocomplete='off'></td></tr>";
                col += "<tr><td class='title'>C?<br/></td><td><select id='paymentType' name='paymentType'>";
                for (PaymentType pt : paymentTypeService.getActive()) {
                    col += "<option value=" + pt.getId() + ">" + pt.getName() + "</option>";
                }
                col += "</select></td></tr>";
                col += "<tr><td colspan='2'><div class='uploadify-button' data-id=" + orderId
                        + " data-num='0' style='width: 50%;'> </div><input name='file' type='file' class='hidden ajaxUpload' id='fileInput"
                        + orderId + "' data-id=" + orderId + " data-num='0'></td></tr>";
                col += "</table><br/><input type='hidden' name='orderId' value=" + orderId + " />";
                col += "<input type='submit' class='modal-close' value=''></div></div></form></div>";
            }
            col += "</td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_AUTHOR_SALARY)) {
            if (webPrivs.isAllowed("/Order/changeAuthorSalary", a)
                    && branchRights.get("ORDER_CHANGE_AUTHOR_SALARY") != null) {
                col = "<td class='author-salary dbl-area' data-orderId=" + orderId + ">";
                col += "<div class='value-area "
                        + (commentToAuthorSalary != null && !commentToAuthorSalary.equals("") ? "warning" : "")
                        + "'>" + (authorSalary != null ? authorSalary : "") + "</div>";
                col += "<div class='input-area' style='display: none;' >";
                col += "<input class='author-salary-input' type='text' name='authorSalary' value="
                        + (authorSalary != null ? authorSalary : "") + ">";
                col += "<textarea class='comment-salary-input' >"
                        + (commentToAuthorSalary != null ? commentToAuthorSalary : "")
                        + "</textarea></div></td>";
            } else {
                col = "<td>" + (authorSalary != null ? authorSalary : "") + "</td>";
            }
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_STATUS)) {
            col = "<td class=" + ocm.getStatusClass(statusStr, cost, paymentSum)
                    + "><div class='dbl-area-select color' >";
            if (webPrivs.isAllowed("/Order/changeStatus", a)
                    && webPrivs.isAllowed("/Order/changeStatusFromTable", a)
                    && branchRights.get("ORDER_CHANGE_STATUS") != null
                    && branchRights.get("ORDER_CHANGE_STATUS_FROM_TABLE") != null) {
                col += "<div class='status-in-table text order-status' id='statusDiv" + orderId + "' >"
                        + vr.getStatusName(orderStatus, existReject, cost, statusOfUser) + "</div>";
                col += "<select id='statuSelect" + orderId + "' data-orderId=" + orderId
                        + " class='statusSelect' name='status'>";
                for (OrderStatus os : availableStatusList) {
                    col += "<option value=" + os.toString() + " " + (os.equals(orderStatus) ? "selected" : "")
                            + " >" + os.getName() + "</option>";
                }
                col += "</select>";
            } else {
                col += "<div class='text'>" + vr.getStatusName(orderStatus, existReject, cost, statusOfUser)
                        + "</div>";
            }
            col += "</div></td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_AUTHOR)) {
            col = "<td>";
            if (vr.allowShowAuthor()) {
                col += vr.getAuthorParams(authorId, authorSurname, authorName, authorLogin, branchId, "<br/>");
            }
            col += "</td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_AUTHOR_MESSAGE)) {
            col = "<td>";
            if (!countNotReadyAuthorMessages.equals(BigInteger.valueOf(0L))) {
                col += "<p class='circle'>" + countNotReadyAuthorMessages + "</p>";
            } else {
                col += "(" + countAllAuthorMess + ")";
            }
            col += "<br/>";
            if (orderStatus != null && orderStatus.equals(OrderStatus.NEW)) {
                for (HashMap sal : SalaryData) {
                    col += "<br/> " + sal.get("cost");
                }
            }
            col += "</td>";
            orderData.add(col);
        }

        if (cr.get(Rights.TABLE_ADMIN_MESSAGE)) {
            col = "<td>";
            if (!countNotReadyAdminMess.equals(BigInteger.valueOf(0L))) {
                col += "<p class='circle'>" + countNotReadyAdminMess + "</p>";
            } else {
                col += "(" + countAllAdminMess + ")";
            }
            if (unloadedInShop != null && unloadedInShop) {
                col += "<br/><span class='info check'></span>";
            }
            col += "</td>";
            orderData.add(col);
        }

        orderData.add("</tr>");

        result.add(orderData);
    }

    //log.warn("searchLogicTime:" + Long.valueOf(System.currentTimeMillis() - starttime));

    return result;
}