国内海外清单 标准的导入导出

This commit is contained in:
yuezhihang
2022-04-21 13:13:53 +08:00
parent 372e92744b
commit 51010172f0
25 changed files with 571 additions and 34 deletions
@@ -63,7 +63,7 @@ public class IExportServiceImpl implements IExportService {
tsUsers.forEach(tsUser -> {
tsUserMap.put(tsUser.getAccount(),tsUser.getUname());
});
List<importExcelDTO> res= ExcelImportUtilByWk.readExcelpublic(importExcelDTO.class,file);
List<importExcelDTO> res= ExcelImportUtilByWk.readExcelpublic(importExcelDTO.class,file,stringBuilder);
if (null!=res) {
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i = 1;
@@ -34,7 +34,7 @@ public class ExcelImportUtilByWk {
* @param file 上传的Excel文件
* @return 读取结果列表,读取失败时返回null
*/
public static <T> List<T> readExcelpublic(Class<T> tClass,MultipartFile file) {
public static <T> List<T> readExcelpublic(Class<T> tClass,MultipartFile file,StringBuilder stringBuilder) {
Workbook workbook = null;
@@ -105,7 +105,10 @@ public class ExcelImportUtilByWk {
String value = convertCellValueToString(cell);
Date date= DateUtils.stringToDate(TrainFormDate.dealWithTimeZoneyyyy(value,mapExcel.get(a).exportFormat()),mapExcel.get(a).exportFormat());
// Date date= DateUtils.stringToDate(value,mapExcel.get(a).exportFormat());
if (null==date){
if (null!=value && !"".equals(value) && null==date){
stringBuilder.append("第"+rowNum+"行第"+a+"列,日期格式存在问题请检查;");
}
if (null==date && null!=value){
nums++;
}
map.get(a).set(o, date);