增加携程退款订单
This commit is contained in:
parent
2f7bc11e4a
commit
7f73aa1a57
|
@ -9,9 +9,12 @@ public class CTripOrderRefundCommand extends Command {
|
|||
private String orderNo;
|
||||
private String amount;
|
||||
|
||||
public CTripOrderRefundCommand Info(String orderNo, String amount) {
|
||||
private String createTime;
|
||||
|
||||
public CTripOrderRefundCommand Info(String orderNo, String amount, String createTime) {
|
||||
this.orderNo = orderNo;
|
||||
this.amount = amount;
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class CTripOrderRecordAutoSave {
|
|||
record.setId(flightByRecordId.getId());
|
||||
}
|
||||
if (record.getAmount() < 0) {
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getAmount()));
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getAmount()), record.getCreateTime());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class CTripOrderRecordAutoSave {
|
|||
}
|
||||
|
||||
if (record.getAmount() < 0) {
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getAmount()));
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getAmount()), record.getCreateTime());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -113,7 +113,7 @@ public class CTripOrderRecordAutoSave {
|
|||
}
|
||||
|
||||
if (record.getRealAmount() < 0) {
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getRealAmount()));
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getRealAmount()), record.getCreateTime());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -133,17 +133,15 @@ public class CTripOrderRecordAutoSave {
|
|||
.map(CtripCarOrderDetail::changeInfo)
|
||||
.toList();
|
||||
|
||||
|
||||
//业务需求这里加入是否退款判断
|
||||
list.forEach(record -> {
|
||||
|
||||
CtripCarOrderDetail carByRecordId = cTripOrderDetailRepository.findCarByRecordId(record.getRecordId());
|
||||
if (carByRecordId != null) {
|
||||
record.setId(carByRecordId.getId());
|
||||
}
|
||||
|
||||
if (record.getRealAmount() < 0) {
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getRealAmount()));
|
||||
checkIfRefund(String.valueOf(record.getOrderId()), String.valueOf(record.getRealAmount()), record.getCreateTime());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -151,8 +149,8 @@ public class CTripOrderRecordAutoSave {
|
|||
}
|
||||
}
|
||||
|
||||
public void checkIfRefund(String orderNo, String amount) {
|
||||
public void checkIfRefund(String orderNo, String amount, String createTime) {
|
||||
System.out.println("开始触发创建携程退款订单");
|
||||
Command.of(CTripOrderRefundCommand.class).Info(orderNo, amount).sendToQueue();
|
||||
Command.of(CTripOrderRefundCommand.class).Info(orderNo, amount, createTime).sendToQueue();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue