Authored by chenchao

fix seller show buyer left time

... ... @@ -27,6 +27,7 @@ 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.springframework.beans.factory.annotation.Autowired;
... ... @@ -134,13 +135,21 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
return orderListInfoRsp;
}
@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());
... ...