| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final IApiMallMemberService memberService; |
| | | private final IMallMoneyFlowService mallMoneyFlowService; |
| | | private final RedisUtils redisUtils; |
| | | private final MallCountryDeliveryMapper mallCountryDeliveryMapper; |
| | | |
| | | private final AgentProducer agentProducer; |
| | | private final ApiChatPayService apiChatPayService; |
| | |
| | | mallOrderItemMapper.insert(orderItem); |
| | | } |
| | | |
| | | |
| | | |
| | | //运费 |
| | | BigDecimal delivaryAmount = addOrderDto.getDeliveryAmount() == null ? BigDecimal.ZERO : addOrderDto.getDeliveryAmount(); |
| | | MallCountryDelivery delivery = mallCountryDeliveryMapper.selectOne( |
| | | Wrappers.lambdaQuery(MallCountryDelivery.class) |
| | | .eq(MallCountryDelivery::getCountryCode, addOrderDto.getCountryCode().toUpperCase()) |
| | | .eq(MallCountryDelivery::getStatus, 1) |
| | | ); |
| | | MallCountryDelivery defaultDelivery = mallCountryDeliveryMapper.selectOne( |
| | | Wrappers.lambdaQuery(MallCountryDelivery.class) |
| | | .eq(MallCountryDelivery::getCountryCode, "DEFAULT") |
| | | .eq(MallCountryDelivery::getStatus, 1) |
| | | ); |
| | | BigDecimal delivaryAmount = defaultDelivery.getShippingFee(); |
| | | if (delivery != null) { |
| | | delivaryAmount = delivery.getShippingFee(); |
| | | } |
| | | orderInfo.setCarriage(delivaryAmount); |
| | | |
| | | total = total.add(delivaryAmount); |
| | |
| | | orderInfo.setName(address.getFristName() + address.getName()); |
| | | orderInfo.setPhone(address.getPhone()); |
| | | |
| | | orderInfo.setAddress(address.getArea()+ address.getAddress()+address.getCity()+address.getProvince() + address.getCountry() ); |
| | | orderInfo.setAddress( |
| | | address.getAddress() +" - " |
| | | +address.getArea() +" - " |
| | | +address.getCity() +" - " |
| | | +address.getProvince() +" - " |
| | | +address.getCountryName() +" - " |
| | | + address.getCountry() ); |
| | | orderInfo.setLatitude(address.getLatitude()); |
| | | orderInfo.setLongitude(address.getLongitude()); |
| | | this.baseMapper.updateById(orderInfo); |
| | |
| | | public void goodsComment(ApiAddCommentDtos addCommentDtos) { |
| | | Long orderId = addCommentDtos.getOrderId(); |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | MallOrderInfo orderInfo = this.baseMapper.selectOrderDetailsById(orderId); |
| | | MallOrderInfo orderInfo = this.baseMapper.selectById(orderId); |
| | | if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) { |
| | | throw new FebsException("订单不存在"); |
| | | throw new FebsException("Order does not exist"); |
| | | } |
| | | if (OrderStatusEnum.FINISH.getValue() != orderInfo.getStatus()) { |
| | | throw new FebsException("该状态不能评价"); |
| | | throw new FebsException("This status cannot be evaluated"); |
| | | } |
| | | if (MallOrderInfo.COMMENT_STATE_YES == orderInfo.getCommentState()) { |
| | | throw new FebsException("该状态不能评价"); |
| | | throw new FebsException("This status cannot be evaluated"); |
| | | } |
| | | |
| | | orderInfo.setCommentState(MallOrderInfo.COMMENT_STATE_YES); |
| | | this.baseMapper.updateById(orderInfo); |
| | | this.baseMapper.update( |
| | | null, |
| | | Wrappers.lambdaUpdate(MallOrderInfo.class) |
| | | .set(MallOrderInfo::getCommentState, MallOrderInfo.COMMENT_STATE_YES) |
| | | .eq(MallOrderInfo::getId, orderId) |
| | | ); |
| | | |
| | | List<ApiAddCommentDto> apiAddCommentDtos = addCommentDtos.getApiAddCommentDtos(); |
| | | if(CollUtil.isNotEmpty(apiAddCommentDtos)){ |