1. 会员用户,增加 point 积分字段

2. 增加获得优惠劵、收藏数量的 API 接口
This commit is contained in:
YunaiV
2023-08-19 17:00:40 +08:00
parent a4e2cacc46
commit 94a32d34b2
18 changed files with 119 additions and 13 deletions

View File

@@ -50,6 +50,12 @@ public class AppTradeAfterSaleController {
return success(TradeAfterSaleConvert.INSTANCE.convert(afterSaleService.getAfterSale(getLoginUserId(), id)));
}
@GetMapping(value = "/get-applying-count")
@Operation(summary = "获得进行中的售后订单数量")
public CommonResult<Long> getApplyingAfterSaleCount() {
return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId()));
}
// TODO 芋艿:待实现
@GetMapping(value = "/get-reason-list")
@Operation(summary = "获得售后原因")

View File

@@ -9,6 +9,8 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
@Mapper
public interface TradeAfterSaleMapper extends BaseMapperX<TradeAfterSaleDO> {
@@ -40,4 +42,10 @@ public interface TradeAfterSaleMapper extends BaseMapperX<TradeAfterSaleDO> {
TradeAfterSaleDO::getUserId, userId);
}
default Long selectCountByUserIdAndStatus(Long userId, Collection<Integer> statuses) {
return selectCount(new LambdaQueryWrapperX<TradeAfterSaleDO>()
.eq(TradeAfterSaleDO::getUserId, userId)
.in(TradeAfterSaleDO::getStatus, statuses));
}
}

View File

@@ -108,4 +108,12 @@ public interface TradeAfterSaleService {
*/
void cancelAfterSale(Long userId, Long id);
/**
* 【会员】获得正在进行中的售后订单数量
*
* @param userId
* @return 数量
*/
Long getApplyingAfterSaleCount(Long userId);
}

View File

@@ -398,6 +398,11 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa
TradeOrderItemAfterSaleStatusEnum.APPLY.getStatus(), TradeOrderItemAfterSaleStatusEnum.NONE.getStatus());
}
@Override
public Long getApplyingAfterSaleCount(Long userId) {
return tradeAfterSaleMapper.selectCountByUserIdAndStatus(userId, TradeAfterSaleStatusEnum.APPLYING_STATUSES);
}
@Deprecated
private void createAfterSaleLog(Long userId, Integer userType, TradeAfterSaleDO afterSale,
Integer beforeStatus, Integer afterStatus) {