From d48079c9eeec9c4f19f550a44d461275b4a31fd4 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期一, 01 六月 2020 16:47:59 +0800
Subject: [PATCH] 云发单

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java |   74 +++++++++++++++++++++++++++++++++++++
 1 files changed, 74 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 1224e9b..f132889 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
@@ -6,7 +6,9 @@
 import com.yeshi.fanli.entity.jd.JDOrderItem;
 import com.yeshi.fanli.entity.order.CommonOrder;
 import com.yeshi.fanli.entity.pdd.PDDOrder;
+import com.yeshi.fanli.entity.suning.SuningOrderInfo;
 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;
@@ -68,6 +70,7 @@
 		commonOrder.setThirdCreateTime(new Date(order.getOrderCreateTime() * 1000));
 		commonOrder.setUpdateTime(new Date());
 		commonOrder.setTradeId(order.getOrderId());
+		commonOrder.setChildSourceType("鎷煎澶�");
 		return commonOrder;
 	}
 
@@ -123,6 +126,7 @@
 		commonOrder.setUpdateTime(new Date());
 		commonOrder.setTradeId(order.getTradeId());
 		commonOrder.setEstimate(order.getEstimateFee());
+		commonOrder.setChildSourceType("浜笢");
 		return commonOrder;
 	}
 
@@ -164,4 +168,74 @@
 
 		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;
+	}
+
+	public static CommonOrder create(SuningOrderInfo order) {
+		CommonOrder commonOrder = new CommonOrder();
+		commonOrder.setCount(Integer.parseInt(order.getSaleNum()));
+		commonOrder.setCreateTime(new Date());
+		if ("纭鏀惰揣".equalsIgnoreCase(order.getOrderLineStatusDesc())) {
+			commonOrder.seteIncome(new BigDecimal(order.getPrePayCommission()));
+			commonOrder.setSettlement(new BigDecimal(order.getPayAmount()));
+			commonOrder.setSettleTime(
+					new Date(TimeUtil.convertToTimeTemp(order.getOrderLineStatusChangeTime(), "yyyy-MM-dd HH:mm:ss")));
+		}
+		commonOrder.setOrderNo(order.getOrderCode() + "");
+		commonOrder.setPayment(new BigDecimal(order.getPayAmount()));
+		commonOrder.setSourcePosition(order.getPositionId());
+		commonOrder.setSourceType(Constant.SOURCE_TYPE_SUNING);
+		int state = 0;
+		if ("绛夊緟浠樻".equalsIgnoreCase(order.getOrderLineStatusDesc()))
+			state = CommonOrder.STATE_FK;
+		else if ("鏀粯瀹屾垚".equalsIgnoreCase(order.getOrderLineStatusDesc()))
+			state = CommonOrder.STATE_FK;
+		else if ("閫�娆�".equalsIgnoreCase(order.getOrderLineStatusDesc()))
+			state = CommonOrder.STATE_SX;
+		else if ("璁㈠崟宸插彇娑�".equalsIgnoreCase(order.getOrderLineStatusDesc()))
+			state = CommonOrder.STATE_SX;
+		else if ("纭鏀惰揣".equalsIgnoreCase(order.getOrderLineStatusDesc()))
+			state = CommonOrder.STATE_JS;
+
+		commonOrder.setOrderBy(1);
+		commonOrder.setState(state);
+		commonOrder.setThirdCreateTime(
+				new Date(TimeUtil.convertToTimeTemp(order.getOrderSubmitTime(), "yyyy-MM-dd HH:mm:ss")));
+		commonOrder.setUpdateTime(new Date());
+		commonOrder.setTradeId(order.getOrderLineNumber());
+		commonOrder.setEstimate(new BigDecimal(order.getPrePayCommission()));
+		commonOrder.setChildSourceType("鑻忓畞");
+		return commonOrder;
+	}
 }

--
Gitblit v1.8.0