|
@@ -127,17 +127,7 @@ public class AfterSalesServiceImpl extends ServiceImpl<AfterSalesMapper, AfterSa
|
|
|
|
|
|
order.setIsAftersales(YesOrNoEnum.YES.getValue());
|
|
|
orderService.updateById(order);
|
|
|
- OrderGroupon orderGroupon = orderGrouponService.lambdaQuery().eq(OrderGroupon::getOrderId, request.getOrderId()).one();
|
|
|
- Assert.notNull(orderGroupon, "orderGroupon数据不存在");
|
|
|
- Groupon groupon = grouponService.getById(orderGroupon.getGrouponId());
|
|
|
- Assert.notNull(orderGroupon, "groupon数据不存在");
|
|
|
|
|
|
- int afterSalesDays = Integer.parseInt(ParamCache.getValueDefault(CacheBizConstant.ORDER_AFTER_SALES_DAYS, "3"));
|
|
|
- // 校验是否能申请售后
|
|
|
- LocalDateTime time = groupon.getTakeStartTime().plusDays(afterSalesDays);
|
|
|
- if (time.isBefore(LocalDateTime.now())) {
|
|
|
- throw new ServiceException("已过售后期");
|
|
|
- }
|
|
|
|
|
|
// 校验商品是否已经申请过售后
|
|
|
List<Long> collect = request.getAfterGoodsList().stream().map(BaseEntity::getId).collect(Collectors.toList());
|
|
@@ -165,7 +155,6 @@ public class AfterSalesServiceImpl extends ServiceImpl<AfterSalesMapper, AfterSa
|
|
|
afterSales.setIsArrived(YesOrNoEnum.NO.getValue());
|
|
|
afterSales.setUserId(AuthUtil.getUserId());
|
|
|
afterSales.setStoreId(goods.getShopId());
|
|
|
- afterSales.setGrouponId(orderGroupon.getGrouponId());
|
|
|
afterSalesList.add(afterSales);
|
|
|
}
|
|
|
saveBatch(afterSalesList);
|