отображать мультикартовые значения в номере строки и ее мультикартовые значения по одному - PullRequest
0 голосов
/ 23 мая 2019
MultiMap<Integer,List<String>> headerMap1=new MultiValueMap(); 
            // invoiceNumber = String.valueOf(row.getCell(0).getStringCellValue());
            try {
                for (int i = 0; i < headerColumnValue.size(); i++) {
                    if (headerColumnValue.get(i).contains("Ship")) {
                        for (int j = 13; j < mySheet.getLastRowNum() + 1; j++) {

                            String tempValue=mySheet.getRow(j).getCell(i).toString();
                            if(Pattern.compile( "[0-9]" ).matcher(tempValue).find()==true) {

                            headerMap1.put(mySheet.getRow(j).getRowNum(), headerColumnValue.get(i));

                            }
                        }
                    } 
                }


            }catch (Exception e) {
                System.out.println(e);
            }
            for(Map.Entry<Integer, Object> entry :headerMap1.entrySet()) {
                message = "The cell format in the template is not valid in the row "+entry.getKey()+"."+entry.getValue();
                errorMessage.add(message);
                System.out.println("message=========="+message);
            }*
            r.setMsg(message);
            r.setInvoiceNumber(invoiceNumber);
            r.setMessage(errorMessage);
            r.setExcelResponse(null);   

У меня есть ответ, подобный приведенному ниже. Я хочу получить номер строки, и нужно напечатать только одно значение столбца.Теперь я получаю значения в объекте, поэтому предоставьте мне решение по этому вопросу. Ваша помощь очень важна для меня Мой ответ:

"message": [
        "The cell format in the template is not valid in the row 13.[Ship-From Postal Code, Ship - To Address]",
        "The cell format in the template is not valid in the row 14.[Ship-From Postal Code, Ship - To Address]",
        "Invoice number is a system format and is NOT allowed. Please generate a new invoice number"
    ],

Я хочу получить ответ типа:

 "message": [
    "The cell format in the template is not valid in the row 13.Ship-From Postal Code",
    "The cell format in the template is not valid in the row 13 Ship - To Address",
    "The cell format in the template is not valid in the row 14.Ship-From Postal Code",
    "The cell format in the template is not valid in the row 14.Ship - To Address",
],
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...