feat(商城): 代码优化

master
wayn 1 year ago
parent cf2c30b78d
commit 67f1f415c1

@ -195,6 +195,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
MyBeanUtil.copyProperties(orderVO, orderDTO); MyBeanUtil.copyProperties(orderVO, orderDTO);
Long userId = MobileSecurityUtils.getUserId(); Long userId = MobileSecurityUtils.getUserId();
Long addressId = orderDTO.getAddressId(); Long addressId = orderDTO.getAddressId();
orderDTO.setUserId(userId);
Address address = iAddressService.getById(addressId); Address address = iAddressService.getById(addressId);
if (!Objects.equals(address.getMemberId(), userId)) { if (!Objects.equals(address.getMemberId(), userId)) {
throw new BusinessException(ReturnCodeEnum.ORDER_ERROR_ADDRESS_ERROR); throw new BusinessException(ReturnCodeEnum.ORDER_ERROR_ADDRESS_ERROR);

Loading…
Cancel
Save