Commit 24cf3b29 by wutong

修改订单处理费计算

parent eb84d031
......@@ -14,7 +14,6 @@ public class BailunSkuCumulative {
private BigDecimal maxSkuWidth;//最大SKU宽
private BigDecimal maxSkuHight;//最大SKU高
private Integer totalQuantity;//累计销售数量
private Integer countSelfProducrSku;//自产美容SKU销售数量
private Boolean domesticOrOverseas;//国内仓或海外仓, true是国内仓
}
......@@ -601,7 +601,7 @@ public class OrderSyncJob extends PointJob {
private void caculateBailunHandleFee(DcBaseOmsOrder dcBaseOmsOrder, BailunSkuCumulative bailunSkuCumulative) {
BigDecimal costBailunHandle = BigDecimal.ONE;//海外仓和FBA 的,都是直接1元一个单
if(bailunSkuCumulative.getDomesticOrOverseas()) {
switch (bailunSkuCumulative.getCountSelfProducrSku()) {
switch (bailunSkuCumulative.getTotalQuantity()) {
case 0:
costBailunHandle = BigDecimal.ZERO;
break;
......@@ -615,7 +615,7 @@ public class OrderSyncJob extends PointJob {
case 8:
case 9:
case 10:
costBailunHandle = BigDecimal.valueOf(0.3).multiply(BigDecimal.valueOf(bailunSkuCumulative.getCountSelfProducrSku() - 1)).add(BigDecimal.ONE);
costBailunHandle = BigDecimal.valueOf(0.3).multiply(BigDecimal.valueOf(bailunSkuCumulative.getTotalQuantity() - 1)).add(BigDecimal.ONE);
break;
default:
costBailunHandle = BigDecimal.valueOf(3.7);//超过10个只取10个的费用
......@@ -632,7 +632,6 @@ public class OrderSyncJob extends PointJob {
bailunSkuCumulative.setMaxSkuHight(BigDecimal.ZERO);
bailunSkuCumulative.setTotalWeight(BigDecimal.ZERO);
bailunSkuCumulative.setTotalQuantity(0);
Integer countSelfProducrSku = 0;
for (BailunSku bailunSku : omsResult.getBailunSku()) {
if (bailunSku.getBailunSkuWeight() == null) {
bailunSku.setBailunSkuWeight(BigDecimal.ZERO);
......@@ -667,20 +666,7 @@ public class OrderSyncJob extends PointJob {
bailunSkuCumulative.setMaxSkuLong(skuHeight);
}
}
try {
DcBaseOmsHandleMapper mapper = SessionUtil.getSession().getMapper(DcBaseOmsHandleMapper.class);
DcBaseOmsHandle orderBailunCatagory = mapper.getOrderBailunCatagory(omsResult.getBailunSku().get(0).getBailunSku());
if (orderBailunCatagory != null) {//如果没有在这个表, 说明是普货类, 在这个表, 就是美容自产
countSelfProducrSku += bailunSku.getBailunSkuQuantityOrdered();
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败", e);
} finally {
SessionUtil.closeSession();
}
}
bailunSkuCumulative.setCountSelfProducrSku(countSelfProducrSku);
return bailunSkuCumulative;
}
......
......@@ -73,7 +73,7 @@ public class OmsOrderTest {
LinkedHashMap<String, String> map = new LinkedHashMap<>(4);
map.put("pageIndex", "1");
map.put("pageCount", "100");
map.put("OriginOrderNo", "263709100694-2446617013016");
map.put("OriginOrderNo", "293081293723-1685480773019");
Request request = new Request.Builder()
.get()
.url(OkHttpUtil.attachHttpGetParams("http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders", map))
......
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