Merge branch 'hotfix' into develop

master
wangning 7 years ago
commit 9cf07ff142

@ -28,9 +28,4 @@ public class WeekReportGenerationTask {
lastweek = DateUtils.addDays(lastweek, -7); lastweek = DateUtils.addDays(lastweek, -7);
weekReporter.generateReport(DateFormatUtils.format(lastweek, "yyyy-MM-dd"), true); 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());
}
} }

@ -4,27 +4,12 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import javax.annotation.Resource; import javax.annotation.Resource;
/** /**
@ -54,38 +39,38 @@ public class CustomerImpressionImplTest {
// } // }
// } // }
@Test // @Test
public void excel() { // public void excel() {
try { // try {
XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx"))); // XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx")));
XSSFSheet sheet = workbook.getSheetAt(0); // XSSFSheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIterator = sheet.rowIterator(); // Iterator<Row> rowIterator = sheet.rowIterator();
Row row = null; // Row row = null;
Cell cell = null; // Cell cell = null;
while (rowIterator.hasNext()) { // while (rowIterator.hasNext()) {
row = rowIterator.next(); // row = rowIterator.next();
cell = row.getCell(3); // cell = row.getCell(3);
cell.setCellType(HSSFCell.CELL_TYPE_STRING); // cell.setCellType(HSSFCell.CELL_TYPE_STRING);
//
JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim()); // JSONObject client = clientMapper.findClientByMoniker(cell.getStringCellValue().trim());
if(client==null){ // if(client==null){
System.out.println(); // System.out.println();
continue; // continue;
} // }
JSONObject org = orgMapper.findOne(client.getIntValue("org_id")); // JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
if(org==null){ // if(org==null){
continue; // continue;
} // }
//
row.createCell(5).setCellValue(org.getString("name")); // row.createCell(5).setCellValue(org.getString("name"));
} // }
//
OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx"); // OutputStream out = new FileOutputStream("/Users/wangning/Desktop/春节活动报名结果通知(包含BD名称).xlsx");
workbook.write(out); // workbook.write(out);
workbook.close(); // workbook.close();
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
} }
Loading…
Cancel
Save