|
@@ -19,6 +19,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.customer.bo.CustomerExcelBo;
|
|
import com.goafanti.customer.bo.CustomerExcelBo;
|
|
|
import com.goafanti.order.bo.OrderReportBo;
|
|
import com.goafanti.order.bo.OrderReportBo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -747,7 +748,7 @@ public class ExcelUtils {
|
|
|
if (HSSFDateUtil.isCellDateFormatted(cell)) {
|
|
if (HSSFDateUtil.isCellDateFormatted(cell)) {
|
|
|
Date date = cell.getDateCellValue();
|
|
Date date = cell.getDateCellValue();
|
|
|
if (date != null) {
|
|
if (date != null) {
|
|
|
- value = new SimpleDateFormat("yyyy-MM-dd").format(date);//日期格式化
|
|
|
|
|
|
|
+ value = new SimpleDateFormat("yyyy/MM/dd").format(date);//日期格式化
|
|
|
} else {
|
|
} else {
|
|
|
value = "";
|
|
value = "";
|
|
|
}
|
|
}
|
|
@@ -774,6 +775,23 @@ public class ExcelUtils {
|
|
|
}
|
|
}
|
|
|
return value.trim();
|
|
return value.trim();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public static Date getCellDate(Cell cell) {
|
|
|
|
|
+ Date date=new Date();
|
|
|
|
|
+ if (cell != null) {
|
|
|
|
|
+ switch (cell.getCellTypeEnum()) {
|
|
|
|
|
+ case NUMERIC: //数字
|
|
|
|
|
+ date = cell.getDateCellValue();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case STRING://字符串
|
|
|
|
|
+ date = DateUtils.StringToDate(cell.getStringCellValue(), AFTConstants.YYYYMMDD);
|
|
|
|
|
+ default:
|
|
|
|
|
+ date = new Date();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return date;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
public static Workbook getWorkBook(MultipartFile file) {
|
|
public static Workbook getWorkBook(MultipartFile file) {
|