From 81da61b828e29b7745e1382dfbbaeb685dc083ef Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 23 一月 2024 17:17:55 +0800 Subject: [PATCH] 抖音转链修改 --- fanli/src/main/java/com/yeshi/fanli/util/factory/order/dividents/TeamDividentsSourceOrderFactory.java | 109 +++++++++++++++++++++++++++--------------------------- 1 files changed, 55 insertions(+), 54 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/order/dividents/TeamDividentsSourceOrderFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/order/dividents/TeamDividentsSourceOrderFactory.java index c8a739a..0c34b2b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/order/dividents/TeamDividentsSourceOrderFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/order/dividents/TeamDividentsSourceOrderFactory.java @@ -1,54 +1,55 @@ -package com.yeshi.fanli.util.factory.order.dividents; - -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import com.yeshi.fanli.entity.order.CommonOrder; -import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder; -import com.yeshi.fanli.util.TimeUtil; -import com.yeshi.fanli.util.order.CommonOrderUtil; - -public class TeamDividentsSourceOrderFactory { - - public static TeamDividentsSourceOrder create(List<CommonOrder> commonOrderList) { - BigDecimal money = null; - int orderState = CommonOrderUtil.getState(commonOrderList); - if (orderState == CommonOrder.STATE_SX) - return null; - - if (orderState == CommonOrder.STATE_FK) { - money = CommonOrderUtil.computeEstimate(commonOrderList); - } else { - money = CommonOrderUtil.computeIncome(commonOrderList); - } - - if (money.compareTo(new BigDecimal(0)) <= 0) - return null; - - TeamDividentsSourceOrder sourceOrder = new TeamDividentsSourceOrder(); - sourceOrder.setMoney(money); - sourceOrder.setOrderNo(commonOrderList.get(0).getOrderNo()); - sourceOrder.setSourceType(commonOrderList.get(0).getSourceType()); - - if (orderState == CommonOrder.STATE_JS || orderState == CommonOrder.STATE_WQ) { - sourceOrder.setState(TeamDividentsSourceOrder.STATE_CAN_SEND); - Date settlementTime = CommonOrderUtil.getSettlementTime(commonOrderList); - if (settlementTime == null) - return null; - - Calendar calendar = Calendar.getInstance(); - calendar.setTime(settlementTime); - calendar.add(Calendar.MONTH, 1); - sourceOrder.setPreSendTime(new Date(TimeUtil.convertToTimeTemp( - calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25", "yyyy-M-dd"))); - } else { - sourceOrder.setState(TeamDividentsSourceOrder.STATE_UNKOWN); - } - sourceOrder.setUid(commonOrderList.get(0).getUserInfo().getId()); - - return sourceOrder; - } - -} +package com.yeshi.fanli.util.factory.order.dividents; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import com.yeshi.fanli.entity.order.CommonOrder; +import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder; +import org.yeshi.utils.TimeUtil; +import com.yeshi.fanli.util.order.CommonOrderUtil; + +public class TeamDividentsSourceOrderFactory { + + public static TeamDividentsSourceOrder create(List<CommonOrder> commonOrderList) { + BigDecimal money = null; + int orderState = CommonOrderUtil.getState(commonOrderList); + if (orderState == CommonOrder.STATE_SX) + return null; + + if (orderState == CommonOrder.STATE_FK) { + money = CommonOrderUtil.computeEstimate(commonOrderList); + } else { + money = CommonOrderUtil.computeIncome(commonOrderList); + } + + if (money.compareTo(new BigDecimal(0)) <= 0) + return null; + + TeamDividentsSourceOrder sourceOrder = new TeamDividentsSourceOrder(); + sourceOrder.setMoney(money); + sourceOrder.setOrderNo(commonOrderList.get(0).getOrderNo()); + sourceOrder.setSourceType(commonOrderList.get(0).getSourceType()); + + if (orderState == CommonOrder.STATE_JS || orderState == CommonOrder.STATE_WQ) { + sourceOrder.setState(TeamDividentsSourceOrder.STATE_CAN_SEND); + Date settlementTime = CommonOrderUtil.getSettlementTime(commonOrderList); + if (settlementTime == null) + return null; + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(settlementTime); + calendar.add(Calendar.MONTH, 1); + sourceOrder.setPreSendTime(new Date(TimeUtil.convertToTimeTemp( + calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25", "yyyy-M-dd"))); + } else { + sourceOrder.setState(TeamDividentsSourceOrder.STATE_UNKOWN); + } + sourceOrder.setUid(commonOrderList.get(0).getUserInfo().getId()); + sourceOrder.setCreateTime(commonOrderList.get(0).getThirdCreateTime());//涓嬪崟鏃堕棿 + + return sourceOrder; + } + +} -- Gitblit v1.8.0