Authored by chenchao

Merge branch 'test6.8.6' into dev_order_6.8.6

... ... @@ -110,7 +110,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
}
if(orderStatus.getCode() == OrderStatus.HAS_PAYED.getCode() || orderStatus.getCode() == OrderStatus.SEND_OUT_TIMEOUT.getCode()){
/*if(orderStatus.getCode() == OrderStatus.HAS_PAYED.getCode() || orderStatus.getCode() == OrderStatus.SEND_OUT_TIMEOUT.getCode()){
TimeoutBo timeoutBo = ordersPayService.getDeliverLeftTime(uid, orderCode);
if(timeoutBo!=null && timeoutBo.getTimelimit().intValue() != DelayTime.MINUTES_36_HOURS * 60
&& timeoutBo.getStartTime()!=null && timeoutBo.getStartTime().intValue()>=deliveryMinutesService.getOnlineTime()){
... ... @@ -118,7 +118,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
buyerUid, orderCode);
OrderStatus.resetDescForSeller(orderStatus);
}
}
}*/
BuyerOrderGoods buyerOrderGoods = getBuyerOrderGoods(buyerUid, orderCode);
if (buyerOrderGoods == null){
... ...
... ... @@ -24,10 +24,12 @@ import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.GoodsInfo;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.AbsSellerOrderViewService;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.impl.processor.SellerOrderPrepareProcessor;
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
... ... @@ -89,6 +91,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
@Autowired
private SellerOrderPrepareProcessor sellerOrderPrepareProcessor;
@Autowired
private DeliveryMinutesService deliveryMinutesService;
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);
... ... @@ -387,6 +393,19 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
.statuStr(orderStatus.getStatusStr(tabType))
.detailDesc(orderStatus.getDetailDesc(tabType))
.build();
if(orderStatus.getCode() == OrderStatus.HAS_PAYED.getCode() || orderStatus.getCode() == OrderStatus.SEND_OUT_TIMEOUT.getCode()){
TimeoutBo timeoutBo = ordersPayService.getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode());
if(timeoutBo!=null && timeoutBo.getTimelimit().intValue() != DelayTime.MINUTES_36_HOURS * 60
&& timeoutBo.getStartTime()!=null && timeoutBo.getStartTime().intValue()>=deliveryMinutesService.getOnlineTime()){
logger.info("getStatusDetail resetDescForSeller , buyerUid {} orderCode is {},statusDetail {}", buyerOrder.getUid(),
buyerOrder.getOrderCode(),statusDetail);
statusDetail.setDetailDesc(statusDetail.getDetailDesc().replace("36","120"));
logger.info("getStatusDetail resetDescForSeller after, buyerUid {} orderCode is {},statusDetail {}", buyerOrder.getUid(),
buyerOrder.getOrderCode(),statusDetail);
}
}
if(orderStatus == OrderStatus.HAS_PAYED){
Integer deliverLeftTime = getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(), buyerOrder.getStatus());
if (deliverLeftTime != null){
... ...
package com.yohoufo.order.service.proxy;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Lists;
import com.yoho.core.cache.LocalCache;
import com.yoho.core.config.ConfigReader;
import com.yohobuy.ufo.model.order.resp.ExpressCompanyRespBo;
import com.yohoufo.common.utils.OrikaUtils;
import com.yohoufo.dal.order.model.ExpressCompany;
import com.yohoufo.order.model.bo.TradeBillsSummaryBo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import com.yohoufo.order.service.impl.AppraiseAddressService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* 动态获取发货时间
*/
@Component
public class DeliveryMinutesService {
private static final Logger logger = LoggerFactory.getLogger(DeliveryMinutesService.class);
@Autowired
private ConfigReader configReader;
public int getDeliverMinutesSecond(){
//缓存
private LocalCache localCache_onlineTime = new LocalCache();
private static final String ONLINE_TIME_CACHE_KEY = "sellerDeliverNewOnlineTimeCacheKey";
private LocalCache localCache_second = new LocalCache();
private static final String SECOND_CACHE_KEY = "sellerDeliverNoticeSecondCacheKey";
private LocalCache localCache_third = new LocalCache();
private static final String THIRD_CACHE_KEY = "sellerDeliverNoticeThirdCacheKey";
@PostConstruct
private void init() {
localCache_onlineTime.init(ONLINE_TIME_CACHE_KEY, 8, TimeUnit.HOURS, (String s, Object o) -> {
logger.info("init ONLINE_TIME_CACHE_KEY s = {}, o = {}", s, o);
return configReader.getInt("ufo.order.sellerDeliverNewOnlineTime",1548756000);
});
localCache_second.init(SECOND_CACHE_KEY, 9, TimeUnit.HOURS, (String s, Object o) -> {
logger.info("init SECOND_CACHE_KEY s = {}, o = {}", s, o);
return configReader.getInt("ufo.order.sellerDeliverNoticeSecond",108*60);
});
localCache_third.init(THIRD_CACHE_KEY, 10, TimeUnit.HOURS, (String s, Object o) -> {
logger.info("init THIRD_CACHE_KEY s = {}, o = {}", s, o);
return configReader.getInt("ufo.order.sellerDeliverNoticeThird",120*60);
});
}
public int getDeliverMinutesSecond(){
Object value=localCache_second.get(SECOND_CACHE_KEY);
if(null == value) {
return 108*60;
}
return (Integer) value;
}
public int getDeliverMinutesThird(){
return configReader.getInt("ufo.order.sellerDeliverNoticeThird",120*60);
Object value=localCache_third.get(THIRD_CACHE_KEY);
if(null == value) {
return 120*60;
}
return (Integer) value;
}
/**
... ... @@ -31,7 +84,11 @@ public class DeliveryMinutesService {
//上线时间 : 新的时间戳
public int getOnlineTime(){
return configReader.getInt("ufo.order.sellerDeliverNewOnlineTime",1548756000);
Object value=localCache_onlineTime.get(ONLINE_TIME_CACHE_KEY);
if(null == value) {
return 1548756000;
}
return (Integer) value;
}
... ...