...
|
...
|
@@ -11,8 +11,10 @@ import com.yohobuy.ufo.model.order.constants.DepotType; |
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderDetailDesc;
|
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.CouponInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohoufo.common.config.SpecialTimeConfigReader;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
...
|
...
|
@@ -26,14 +28,13 @@ import com.yohoufo.order.convert.SellerOrderConvertor; |
|
|
import com.yohoufo.order.model.bo.DetailItem;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
|
import com.yohoufo.order.model.request.OrderRequest;
|
|
|
import com.yohobuy.ufo.model.order.resp.AppraiseAddressInfo;
|
|
|
import com.yohoufo.order.model.response.AppraiseAddressResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
|
|
|
import com.yohoufo.order.mq.DelayTime;
|
|
|
import com.yohoufo.order.service.IOrderDetailService;
|
|
|
import com.yohoufo.order.service.cache.OrderCacheService;
|
|
|
import com.yohoufo.order.service.proxy.ResourcesProxyService;
|
|
|
import com.yohoufo.order.service.proxy.UserProxyService;
|
|
|
import com.yohoufo.order.service.seller.SellerOrderServiceDelegate;
|
|
|
import com.yohoufo.order.service.seller.orderMeta.SellerAddressService;
|
|
|
import com.yohoufo.order.service.seller.view.ButtonShowFactory;
|
|
|
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
|
...
|
...
|
@@ -41,14 +42,12 @@ import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta; |
|
|
import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper;
|
|
|
import com.yohoufo.order.utils.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Predicate;
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -103,10 +102,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
@Autowired
|
|
|
private SpecialTimeConfigReader specialTimeConfigReader;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderServiceDelegate sellerOrderServiceDelegate;
|
|
|
|
|
|
|
|
|
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
|
|
|
|
|
private static final List<Long> SELLER_TYPES = Arrays.asList(OrderCodeType.SELLER_TYPE.getType());
|
|
|
|
...
|
...
|
@@ -178,8 +177,11 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
orderDetailInfo = orderCacheService.getOrderDetailInfo(uid, orderCode, TabType.SELL);
|
|
|
if (Objects.isNull(orderDetailInfo)) {
|
|
|
fromCache = false;
|
|
|
//
|
|
|
BuildNode buildNode = super.prepareBuild(orderRequest);
|
|
|
orderDetailInfo = super.buildOrderDetail(buildNode);
|
|
|
//
|
|
|
orderDetailInfo.setOrderCodeType(OrderCodeType.BUYER_TYPE);
|
|
|
SellerOrderGoods sellerOrderGoods = buildNode.sellerOrderGoods;
|
|
|
BuyerOrder pbo = buildNode.buyerOrder;
|
|
|
SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
|
...
|
...
|
@@ -230,25 +232,28 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
|
|
|
|
|
|
void assembleSoldPrdCompute(OrderDetailInfo orderDetailInfo, int uid, int skup){
|
|
|
SellerOrderMeta feeMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE);
|
|
|
boolean metaIsPresent = Objects.nonNull(feeMeta);
|
|
|
|
|
|
SellerOrderComputeResult computeResult = sellerOrderServiceDelegate.getSellerFeeService().getSellerOrderComputeResult(uid,skup);
|
|
|
boolean computeResultIsPresent = Objects.nonNull(computeResult);
|
|
|
|
|
|
SoldPrdComputeBo computeBo = null;
|
|
|
if(metaIsPresent){
|
|
|
SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class);
|
|
|
if(computeResultIsPresent){
|
|
|
Supplier<Map<String,String>> tipsConfigSupplier = () -> resourcesProxyService.getServiceTipsConfig();
|
|
|
computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult, tipsConfigSupplier);
|
|
|
}
|
|
|
if(Objects.nonNull(computeBo)){
|
|
|
if (computeBo.getEarnestMoney() > 0D) {
|
|
|
orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
}
|
|
|
orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
CouponInfo couponInfo;
|
|
|
orderDetailInfo.setCouponCutAmount(Objects.isNull(couponInfo = computeBo.getCouponInfo()) ? null : couponInfo.getCouponAmountStr());
|
|
|
orderDetailInfo.setIncome(computeBo.getIncome());
|
|
|
if (Objects.isNull(computeBo)){
|
|
|
logger.debug("assembleSoldPrdCompute fail,SellerOrderComputeResult illegal,orderDetailInfo {}", orderDetailInfo);
|
|
|
return;
|
|
|
}
|
|
|
if (computeBo.getEarnestMoney() > 0D) {
|
|
|
orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
}
|
|
|
orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
CouponInfo couponInfo;
|
|
|
orderDetailInfo.setCouponCutAmount(Objects.isNull(couponInfo = computeBo.getCouponInfo()) ? null : couponInfo.getCouponAmountStr());
|
|
|
orderDetailInfo.setIncome(computeBo.getIncome());
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -402,6 +407,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
SellerType sellerType, String appVersion
|
|
|
) {
|
|
|
OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
|
|
|
orderDetailInfo.setOrderCodeType(OrderCodeType.SELLER_TYPE);
|
|
|
orderDetailInfo.setUid(order.getUid());
|
|
|
orderDetailInfo.setOrderCode(getOrderCode(skupStatus, order));
|
|
|
//求购订单类型
|
...
|
...
|
@@ -606,49 +612,50 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
CodeMeta codeMeta = orderCode == null ? null : orderCodeGenerator.expId(orderCode);
|
|
|
//TabType tabType = TabType.SELL;
|
|
|
Integer orderStatus = null;
|
|
|
if (codeMeta!=null) {
|
|
|
|
|
|
Integer buyerUid=null;
|
|
|
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
|
|
|
OrderAttributes oa = null;
|
|
|
TimeoutBo timeoutBo = null;
|
|
|
if(orderCodeType.getType() == OrderCodeType.BUYER_TYPE.getType()){
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
buyerUid = buyerOrder.getUid();
|
|
|
orderStatus = buyerOrder.getStatus();
|
|
|
oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
|
|
|
timeoutBo = getTimeoutBo(buyerUid, orderCode,
|
|
|
orderDetailInfo.getBidType(),
|
|
|
buyerOrder.getStatusStartTime(),
|
|
|
orderStatus,
|
|
|
oa, TabType.SELL, orderDetailInfo.getBidDepositInfo());
|
|
|
}else{
|
|
|
orderStatus = orderDetailInfo.getStatusDetail().getStatus();
|
|
|
Integer createTime = orderDetailInfo.getSecendLevelCreateTime();
|
|
|
timeoutBo = calTimeout(TabType.SELL, buyerUid, orderCode,
|
|
|
orderDetailInfo.getBidType(),
|
|
|
orderStatus, createTime, oa);
|
|
|
}
|
|
|
Integer leftTime = timeoutBo.getLeftTime();
|
|
|
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
|
|
|
|
|
|
if (leftTime!=null && leftTime<=0){
|
|
|
orderDetailInfo.getButtons().removeIf(x-> x!=null &&
|
|
|
(ButtonShow.NOW_BUY.getCode().equals(x.getCode()) || ButtonShow.PAY_EARNESTMONEY.getCode().equals(x.getCode())));
|
|
|
}
|
|
|
if (Objects.isNull(codeMeta)){
|
|
|
logger.debug("resetDynamicProporties orderCode illegal,orderDetailInfo {}, appVersion {}", orderDetailInfo, appVersion);
|
|
|
return;
|
|
|
}
|
|
|
Integer buyerUid=null;
|
|
|
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
|
|
|
OrderAttributes oa = null;
|
|
|
TimeoutBo timeoutBo = null;
|
|
|
if(orderCodeType.getType() == OrderCodeType.BUYER_TYPE.getType()){
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
buyerUid = buyerOrder.getUid();
|
|
|
orderStatus = buyerOrder.getStatus();
|
|
|
oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
|
|
|
timeoutBo = getTimeoutBo(buyerUid, orderCode,
|
|
|
orderDetailInfo.getBidType(),
|
|
|
buyerOrder.getStatusStartTime(),
|
|
|
orderStatus,
|
|
|
oa, TabType.SELL, orderDetailInfo.getBidDepositInfo());
|
|
|
}else{
|
|
|
orderStatus = orderDetailInfo.getStatusDetail().getStatus();
|
|
|
Integer createTime = orderDetailInfo.getSecendLevelCreateTime();
|
|
|
timeoutBo = calTimeout(TabType.SELL, buyerUid, orderCode,
|
|
|
orderDetailInfo.getBidType(),
|
|
|
orderStatus, createTime, oa);
|
|
|
}
|
|
|
Integer leftTime = timeoutBo.getLeftTime();
|
|
|
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
|
|
|
|
|
|
if(orderCodeType.getType() == OrderCodeType.SELLER_TYPE.getType()) {
|
|
|
OrderDetailInfo.StatusDetail statusDetail = orderDetailInfo.getStatusDetail();
|
|
|
Integer skupStatusCode = statusDetail.getStatus();
|
|
|
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
|
|
|
Integer soga = orderDetailInfo.getAttributes();
|
|
|
if (leftTime!=null && leftTime<=0){
|
|
|
orderDetailInfo.getButtons().removeIf(x-> x!=null &&
|
|
|
(ButtonShow.NOW_BUY.getCode().equals(x.getCode()) || ButtonShow.PAY_EARNESTMONEY.getCode().equals(x.getCode())));
|
|
|
}
|
|
|
|
|
|
SkupType skupType = SkupType.getSkupType(soga);
|
|
|
GoodsInfo goodsInfo = orderDetailInfo.getGoodsInfo();
|
|
|
resetPriceOfProduct(goodsInfo, skupStatusCode, skupType);
|
|
|
boolean pushFlag = OrderAssist.skupPushWhenHasLowerPrice(soga);
|
|
|
resetDetailDesc( skupType, skupStatus, goodsInfo, orderDetailInfo.getStatusDetail(),appVersion,pushFlag);
|
|
|
}
|
|
|
if(orderCodeType.getType() == OrderCodeType.SELLER_TYPE.getType()) {
|
|
|
OrderDetailInfo.StatusDetail statusDetail = orderDetailInfo.getStatusDetail();
|
|
|
Integer skupStatusCode = statusDetail.getStatus();
|
|
|
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
|
|
|
Integer soga = orderDetailInfo.getAttributes();
|
|
|
|
|
|
SkupType skupType = SkupType.getSkupType(soga);
|
|
|
GoodsInfo goodsInfo = orderDetailInfo.getGoodsInfo();
|
|
|
resetPriceOfProduct(goodsInfo, skupStatusCode, skupType);
|
|
|
boolean pushFlag = OrderAssist.skupPushWhenHasLowerPrice(soga);
|
|
|
resetDetailDesc( skupType, skupStatus, goodsInfo, orderDetailInfo.getStatusDetail(),appVersion,pushFlag);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|