本文解答了关于《报税原始凭证是否用银行回单》相关内容,同时关于1、报税原始凭证是否用银行回单打印,2、报税原始凭证是否用银行回单,3、报税原始凭证是否用银行回单填写,4、交税的原始凭证,5、税务局要看原始凭证,的相关问答本篇文章福途教育网小编也整理了进来,希望对您有帮助。
报税原始凭证是否用银行回单
List tableList = document.getTables();
for (XWPFTable xwpfTable : tableList) {
List rows = xwpfTable.getRows();
for (int i = 0; i < rows.size(); i++) {
XWPFTableRow xwpfTableRow = rows.get(i);
List cells = xwpfTableRow.getTableCells();
for (int k = 0; k < cells.size(); k++) {
XWPFTableCell cell = cells.get(k);
sl = new SlipModel();
if (i == 10 && k == 1 && cell.getText().contains("是")) {
sl.setIsBankReceiptVoucher("true");
}
System.out.println(cell.getText());
}
}
}
return sl;
} catch (IOException e) {
e.printStackTrace();
return null;
} finally {
System.out.println("parseSlip end...");
}
}
private static WorkBookModel parseWorkBook(String filePath) {
WorkBookModel wm = new WorkBookModel();
wm.setSheetName(SheetNameEnum.Project);
List list = new ArrayList<>();
try (
InputStream is = new FileInputStream(filePath);
XSSFWorkbook workbook = new XSSFWorkbook(is)
) {
int sheetNumber = workbook.getNumberOfSheets();
for(int i = 1; i < sheetNumber; i++)
{
XSSFSheet sheet = workbook.getSheetAt(i);
SheetModel sm = parseSheet(sheet);
list.add(sm);
}
wm.setSheetModels(list);
} catch (IOException e) {
e.printStackTrace();
}
return wm;
}
private static SheetModel parseSheet(XSSFSheet sheet) {
SheetModel sm = new SheetModel();
//拿到sheetName
sm.setSheetName(sheet.getSheetName());
//解析Sheet
List list = new ArrayList<>();
int rowNumber = sheet.getPhysicalNumberOfRows();
for (int i = 1; i < rowNumber; i++) {
XSSFRow row = sheet.getRow(i);
if (row == null) continue;
CellModel cmRow = parseRow(row);
list.add(cmRow);
}
sm.setCellModels(list);
return sm;
}
private static CellModel parseRow(XSSFRow row) {
CellModel cm = new CellModel();
int lastCellNum = row.getPhysicalNumberOfCells();
List cellList = new ArrayList<>();
for (int i = 0; i < lastCellNum; i++) {
XSSFCell cell = row.getCell(i);
if (cell == null) continue;
String cellData = parseCell(cell);
System.out.println("parseRow cellData:" + cellData);
cellList.add(cellData);
}
cm.setCellDatas(cellList);
return cm;
}
/**
* 解析出cell中的数据
*
* @param cell cell
* @return cellData
*/
private static String parseCell(XSSFCell cell) {
if (cell == null
cell.getCellType() == XSSFCell.CELL_TYPE_ERROR) return "";
switch (cell.getCellType()) {
case XSSFCell.CELL_TYPE_NUMERIC:
cell.setCellType(XSSFCell.CELL_TYPE_STRING);
case XSSFCell.CELL_TYPE_STRING:
String cellData = cell.getStringCellValue();
return cellData == null ? "" : cellData.trim();
default:
return "";
}
}
}
总结:以上是编辑:【衣子弈】整理及AI智能原创关于《报税原始凭证是否用银行回单
》优质内容解答希望能帮助到您。