浏览代码

fix 导入时间

he2802 3 年之前
父节点
当前提交
738639be2e

+ 1 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -86,6 +86,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         }
         catch (ParseException e)
         {
+
             throw new RuntimeException(e);
         }
     }

+ 5 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/poi/ExcelUtil.java

@@ -30,6 +30,7 @@ import java.io.*;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -1096,9 +1097,12 @@ public class ExcelUtil<T>
                 if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
                 {
                     val = cell.getNumericCellValue();
+                    System.out.println(val);
                     if (DateUtil.isCellDateFormatted(cell))
                     {
-                        val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
+                        SimpleDateFormat sdf  = new SimpleDateFormat("yyyy/MM/dd");
+                        Date date = DateUtil.getJavaDate((Double) val);// POI Excel 日期格式转换
+                        val = sdf.format(date);
                     }
                     else
                     {

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -857,6 +857,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 continue;
             }
 
+
             if (userSubscribeImport.getApplySiteExamTime() != null) {
                 userSbusciEditBo.setApplySiteExamTime(Convert.toLong(DateUtils.dateTime("yyyy/MM/dd",userSubscribeImport.getApplySiteExamTime()).getTime()/1000));
             } else {