|
|
|
@ -54,38 +54,38 @@ public class CustomerImpressionImplTest {
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void excel() {
|
|
|
|
|
try {
|
|
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
|
|
|
|
|
XSSFSheet sheet = workbook.getSheetAt(0);
|
|
|
|
|
Iterator<Row> rowIterator = sheet.rowIterator();
|
|
|
|
|
Row row = null;
|
|
|
|
|
Cell cell = null;
|
|
|
|
|
while (rowIterator.hasNext()) {
|
|
|
|
|
row = rowIterator.next();
|
|
|
|
|
cell = row.getCell(3);
|
|
|
|
|
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
|
|
|
|
|
|
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
|
|
|
|
|
if(client==null){
|
|
|
|
|
System.out.println();
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
|
|
|
|
|
if(org==null){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
row.createCell(5).setCellValue(org.getString("name"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
|
|
|
|
|
workbook.write(out);
|
|
|
|
|
workbook.close();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// @Test
|
|
|
|
|
// public void excel() {
|
|
|
|
|
// try {
|
|
|
|
|
// XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
|
|
|
|
|
// XSSFSheet sheet = workbook.getSheetAt(0);
|
|
|
|
|
// Iterator<Row> rowIterator = sheet.rowIterator();
|
|
|
|
|
// Row row = null;
|
|
|
|
|
// Cell cell = null;
|
|
|
|
|
// while (rowIterator.hasNext()) {
|
|
|
|
|
// row = rowIterator.next();
|
|
|
|
|
// cell = row.getCell(3);
|
|
|
|
|
// cell.setCellType(HSSFCell.CELL_TYPE_STRING);
|
|
|
|
|
//
|
|
|
|
|
// JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
|
|
|
|
|
// if(client==null){
|
|
|
|
|
// System.out.println();
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
|
|
|
|
|
// if(org==null){
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// row.createCell(5).setCellValue(org.getString("name"));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
|
|
|
|
|
// workbook.write(out);
|
|
|
|
|
// workbook.close();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|