Commit f987a825 authored by 刘林's avatar 刘林

fix(jg):【web端】监管业务>业务办理>新增启用登记,选择设备下次校验日期为当日时无法提交(附图)

parent acc9ff7a
...@@ -48,7 +48,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -48,7 +48,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -223,7 +223,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -223,7 +223,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
Date currentDate = new Date(); Date currentDate = new Date();
nextInspectDates.forEach(next -> { nextInspectDates.forEach(next -> {
// 下次检验日期在当前时间之前的 // 下次检验日期在当前时间之前的
if (!next.after(currentDate)) { if (next.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
.isBefore(currentDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate())) {
throw new BadRequest("启用的设备中存在超过定期检验有效期的设备"); throw new BadRequest("启用的设备中存在超过定期检验有效期的设备");
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment