Authored by chenchao

add goods head flag

... ... @@ -10,6 +10,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
import com.yohobuy.ufo.model.order.common.ButtonShow;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.utils.DateUtil;
... ... @@ -26,6 +27,7 @@ import com.yohoufo.order.service.IExpressInfoService;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.utils.BuyerOrderUtils;
import com.yohoufo.order.utils.OrderAssist;
import com.yohoufo.order.utils.SellerGoodsHelper;
import com.yohoufo.order.utils.TimeUtils;
import lombok.experimental.Builder;
import org.slf4j.Logger;
... ... @@ -183,6 +185,8 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
//good info
GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods);
SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
goodsInfo.setProductName(SellerGoodsHelper.addFlag2GoodsNameHead(goodsInfo.getProductName(), skupType));
if(isOffline) {
goodsInfo.setProductName("【门店订单】" + goodsInfo.getProductName());
}
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
... ... @@ -17,7 +16,10 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.service.IOrderListService;
... ... @@ -30,6 +32,7 @@ import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.OrderAssist;
import com.yohoufo.order.utils.SellerGoodsHelper;
import com.yohoufo.order.utils.TimeUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -300,9 +303,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
orderListInfo.setEarnestMoney(sellerOrder.getEarnestMoney());
//
GoodsInfo goodsInfo = new GoodsInfo();
goodsInfo.setColorName(sellerOrderGoods.getColorName());
goodsInfo.setProductName(sellerOrderGoods.getProductName());
goodsInfo.setProductName(SellerGoodsHelper.addFlag2GoodsNameHead(sellerOrderGoods.getProductName(), skupType));
goodsInfo.setGoodImg(ImageUrlAssist.getAllProductPicUrl(sellerOrderGoods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setProductId(sellerOrderGoods.getProductId());
... ... @@ -344,41 +348,6 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
}
OrderListInfo convertOrderInfo(SellerOrderInfo sellerOrderInfo, Map<Integer, Long> buyerOrderMap) {
OrderListInfo orderListInfo = new OrderListInfo();
orderListInfo.setUid(sellerOrderInfo.getUid());
orderListInfo.setOrderCode(sellerOrderInfo.getOrderCode());
orderListInfo.setRealPrice(sellerOrderInfo.getGoodsPrice().toPlainString());
// 订单中状态显示
SkupStatus skupStatus = SkupStatus.getSkupStatus(sellerOrderInfo.getStatus().intValue());
if (skupStatus != null){
orderListInfo.setStatus(skupStatus.getCode());
orderListInfo.setStatuStr(skupStatus.getDesc());
}
orderListInfo.setSkup(sellerOrderInfo.getSkup());
GoodsInfo goodsInfo = new GoodsInfo();
goodsInfo.setColorName(sellerOrderInfo.getColorName());
goodsInfo.setProductName(sellerOrderInfo.getProductName());
goodsInfo.setGoodImg(ImageUrlAssist.getAllProductPicUrl(sellerOrderInfo.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
goodsInfo.setSizeName(sellerOrderInfo.getSizeName());
goodsInfo.setProductId(sellerOrderInfo.getProductId());
goodsInfo.setGoodPrice(sellerOrderInfo.getGoodsPrice().toPlainString());
orderListInfo.setGoodsInfo(goodsInfo);
orderListInfo.setCreateTime(DateUtil.formatDate(sellerOrderInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
// 查询skup的买家订单号
orderListInfo.setBuyerOrderCode(buyerOrderMap.get(sellerOrderInfo.getSkup()));
return orderListInfo;
}
@Override
protected List<Integer> initOrderListRequest(OrderListRequest request) {
if (request.getUid() < 0){
... ...
... ... @@ -483,10 +483,11 @@ public class SkupListService {
// 按钮显示
List<ButtonShowBo> buttons = Arrays.asList(ButtonShow.STORAGE_MANAGE.getBo());
orderListInfo.setButtons(buttons == null ? new ArrayList<>(): new ArrayList<>(buttons));
SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
//
GoodsInfo productInfo = new GoodsInfo();
productInfo.setColorName(sellerOrderGoods.getColorName());
productInfo.setProductName(sellerOrderGoods.getProductName());
productInfo.setProductName(SellerGoodsHelper.addFlag2GoodsNameHead(sellerOrderGoods.getProductName(), skupType));
String imageUrl = ImageUrlAssist.getAllProductPicUrl(sellerOrderGoods.getImageUrl(), "goodsimg", "center", "d2hpdGU=");
productInfo.setImageUrl(imageUrl);
Integer productId;
... ... @@ -544,7 +545,7 @@ public class SkupListService {
productInfo.setSizeId(sellerOrderGoods.getSizeId());
productInfo.setSizeName(sellerOrderGoods.getSizeName());
productInfo.setColorName(sellerOrderGoods.getColorName());
productInfo.setProductName(sellerOrderGoods.getProductName());
productInfo.setProductName(SellerGoodsHelper.addFlag2GoodsNameHead(sellerOrderGoods.getProductName(), skupType));
String imageUrl = ImageUrlAssist.getAllProductPicUrl(sellerOrderGoods.getImageUrl(), "goodsimg", "center", "d2hpdGU=");
productInfo.setGoodImg(imageUrl);
Integer productId;
... ...
package com.yohoufo.order.utils;
import com.yohobuy.ufo.model.order.constants.SkupType;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.Objects;
... ... @@ -18,4 +19,15 @@ public final class SellerGoodsHelper {
return skupType!=null
&& (SkupType.FLAW.equals(skupType) || SkupType.SECOND_HAND.equals(skupType));
}
public static String buildGoodsFlag(SkupType skupType){
String attrName = skupType.attrName();
return attrName == null ? null : String.format("【%s】",attrName);
}
public static String addFlag2GoodsNameHead(String prdName, SkupType skupType){
String goodsFlag = buildGoodsFlag(skupType);
return StringUtils.isNoneBlank(goodsFlag)? goodsFlag+prdName: prdName;
}
}
... ...