master
wangning 7 years ago
parent 14854979f8
commit 0bdb01445b

@ -28,9 +28,4 @@ public class WeekReportGenerationTask {
lastweek = DateUtils.addDays(lastweek, -7);
weekReporter.generateReport(DateFormatUtils.format(lastweek, "yyyy-MM-dd"), true);
}
public static void main(String[] args) {
String asd = "a sd ";
System.out.println(asd);
System.out.println(asd.trim());
}
}

@ -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();
// }
// }
}
Loading…
Cancel
Save