package cn.momia.service.deal.web.ctrl.dto;

import cn.momia.service.deal.order.Order;
import cn.momia.api.product.Product;
import cn.momia.service.base.web.ctrl.dto.Dto;

import java.math.BigDecimal;

public class OrderDetailDto extends OrderDto implements Dto {
    private Product product;

    public String getCover() {
        return product.getCover();
    }

    public String getTitle() {
        return product.getTitle();
    }

    public String getScheduler() {
        return product.getScheduler();
    }

    // TODO
//    public String getRegion() {
//        return MetaUtil.getRegionName(product.getRegionId());
//    }

    public String getAddress() {
        return product.getAddress();
    }

    public BigDecimal getPrice() {
        return product.getPrice();
    }

    public String getTime() {
        return product.getSkuTime(getSkuId());
    }

    public OrderDetailDto(Order order, Product product) {
        super(order);
        this.product = product;
    }
}

@@ -34,24 +34,61 @@
 .ctrl.dto;%0A%0A
+import cn.momia.api.product.sku.Sku;%0A
 import cn.mo
@@ -230,16 +230,39 @@
 Decimal;
+%0Aimport java.util.List;
 %0A%0Apublic
@@ -923,32 +923,304 @@
 kuId());%0A    %7D%0A%0A
+    public boolean isClosed() %7B%0A        List%3CSku%3E skus = product.getSkus();%0A        if (skus == null %7C%7C skus.isEmpty()) return true;%0A        for (Sku sku : skus) %7B%0A            if (sku.getSkuId() == getSkuId()) return sku.isClosed();%0A        %7D%0A%0A        return true;%0A    %7D%0A%0A
     public Order

add sku close in order detail