Commit f947030f by wutong

处理Ebay平台费率的问题

parent bfe02c08
...@@ -932,9 +932,9 @@ public class OrderSyncJob extends PointJob { ...@@ -932,9 +932,9 @@ public class OrderSyncJob extends PointJob {
* 自己取汇率 * 自己取汇率
*/ */
if (orderCharge != null) { if (orderCharge != null) {
LocalDateTime exchangeDate = omsResult.getPaidTime() != null ? omsResult.getPaidTime() : omsResult.getCreateTime();
if (orderCharge.getAmountTotal() != null) { if (orderCharge.getAmountTotal() != null) {
BigDecimal sellerOrderExchangeRate = null; BigDecimal sellerOrderExchangeRate = null;
LocalDateTime exchangeDate = omsResult.getPaidTime() != null ? omsResult.getPaidTime() : omsResult.getCreateTime();
String orderCurrency = orderCharge.getAmountTotal().getCurrencyCode(); String orderCurrency = orderCharge.getAmountTotal().getCurrencyCode();
if (StringUtils.isEmpty(orderCharge.getAmountTotal().getCurrencyCode()) || orderCurrency.equals(Constant.RMB_CURRENCY_RMB)) { if (StringUtils.isEmpty(orderCharge.getAmountTotal().getCurrencyCode()) || orderCurrency.equals(Constant.RMB_CURRENCY_RMB)) {
orderCurrency = Constant.RMB_CURRENCY; orderCurrency = Constant.RMB_CURRENCY;
...@@ -944,16 +944,25 @@ public class OrderSyncJob extends PointJob { ...@@ -944,16 +944,25 @@ public class OrderSyncJob extends PointJob {
} }
dcBaseOmsOrder.setOrderCurrency(orderCurrency); dcBaseOmsOrder.setOrderCurrency(orderCurrency);
BigDecimal orderFinanceExchangeRate = CallBailunSystem.getMonthExchangeRate(orderCurrency, Constant.RMB_CURRENCY, exchangeDate); BigDecimal orderFinanceExchangeRate = CallBailunSystem.getMonthExchangeRate(orderCurrency, Constant.RMB_CURRENCY, exchangeDate);
dcBaseOmsOrder.setFinanceOrderExchangeRate(orderFinanceExchangeRate != null ? orderFinanceExchangeRate : BigDecimal.ZERO); dcBaseOmsOrder.setFinanceOrderExchangeRate(orderFinanceExchangeRate);
dcBaseOmsOrder.setSellerOrderExchangeRate(sellerOrderExchangeRate != null ? sellerOrderExchangeRate : BigDecimal.ZERO); dcBaseOmsOrder.setSellerOrderExchangeRate(sellerOrderExchangeRate);
} }
/**
* EBAY的平台费币种与订单币种可能不一致
*/
if (omsResult.getPlatformType() != null && PlatformType.Ebay.value().equals(omsResult.getPlatformType().toUpperCase()) && orderCharge.getCostPlatformFee() != null && !StringUtils.isEmpty(orderCharge.getCostPlatformFee().getCurrencyCode())) { if (omsResult.getPlatformType() != null && PlatformType.Ebay.value().equals(omsResult.getPlatformType().toUpperCase()) && orderCharge.getCostPlatformFee() != null && !StringUtils.isEmpty(orderCharge.getCostPlatformFee().getCurrencyCode())) {
String otherCurrency = orderCharge.getCostPlatformFee().getCurrencyCode(); String otherCurrency = orderCharge.getCostPlatformFee().getCurrencyCode();
BigDecimal sellerOtherExchangeRate = orderCharge.getCostPlatformFee().getExchangeRate(); BigDecimal sellerOtherExchangeRate = null;
BigDecimal otherFinanceExchangeRate = CallBailunSystem.getMonthExchangeRate(otherCurrency, Constant.RMB_CURRENCY, omsResult.getPaidTime() != null ? omsResult.getPaidTime() : omsResult.getCreateTime()); if (StringUtils.isEmpty(orderCharge.getCostPlatformFee().getCurrencyCode()) || otherCurrency.equals(Constant.RMB_CURRENCY_RMB)) {
otherCurrency = Constant.RMB_CURRENCY;
sellerOtherExchangeRate = BigDecimal.ONE;
} else {
sellerOtherExchangeRate = CallBailunSystem.getExchangeRate(otherCurrency, Constant.RMB_CURRENCY, exchangeDate);
}
dcBaseOmsOrder.setOtherCurrency(otherCurrency); dcBaseOmsOrder.setOtherCurrency(otherCurrency);
dcBaseOmsOrder.setFinanceOtherExchangeRate(otherFinanceExchangeRate != null ? otherFinanceExchangeRate : BigDecimal.ZERO); BigDecimal otherFinanceExchangeRate = CallBailunSystem.getMonthExchangeRate(otherCurrency, Constant.RMB_CURRENCY, omsResult.getPaidTime() != null ? omsResult.getPaidTime() : omsResult.getCreateTime());
dcBaseOmsOrder.setSellerOtherExchangeRate(sellerOtherExchangeRate != null ? sellerOtherExchangeRate : BigDecimal.ZERO); dcBaseOmsOrder.setFinanceOtherExchangeRate(otherFinanceExchangeRate);
dcBaseOmsOrder.setSellerOtherExchangeRate(sellerOtherExchangeRate);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment