作者 xudada

舱单excel邮单导入

... ... @@ -102,7 +102,7 @@ public class UpfileJsonController {
or.setConsigneeaddress(arr.get(47));//收货人地址
or.setCreatedate(new Date());//创建日期yyyy-MM-dd HH:mm:ss
or.setFlightDate(format.parse(arr.get(66)));//航班日期yyyy-MM-dd
or.setStatus("17");//操作状态
or.setStatus("01");//操作状态
or.setIsbatch("T");//分批标识
or.setShipperCountrycode(arr.get(86));//发货人国家代码
or.setShipperPhone(arr.get(106));//发货人联系电话
... ...
... ... @@ -22,8 +22,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static org.apache.poi.ss.usermodel.CellType.BLANK;
import static org.apache.poi.ss.usermodel.CellType.STRING;
import static org.apache.poi.ss.usermodel.CellType.*;
/**
* shenhailong
... ... @@ -59,7 +58,7 @@ public class ExcelUtils {
}
totoalRows = xssfSheet.getLastRowNum();
//读取row
for (int rowIndex = 2; rowIndex <= totoalRows; rowIndex++) {
for (int rowIndex = 1; rowIndex <= totoalRows; rowIndex++) {
XSSFRow xssfRow = xssfSheet.getRow(rowIndex);
if (xssfRow == null) {
... ... @@ -145,12 +144,12 @@ public class ExcelUtils {
//读取列
for (int cellIndex = 0; cellIndex < totalCells; cellIndex++) {
HSSFCell hssfCell = hssfRow.getCell(cellIndex);
if (hssfCell == null) {
if (hssfCell == null || String.valueOf(hssfCell)=="") {
rowList.add("");
} else {
// System.out.println(hssfCell.getCellType());
if(BLANK==hssfCell.getCellType()){
if(NUMERIC==hssfCell.getCellType()){
if(DateUtil.isCellDateFormatted(hssfCell)){
//用于转化为日期格式
Date d = hssfCell.getDateCellValue();
... ...