Parcourir la source

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu il y a 9 mois
Parent
commit
c54e4b06ae

+ 22 - 17
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseExcelLogic.java

@@ -989,36 +989,41 @@ public class OrderBaseExcelLogic {
             pgOrderBase.setMainName(categoryType);
 
             DateTime appointmentTimeN = null;
-            try {
-                appointmentTimeN = DateUtil.parseDateTime(appointmentTime);
-                if (dateTime == null) {
+            DateTime appointmentEndTimeN = null;
+            if (!StringUtil.isEmpty(appointmentTime)) {
+                try {
+                    appointmentTimeN = DateUtil.parseDateTime(appointmentTime);
+                    if (dateTime == null) {
+                        throw new RemoteServiceException(errPrefix + "预约开始时间请输入【2023-12-28 00:00:00】的格式");
+                    }
+                } catch (Exception e) {
                     throw new RemoteServiceException(errPrefix + "预约开始时间请输入【2023-12-28 00:00:00】的格式");
                 }
-            } catch (Exception e) {
-                throw new RemoteServiceException(errPrefix + "预约开始时间请输入【2023-12-28 00:00:00】的格式");
-            }
 
-            DateTime appointmentEndTimeN = null;
-            try {
-                appointmentEndTimeN = DateUtil.parseDateTime(appointmentEndTime);
-                if (dateTime == null) {
+
+                try {
+                    appointmentEndTimeN = DateUtil.parseDateTime(appointmentEndTime);
+                    if (dateTime == null) {
+                        throw new RemoteServiceException(errPrefix + "预约结束时间请输入【2023-12-28 00:00:00】的格式");
+                    }
+                } catch (Exception e) {
                     throw new RemoteServiceException(errPrefix + "预约结束时间请输入【2023-12-28 00:00:00】的格式");
                 }
-            } catch (Exception e) {
-                throw new RemoteServiceException(errPrefix + "预约结束时间请输入【2023-12-28 00:00:00】的格式");
             }
             pgOrderBase.setAppointmentTime(appointmentTimeN);
             pgOrderBase.setAppointmentEndTime(appointmentEndTimeN);
             pgOrderBase.setSalesOrderId(salesOrderId);
 
             DateTime overDateN = null;
-            try {
-                overDateN = DateUtil.parseDateTime(overDate);
-                if (dateTime == null) {
+            if (!StringUtil.isEmpty(overDate)) {
+                try {
+                    overDateN = DateUtil.parseDateTime(overDate);
+                    if (dateTime == null) {
+                        throw new RemoteServiceException(errPrefix + "完工时间请输入【2023-12-28 00:00:00】的格式");
+                    }
+                } catch (Exception e) {
                     throw new RemoteServiceException(errPrefix + "完工时间请输入【2023-12-28 00:00:00】的格式");
                 }
-            } catch (Exception e) {
-                throw new RemoteServiceException(errPrefix + "完工时间请输入【2023-12-28 00:00:00】的格式");
             }
 
             pgOrderBase.setOverDate(overDateN);