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","餐盘已解绑");