Commit 06de27ab by yinyong

FBA平台费为空读取历史数据

parent e66e90f0
......@@ -139,7 +139,9 @@ public class OrderSyncJob extends PointJob {
//SKU总个数
dcBaseOmsOrder.setQuantityBailunSku(bailunSkuCumulative.getTotalQuantity());
//计算每个SKU采购价占总采购价比重(用于摊分SKU售价之类) 以及 每个SKU重量价占总重量的比重
BigDecimal omsOrderFBAFee = BigDecimal.valueOf(0);
BigDecimal omsOrderFBAFee = BigDecimal.ZERO;
BigDecimal totalCostPlatformFee = BigDecimal.ZERO;
boolean hasCostPlatformFee = true;
dcBaseOmsOrder.setHasFbaFee(false);
for (BailunSku bailunSkuObj : omsResult.getBailunSku()) {
BailunSkuStructure bailunSkuStructure = new BailunSkuStructure();
......@@ -204,6 +206,13 @@ public class OrderSyncJob extends PointJob {
dcBaseOmsSku.setCostFbaFee(FBAFee == null ? BigDecimal.valueOf(0) : FBAFee);
omsOrderFBAFee = omsOrderFBAFee.add(dcBaseOmsSku.getCostFbaFee());
}
if((dcBaseOmsOrder.getCostPlatformFee().compareTo(BigDecimal.ZERO) == 0) && (initTotalCost.compareTo(BigDecimal.valueOf(0)) == 1)) {
DcBaseOmsSkuMapper dcBaseOmsSkuMapper = SessionUtil.getSession().getMapper(DcBaseOmsSkuMapper.class);
BigDecimal costPlatformFee = dcBaseOmsSkuMapper.selectCostPlatformFee(dcBaseOmsSku.getBailunSku(), dcBaseOmsSku.getWebsite());
totalCostPlatformFee = totalCostPlatformFee.add(costPlatformFee == null ? BigDecimal.ZERO : costPlatformFee);
hasCostPlatformFee = false;
}
//FBA的发货数不用从配货单信息拿, FBA只要下单亚马逊就发货
dcBaseOmsSku.setBailunSkuQuantityShipped(bailunSkuObj.getBailunSkuQuantityOrdered());
checkFbaFee(dcBaseOmsSku, dcBaseOmsOrder);
......@@ -214,6 +223,9 @@ public class OrderSyncJob extends PointJob {
if(!dcBaseOmsOrder.getHasFbaFee()) {
dcBaseOmsOrder.setCostFbaFee(omsOrderFBAFee);
}
if(!hasCostPlatformFee) {
dcBaseOmsOrder.setCostPlatformFee(totalCostPlatformFee);
}
/*
* 按规则计算百伦处理费
* 处理费算到订单维度
......
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