Authored by chenchao

fix

... ... @@ -4,10 +4,7 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.common.SellerOrderListType;
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
import com.yohobuy.ufo.model.order.common.SellerType;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
... ... @@ -30,6 +27,8 @@ import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.impl.processor.SellerOrderPrepareProcessor;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
... ... @@ -153,14 +152,21 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
void setAddressInfo(OrderListInfo orderListInfo) {
}
@Autowired
private OrderCodeGenerator orderCodeGenerator;
@Override
protected void resetDynamicProporties(List<OrderListInfo> list, int type) {
if(CollectionUtils.isNotEmpty(list)){
list.forEach(oli -> {
if (oli.getStatus() == SkupStatus.CAN_NOT_SELL.getCode()){
oli.setLeftTime(calLeftTime(OrderInfo.SELLER_PAY_TIMEOUT, oli.getSecendLevelCreateTime()));
long orderCode = oli.getOrderCode();
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
TabType tabType = TabType.SELL;
Integer orderStatus = oli.getStatus();
if (codeMeta!=null && codeMeta.getType() == OrderCodeType.BUYER_TYPE.getType()){
tabType = TabType.BUY;
}
oli.setLeftTime(getPayLeftTime(tabType, orderStatus, oli.getSecendLevelCreateTime()));
if(SellerOrderListType.WAITING_PAY.getType() == type) {
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(oli.getBuyerUid(), oli.getOrderCode());
... ...