lyhzzz 4 mēneši atpakaļ
vecāks
revīzija
b09cac3422

+ 8 - 0
src/main/java/com/fdkankan/manage/service/impl/AuthorizeRtkServiceImpl.java

@@ -71,6 +71,14 @@ public class AuthorizeRtkServiceImpl extends ServiceImpl<IAuthorizeRtkMapper, Au
         DateTime startDate = DateUtil.parse(startTime);
         DateTime startDate = DateUtil.parse(startTime);
         DateTime endDate = DateUtil.parse(endTime);
         DateTime endDate = DateUtil.parse(endTime);
         if(rtkDevice.getValidStartTime() != null && rtkDevice.getValidEndTime() != null){
         if(rtkDevice.getValidStartTime() != null && rtkDevice.getValidEndTime() != null){
+
+            if(startDate.isBefore(rtkDevice.getValidStartTime())){
+                throw new BusinessException(ResultCode.RTK_TIME_ERROR);
+            }
+            if(endDate.isBefore(rtkDevice.getValidEndTime())){
+                throw new BusinessException(ResultCode.RTK_TIME_ERROR);
+            }
+
             if(DateUtil.isIn(startDate,rtkDevice.getValidStartTime(),rtkDevice.getValidEndTime())){
             if(DateUtil.isIn(startDate,rtkDevice.getValidStartTime(),rtkDevice.getValidEndTime())){
                 throw new BusinessException(ResultCode.RTK_TIME_ERROR);
                 throw new BusinessException(ResultCode.RTK_TIME_ERROR);
             }
             }