|
|
@ -8,12 +8,10 @@ import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.security.AESEncodeUtil; |
|
|
|
import com.hai.common.security.AESEncodeUtil; |
|
|
|
import com.hai.common.utils.DateUtil; |
|
|
|
|
|
|
|
import com.hai.dao.HighChildOrderMapper; |
|
|
|
import com.hai.dao.HighChildOrderMapper; |
|
|
|
import com.hai.dao.HighOrderMapper; |
|
|
|
import com.hai.dao.HighOrderMapper; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.enum_type.DiscountUseScope; |
|
|
|
import com.hai.enum_type.DiscountUseScope; |
|
|
|
import com.hai.enum_type.OrderStatusEnum; |
|
|
|
|
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
import com.hai.order.model.CreateOrderModel; |
|
|
|
import com.hai.order.model.CreateOrderModel; |
|
|
|
import com.hai.order.model.RefundPriceModel; |
|
|
|
import com.hai.order.model.RefundPriceModel; |
|
|
@ -24,8 +22,6 @@ import com.hai.order.utils.OrderUtil; |
|
|
|
import com.hai.service.*; |
|
|
|
import com.hai.service.*; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.rocketmq.client.producer.SendCallback; |
|
|
|
|
|
|
|
import org.apache.rocketmq.client.producer.SendResult; |
|
|
|
|
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate; |
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate; |
|
|
|
import org.springframework.integration.support.MessageBuilder; |
|
|
|
import org.springframework.integration.support.MessageBuilder; |
|
|
|
import org.springframework.messaging.Message; |
|
|
|
import org.springframework.messaging.Message; |
|
|
@ -506,7 +502,7 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
timeout = 10, |
|
|
|
timeout = 10, |
|
|
|
rollbackFor = Exception.class) |
|
|
|
rollbackFor = Exception.class) |
|
|
|
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order") |
|
|
|
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order") |
|
|
|
public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception { |
|
|
|
public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception { |
|
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber()) |
|
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber()) |
|
|
|
&& !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) { |
|
|
|
&& !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); |
|
|
@ -569,7 +565,7 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
timeout = 10, |
|
|
|
timeout = 10, |
|
|
|
rollbackFor = Exception.class) |
|
|
|
rollbackFor = Exception.class) |
|
|
|
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order") |
|
|
|
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order") |
|
|
|
public HighOrder refundChildOrder(HighOrder order,String childOrderNo,Integer refundGoodsNum, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception { |
|
|
|
public HighOrder refundChildOrder(HighOrder order, String childOrderNo, Integer refundGoodsNum, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception { |
|
|
|
List<HighChildOrder> collect = order.getHighChildOrderList().stream().filter(o -> o.getChildOrderNo().equals(childOrderNo)).collect(Collectors.toList()); |
|
|
|
List<HighChildOrder> collect = order.getHighChildOrderList().stream().filter(o -> o.getChildOrderNo().equals(childOrderNo)).collect(Collectors.toList()); |
|
|
|
if (collect == null || collect.size() == 0) { |
|
|
|
if (collect == null || collect.size() == 0) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|