From 110c73f31ecfd0dbd7299a0cfd39095d100cb923 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 22 五月 2020 13:52:29 +0800 Subject: [PATCH] 唯品会订单相关代码 --- fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java index 97c9d02..9ae4489 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java @@ -7,6 +7,7 @@ import com.yeshi.fanli.entity.order.CommonOrder; import com.yeshi.fanli.entity.pdd.PDDOrder; import com.yeshi.fanli.entity.taobao.TaoBaoOrder; +import com.yeshi.fanli.entity.vipshop.VipShopOrderDetail; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.MoneyBigDecimalUtil; import com.yeshi.fanli.util.StringUtil; @@ -166,4 +167,37 @@ return commonOrder; } + + public static CommonOrder create(VipShopOrderDetail order) { + if (order.getOrder() == null) + return null; + CommonOrder commonOrder = new CommonOrder(); + commonOrder.setCount(order.getGoodsCount()); + commonOrder.setCreateTime(new Date()); + if (order.getStatus() == VipShopOrderDetail.STATUS_FINISH) { + commonOrder.seteIncome(order.getCommission()); + commonOrder.setSettlement(order.getCommissionTotalCost()); + commonOrder.setSettleTime(new Date(order.getOrder().getCommissionEnterTime())); + } + commonOrder.setOrderNo(order.getOrderSn() + ""); + commonOrder.setPayment(order.getCommissionTotalCost()); + commonOrder.setSourcePosition(order.getOrder().getChannelTag()); + commonOrder.setSourceType(Constant.SOURCE_TYPE_VIP); + int state = 0; + if (order.getStatus() == VipShopOrderDetail.STATUS_FINISH) + state = CommonOrder.STATE_JS; + else if (order.getStatus() == VipShopOrderDetail.STATUS_INVALID) + state = CommonOrder.STATE_SX; + else if (order.getStatus() == VipShopOrderDetail.STATUS_UNKOWN) + state = CommonOrder.STATE_FK; + + commonOrder.setOrderBy(1); + commonOrder.setState(state); + commonOrder.setThirdCreateTime(new Date(order.getOrder().getOrderTime())); + commonOrder.setUpdateTime(new Date()); + commonOrder.setTradeId(order.getIdentifyCode()); + commonOrder.setEstimate(order.getCommission()); + commonOrder.setChildSourceType("鍞搧浼�"); + return commonOrder; + } } -- Gitblit v1.8.0