在行号中显示多图值及其一次显示多图值

时间:2019-05-23 16:20:34

标签: java spring spring-boot

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",
],

0 个答案:

没有答案