解绑优化

This commit is contained in:
seesaw
2024-10-23 09:41:13 +08:00
parent 9a8ec4cd4d
commit 6b658d7af0

View File

@ -490,18 +490,20 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(Wrappers.<DiningPlatesDO>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","餐盘已解绑");