|
@@ -44,13 +44,13 @@ public class UserReceiveAddressServiceImpl extends ServiceImpl<UserReceiveAddres
|
|
|
UserReceiveAddress userReceiveAddress = AssertUtils.available(this.getById(id), "该常用地址不存在");
|
|
|
UserReceiveAddressCopier.INSTANCE.copying(param,userReceiveAddress);
|
|
|
userReceiveAddress.setUpdateTime(new Date());
|
|
|
- if ("1".equals(param.getDefaultStatus())){
|
|
|
+ if (param.isDefaultStatus()){
|
|
|
UserReceiveAddress receiveAddress = this.lambdaQuery()
|
|
|
.eq(UserReceiveAddress::getUserId,userId)
|
|
|
- .eq(UserReceiveAddress::getDefaultStatus,"1")
|
|
|
+ .eq(UserReceiveAddress::isDefaultStatus,true)
|
|
|
.one();
|
|
|
if (null != receiveAddress){
|
|
|
- receiveAddress.setDefaultStatus("0");
|
|
|
+ receiveAddress.setDefaultStatus(false);
|
|
|
this.updateById(receiveAddress);
|
|
|
}
|
|
|
}
|
|
@@ -62,7 +62,7 @@ public class UserReceiveAddressServiceImpl extends ServiceImpl<UserReceiveAddres
|
|
|
Long userId = SessionContextHolder.getId();
|
|
|
List<UserReceiveAddress> list = this.lambdaQuery()
|
|
|
.eq(UserReceiveAddress::getUserId,userId)
|
|
|
- .orderByDesc(UserReceiveAddress::getDefaultStatus)
|
|
|
+ .orderByDesc(UserReceiveAddress::isDefaultStatus)
|
|
|
.orderByDesc(UserReceiveAddress::getUpdateTime)
|
|
|
.orderByDesc(UserReceiveAddress::getCreateTime)
|
|
|
.list();
|
|
@@ -75,4 +75,8 @@ public class UserReceiveAddressServiceImpl extends ServiceImpl<UserReceiveAddres
|
|
|
AssertUtils.available(this.getById(id), "该常用地址不存在");
|
|
|
this.baseMapper.deleteById(id);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public UserReceiveAddressDTO queryById(Long id){
|
|
|
+ return UserReceiveAddressCopier.INSTANCE.copying(this.baseMapper.selectById(id));
|
|
|
+ }
|
|
|
}
|