Authored by mali

二手质检版

package com.yoho.ufo.order.constant;
import com.yoho.core.config.ConfigReader;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* Created by li.ma on 2019/4/15.
*/
@Service
public class OrderConfigConstant {
private static Map<Integer, String> orderAttributeMap = new HashMap<>();
static {
orderAttributeMap.put(OrderAttributes.ADVANCE_SALE.getCode(), "预售");
orderAttributeMap.put(OrderAttributes.OFFLINE.getCode(), "线下店");
orderAttributeMap.put(OrderAttributes.SECOND_HAND.getCode(), "二手");
orderAttributeMap.put(OrderAttributes.FLAW.getCode(), "全新瑕疵");
orderAttributeMap.put(OrderAttributes.COMMON_IN_STOCK.getCode(), "现货");
orderAttributeMap.put(OrderAttributes.QUICK_DELIVER.getCode(), "急速发货");
}
@Autowired
private ConfigReader configReader;
... ... @@ -16,4 +31,13 @@ public class OrderConfigConstant {
public boolean getVedioConfig() {
return configReader.getBoolean("ufo.Vedio.Config", true);
}
public static Map<Integer, String> getOrderAttributeMap() {
return orderAttributeMap;
}
public static String getOrderAttributeStr(Integer attribute) {
String attributeStr = orderAttributeMap.get(attribute);
return null == attributeStr ? "" : attributeStr;
}
}
... ...
... ... @@ -1612,6 +1612,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
resp.setAttributes(buyerOrder.getAttributes());
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(buyerOrder.getAttributes()));
//检查买家是否是线下店的用户
resp.setInnerBuyerType("0");
... ... @@ -2494,6 +2495,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setStatus(item.getStatus());
resp.setAttributes(item.getAttributes());
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes()));
respList.add(resp);
}
... ...