Sfoglia il codice sorgente

凯和导入场站动态处理动态日期

lazhaoqian 3 anni fa
parent
commit
362e3d72a6

+ 5 - 6
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java

@@ -657,14 +657,13 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             if (StringUtils.isEmpty(dataFormatString)) {
                                 return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少动态日期");
                             }
-                            Date parse = HSSFDateUtil.getJavaDate(Double.valueOf(dataFormatString));
-                           /* Date parse = new Date();
+                            Date parse = null;
                             try {
-                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-                                parse = simpleDateFormat.parse(dataFormatString);
+                                parse = HSSFDateUtil.getJavaDate(Double.valueOf(dataFormatString));
                             }catch (Exception e){
-                                return AjaxResult.error("日期格式有误,正确格式如: 2021/9/2 15:11:22");
-                            }*/
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                                parse = simpleDateFormat.parse(dataFormatString);
+                            }
                             companyMsg.setfUpdatetime(parse);
                             break;
                         case "船名":