parent
538c210ea6
commit
5672ab5cfa
File diff suppressed because one or more lines are too long
@ -0,0 +1,27 @@ |
||||
package com.hai.order.service; |
||||
|
||||
import com.hai.entity.HighChildOrder; |
||||
|
||||
/** |
||||
* 退款订单-业务处理 |
||||
* @className: CreateOrderCheckService |
||||
* @author: HuRui |
||||
* @date: 2022/8/25 |
||||
**/ |
||||
public interface OrderRefundHandleService { |
||||
|
||||
/** |
||||
* 卡券业务 |
||||
* @param childOrder 子订单 |
||||
* @return |
||||
* @throws Exception |
||||
*/ |
||||
void couponHandle(HighChildOrder childOrder) ; |
||||
|
||||
/** |
||||
* 加油业务 |
||||
* @param childOrder |
||||
*/ |
||||
void oilHandle(HighChildOrder childOrder) ; |
||||
|
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.hai.order.service.impl; |
||||
|
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.entity.HighChildOrder; |
||||
import com.hai.entity.HighGasOrder; |
||||
import com.hai.order.service.OrderRefundHandleService; |
||||
import com.hai.order.type.OrderOilStatus; |
||||
import com.hai.service.HighGasOrderService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @className: OrderRefundHandleServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2022/9/23 |
||||
**/ |
||||
@Service("orderRefundHandleService") |
||||
public class OrderRefundHandleServiceImpl implements OrderRefundHandleService { |
||||
|
||||
@Resource |
||||
private HighGasOrderService gasOrderService; |
||||
|
||||
@Override |
||||
public void couponHandle(HighChildOrder childOrder) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void oilHandle(HighChildOrder childOrder) { |
||||
// 查询加油订单
|
||||
HighGasOrder gasOrder = gasOrderService.getDetailByChildOrderNo(childOrder.getChildOrderNo()); |
||||
if (gasOrder == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油订单"); |
||||
} |
||||
if (!gasOrder.getStatus().equals(OrderOilStatus.STATUS2.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "加油订单不处于已支付状态"); |
||||
} |
||||
gasOrder.setRefundTime(childOrder.getRefundTime()); |
||||
gasOrder.setStatus(OrderOilStatus.STATUS4.getNumber()); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
} |
||||
} |
Loading…
Reference in new issue