|
@@ -16,6 +16,7 @@ import cn.newfeifan.mall.module.system.service.user.AdminUserService;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSaleDisagreeReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSaleDisagreeReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSalePageReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSalePageReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSaleRefuseReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.admin.aftersale.vo.AfterSaleRefuseReqVO;
|
|
|
|
+import cn.newfeifan.mall.module.trade.controller.admin.order.vo.TradeOrderPageReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.app.aftersale.vo.AppAfterSaleCreateReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.app.aftersale.vo.AppAfterSaleCreateReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.app.aftersale.vo.AppAfterSaleDeliveryReqVO;
|
|
import cn.newfeifan.mall.module.trade.controller.app.aftersale.vo.AppAfterSaleDeliveryReqVO;
|
|
import cn.newfeifan.mall.module.trade.convert.aftersale.AfterSaleConvert;
|
|
import cn.newfeifan.mall.module.trade.convert.aftersale.AfterSaleConvert;
|
|
@@ -40,6 +41,7 @@ import cn.newfeifan.mall.module.trade.service.delivery.DeliveryExpressService;
|
|
import cn.newfeifan.mall.module.trade.service.order.TradeOrderQueryService;
|
|
import cn.newfeifan.mall.module.trade.service.order.TradeOrderQueryService;
|
|
import cn.newfeifan.mall.module.trade.service.order.TradeOrderUpdateService;
|
|
import cn.newfeifan.mall.module.trade.service.order.TradeOrderUpdateService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.google.common.collect.Maps;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -50,6 +52,7 @@ import org.springframework.validation.annotation.Validated;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.newfeifan.mall.module.trade.enums.ErrorCodeConstants.*;
|
|
import static cn.newfeifan.mall.module.trade.enums.ErrorCodeConstants.*;
|
|
@@ -461,9 +464,11 @@ public class AfterSaleServiceImpl implements AfterSaleService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Long getApplyingAfterSaleCount(Long userId) {
|
|
|
|
|
|
+ public Long getApplyingAfterSaleCount(Long userId, TradeOrderPageReqVO reqVO) {
|
|
UserShopDetailsVO userShopDetails = userService.getUserShopDetails();
|
|
UserShopDetailsVO userShopDetails = userService.getUserShopDetails();
|
|
- return tradeAfterSaleMapper.selectCountByUserIdAndStatus(userId, userShopDetails.getShopId(),userShopDetails.getMerId(), AfterSaleStatusEnum.APPLYING_STATUSES);
|
|
|
|
|
|
+ reqVO.setShopId(userShopDetails.getShopId());
|
|
|
|
+ reqVO.setMerchantId(userShopDetails.getMerId());
|
|
|
|
+ return tradeAfterSaleMapper.selectCountByUserIdAndStatus(userId, AfterSaleStatusEnum.APPLYING_STATUSES,reqVO);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -491,5 +496,27 @@ public class AfterSaleServiceImpl implements AfterSaleService {
|
|
.eq(AfterSaleDO::getMerchantId, userShopDetails.getMerId()));
|
|
.eq(AfterSaleDO::getMerchantId, userShopDetails.getMerId()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Map<Integer, Long> getTabsCount(AfterSalePageReqVO pageVO) {
|
|
|
|
+ Map<Integer, Long> counts = Maps.newLinkedHashMapWithExpectedSize(8);
|
|
|
|
+ // 查询申请售后的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.APPLY.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.APPLY.getStatus(),pageVO));
|
|
|
|
+ // 查询商品待退货的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.SELLER_AGREE.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.SELLER_AGREE.getStatus(),pageVO));
|
|
|
|
+ // 查询商家待收货的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.BUYER_DELIVERY.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.BUYER_DELIVERY.getStatus(),pageVO));
|
|
|
|
+ // 查询等待退款的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.WAIT_REFUND.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.WAIT_REFUND.getStatus(),pageVO));
|
|
|
|
+ // 查询退款成功的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.COMPLETE.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.COMPLETE.getStatus(),pageVO));
|
|
|
|
+ // 查询买家取消的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.BUYER_CANCEL.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.BUYER_CANCEL.getStatus(),pageVO));
|
|
|
|
+ // 查询商家拒绝的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.SELLER_DISAGREE.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.SELLER_DISAGREE.getStatus(),pageVO));
|
|
|
|
+ // 查询商家拒收货的售后订单
|
|
|
|
+ counts.put(AfterSaleStatusEnum.SELLER_REFUSE.getStatus(),tradeAfterSaleMapper.selectCount(AfterSaleStatusEnum.SELLER_REFUSE.getStatus(),pageVO));
|
|
|
|
+ return counts;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|