Authored by chenchao

use skup type

package com.yohoufo.order.model.dto;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.service.proxy.ProductProxyService;
import lombok.AllArgsConstructor;
... ... @@ -44,4 +45,6 @@ public class ChangePricePrepareDTO {
private String tips;
private boolean isSuper;
SkupType skupType;
}
... ...
... ... @@ -71,9 +71,10 @@ public interface AbsSellerOrderViewService {
default ProductProxyService.PrdPrice getPrdPrice(int storageId){
ProductProxyService.PrdPrice prdPrice;
try {
StorageDataResp storage = getProductProxyService().getStorageData(storageId);
StorageDataResp storage = getProductProxyService().getStorageData(storageId);
prdPrice = new ProductProxyService.PrdPrice();
prdPrice.setLeastPrice(storage.getLeastPrice());
prdPrice.setPreSaleLeastPrice(storage.getPreSaleLeastPrice());
}catch (Exception ex){
prdPrice = new ProductProxyService.PrdPrice();
getLogger().warn("in getPrdPrice fail, storageId {}", storageId);
... ...
... ... @@ -9,6 +9,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
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;
... ... @@ -346,10 +347,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
}
orderDetailInfo.setStatusDetail(statusDetail);
GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods);
Integer soga = sellerOrderGoods.getAttributes();
SkupType skupType = SkupType.getSkupType(soga);
if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){
ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId());
BigDecimal leastPrice;
if ((leastPrice = prdPrice.getLeastPrice())!= null
if ((leastPrice = prdPrice.getLeastPrice(skupType))!= null
&& leastPrice.compareTo(BigDecimal.ZERO)>0){
goodsInfo.setLeastPrice(leastPrice);
goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice));
... ... @@ -363,7 +366,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
orderDetailInfo.setIsPaid(getIsPaid(skupStatus));
orderDetailInfo.setSecendLevelCreateTime(order.getCreateTime());
orderDetailInfo.setCreateTime(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(sellerOrderGoods.getAttributes()));
orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
return orderDetailInfo;
}
... ...
... ... @@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohobuy.ufo.model.order.vo.OrderListVo;
... ... @@ -285,10 +286,12 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
goodsInfo.setBatchNo(sellerOrderGoods.getBatchNo());
goodsInfo.setStorageNum(storageNum);
goodsInfo.setSkupList(sellerOrderGoods.getSkupList());
Integer soga = sellerOrderGoods.getAttributes();
SkupType skupType = SkupType.getSkupType(soga);
if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){
ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId());
BigDecimal leastPrice = prdPrice.getLeastPrice();
if (Objects.nonNull(prdPrice.getLeastPrice()) && leastPrice.compareTo(BigDecimal.ZERO)>0){
BigDecimal leastPrice;
if (Objects.nonNull(leastPrice=prdPrice.getLeastPrice(skupType)) && leastPrice.compareTo(BigDecimal.ZERO)>0){
goodsInfo.setLeastPrice(leastPrice);
goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice));
}
... ... @@ -299,7 +302,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
if (SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){
orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice())));
}
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(sellerOrderGoods.getAttributes()));
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
return orderListInfo;
}
... ...
... ... @@ -659,8 +659,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(successCnt).failCnt(failCnt)
.tips(cppDto.getTips()).build();
ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice();
if (prdPrice!=null && prdPrice.getLeastPrice() != null){
resp.setLeastPrice(prdPrice.getLeastPrice());
BigDecimal leastPrice;
if (prdPrice!=null && (leastPrice = prdPrice.getLeastPrice(cppDto.getSkupType())) != null){
resp.setLeastPrice(leastPrice);
}
return resp;
}
... ... @@ -682,7 +683,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
if (keys.contains(key)){
continue;
}
skupDetailRKBs.add(CacheKeyBuilder.sellerOrderDetailKey(sog));
}
log.info("build detail cache group keys {}", keys);
... ... @@ -721,8 +721,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(result.successCnt).failCnt(result.failCnt)
.tips(cppDto.getTips()).build();
ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice();
if (prdPrice != null && prdPrice.getLeastPrice() != null) {
resp.setLeastPrice(prdPrice.getLeastPrice());
BigDecimal leastPrice;
if (prdPrice != null && (leastPrice = prdPrice.getLeastPrice(cppDto.getSkupType())) != null) {
resp.setLeastPrice(leastPrice);
}
return resp;
}
... ...
... ... @@ -118,6 +118,7 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh
.preEarnestMoney(sourceEM)
.preSalePrice(preSalePrice)
.tips(tips).isSuper(isSuper)
.skupType(skupType)
.build();
}
... ...
... ... @@ -41,6 +41,14 @@ public class ProductProxyService {
private BigDecimal suggestMaxPrice;
private BigDecimal suggestMinPrice;
private BigDecimal leastPrice;
private BigDecimal preSaleLeastPrice;
public BigDecimal getLeastPrice(SkupType skupType){
if (Objects.nonNull(skupType) && SkupType.ADVANCE.equals(skupType)){
return preSaleLeastPrice;
}
return leastPrice;
}
}
@Autowired
... ... @@ -159,6 +167,7 @@ public class ProductProxyService {
prdPrice.suggestMaxPrice = storage.getSuggestHighPrice();
prdPrice.suggestMinPrice = storage.getSuggestLowPrice();
prdPrice.leastPrice = storage.getLeastPrice();
prdPrice.preSaleLeastPrice = storage.getPreSaleLeastPrice();
return prdPrice;
}
... ...