|
@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.text.DecimalFormat;
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -295,6 +296,23 @@ public class BomanReservatServiceImpl implements IBomanReservatService {
|
|
|
if ("2".equals(reservat.getVisitStatus())) {
|
|
|
return AjaxResult.error("当前预约已核销,请勿重复操作。");
|
|
|
}
|
|
|
+ //判断时间是否一致 日期和时段
|
|
|
+ String visitDate = reservat.getVisitDate();
|
|
|
+ String visitTime = reservat.getVisitTime();
|
|
|
+ if (! StringUtils.isNotBlank(visitDate) && visitDate.equals(DateUtils.getDate())){
|
|
|
+ return AjaxResult.error("来访日期有误,请查看预约日期。");
|
|
|
+ }
|
|
|
+ if (! StringUtils.isNotBlank(visitTime)){
|
|
|
+ String[] s = visitTime.split("-");
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
|
|
|
+ try {
|
|
|
+ if ((simpleDateFormat.parse(s[1]).getTime() < simpleDateFormat.parse(DateUtils.getTime()).getTime())) {
|
|
|
+ return AjaxResult.error("来访时段有误,请查看预约时段。");
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
BomanReservat bomanReservat = new BomanReservat();
|
|
|
bomanReservat.setReservatId(reservatId);
|
|
|
bomanReservat.setVisitStatus("2");
|