|
@@ -34,6 +34,7 @@ import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.live.domain.LiveOrder;
|
|
import com.fs.live.domain.LiveOrder;
|
|
|
|
|
+import com.fs.live.domain.LiveOrderItem;
|
|
|
import com.fs.live.domain.LiveOrderPayment;
|
|
import com.fs.live.domain.LiveOrderPayment;
|
|
|
import com.fs.live.dto.LiveOrderComputeDTO;
|
|
import com.fs.live.dto.LiveOrderComputeDTO;
|
|
|
import com.fs.live.mapper.LiveOrderPaymentMapper;
|
|
import com.fs.live.mapper.LiveOrderPaymentMapper;
|
|
@@ -71,6 +72,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -327,7 +329,30 @@ public class LiveOrderController extends AppBaseController
|
|
|
{
|
|
{
|
|
|
log.info("获取订单详细信息 参数: {}",orderId);
|
|
log.info("获取订单详细信息 参数: {}",orderId);
|
|
|
|
|
|
|
|
- return AjaxResult.success(orderService.selectLiveOrderByOrderId(orderId));
|
|
|
|
|
|
|
+ // 查询订单信息
|
|
|
|
|
+ LiveOrder order = orderService.selectLiveOrderByOrderId(orderId);
|
|
|
|
|
+ if (order == null) {
|
|
|
|
|
+ return AjaxResult.error("订单不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 处理是否可以申请售后
|
|
|
|
|
+ Integer isAfterSales = order.getIsAfterSales();
|
|
|
|
|
+
|
|
|
|
|
+ if (isAfterSales == 1) {
|
|
|
|
|
+ List<LiveOrderItem> orderItems = liveOrderItemService.selectCheckedByOrderId(Long.valueOf(orderId));
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(orderItems)) {
|
|
|
|
|
+ boolean anyAfterSales = orderItems.stream()
|
|
|
|
|
+ .anyMatch(item -> item.getIsAfterSales() != null && item.getIsAfterSales() == 1);
|
|
|
|
|
+ if (!anyAfterSales) {
|
|
|
|
|
+ isAfterSales = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 将计算后的isAfterSales设置到订单对象中
|
|
|
|
|
+ order.setIsAfterSales(isAfterSales);
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success(order);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Login
|
|
@Login
|