Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wanglf3 2024-03-14 17:50:18 +08:00
commit 735aef85cb
2 changed files with 10 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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();
}
}