From 6b658d7af02e1124787a6a13d1cdf999a10728e9 Mon Sep 17 00:00:00 2001 From: seesaw Date: Wed, 23 Oct 2024 09:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diningplates/DiningPlatesServiceImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/diningplates/DiningPlatesServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/diningplates/DiningPlatesServiceImpl.java index 4af1e59c..1ae0dd23 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/diningplates/DiningPlatesServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/diningplates/DiningPlatesServiceImpl.java @@ -490,18 +490,20 @@ public class DiningPlatesServiceImpl implements DiningPlatesService { DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(Wrappers.lambdaQuery() .eq(DiningPlatesDO::getDiningPlatesNum, diningPlatesNum) .eq(DiningPlatesDO::getStoreId, storeId)); - LocalDateTime bindingTime = diningPlatesDO.getBindingTime(); - long seconds = Duration.between(bindingTime, LocalDateTime.now()).getSeconds(); if(diningPlatesDO == null ) { map.put("data", "absent"); map.put("msg",null); }else if (diningPlatesDO.getUserId() == null){ map.put("data", "unbind"); map.put("msg",null); - }else if (seconds <= 3){ - throw exception(DINING_PLATES_TIME); - } - else { + }else { + if (diningPlatesDO.getBindingTime()!=null){ + LocalDateTime bindingTime = diningPlatesDO.getBindingTime(); + long seconds = Duration.between(bindingTime, LocalDateTime.now()).getSeconds(); + if(seconds <=3){ + throw exception(DINING_PLATES_TIME); + } + } unbind(diningPlatesNum,storeId); map.put("data", "bind"); map.put("msg","餐盘已解绑");