Showing
7 changed files
with
32 additions
and
11 deletions
1 | package com.yohoufo.order.model.dto; | 1 | package com.yohoufo.order.model.dto; |
2 | 2 | ||
3 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
3 | import com.yohoufo.dal.order.model.SellerOrderGoods; | 4 | import com.yohoufo.dal.order.model.SellerOrderGoods; |
4 | import com.yohoufo.order.service.proxy.ProductProxyService; | 5 | import com.yohoufo.order.service.proxy.ProductProxyService; |
5 | import lombok.AllArgsConstructor; | 6 | import lombok.AllArgsConstructor; |
@@ -44,4 +45,6 @@ public class ChangePricePrepareDTO { | @@ -44,4 +45,6 @@ public class ChangePricePrepareDTO { | ||
44 | private String tips; | 45 | private String tips; |
45 | 46 | ||
46 | private boolean isSuper; | 47 | private boolean isSuper; |
48 | + | ||
49 | + SkupType skupType; | ||
47 | } | 50 | } |
@@ -71,9 +71,10 @@ public interface AbsSellerOrderViewService { | @@ -71,9 +71,10 @@ public interface AbsSellerOrderViewService { | ||
71 | default ProductProxyService.PrdPrice getPrdPrice(int storageId){ | 71 | default ProductProxyService.PrdPrice getPrdPrice(int storageId){ |
72 | ProductProxyService.PrdPrice prdPrice; | 72 | ProductProxyService.PrdPrice prdPrice; |
73 | try { | 73 | try { |
74 | - StorageDataResp storage = getProductProxyService().getStorageData(storageId); | 74 | + StorageDataResp storage = getProductProxyService().getStorageData(storageId); |
75 | prdPrice = new ProductProxyService.PrdPrice(); | 75 | prdPrice = new ProductProxyService.PrdPrice(); |
76 | prdPrice.setLeastPrice(storage.getLeastPrice()); | 76 | prdPrice.setLeastPrice(storage.getLeastPrice()); |
77 | + prdPrice.setPreSaleLeastPrice(storage.getPreSaleLeastPrice()); | ||
77 | }catch (Exception ex){ | 78 | }catch (Exception ex){ |
78 | prdPrice = new ProductProxyService.PrdPrice(); | 79 | prdPrice = new ProductProxyService.PrdPrice(); |
79 | getLogger().warn("in getPrdPrice fail, storageId {}", storageId); | 80 | getLogger().warn("in getPrdPrice fail, storageId {}", storageId); |
@@ -9,6 +9,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; | @@ -9,6 +9,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; | ||
9 | import com.yohobuy.ufo.model.order.bo.TimeoutBo; | 9 | import com.yohobuy.ufo.model.order.bo.TimeoutBo; |
10 | import com.yohobuy.ufo.model.order.common.*; | 10 | import com.yohobuy.ufo.model.order.common.*; |
11 | import com.yohobuy.ufo.model.order.constants.OrderConstant; | 11 | import com.yohobuy.ufo.model.order.constants.OrderConstant; |
12 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
12 | import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; | 13 | import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; |
13 | import com.yohobuy.ufo.model.order.vo.AddressInfo; | 14 | import com.yohobuy.ufo.model.order.vo.AddressInfo; |
14 | import com.yohoufo.common.utils.DateUtil; | 15 | import com.yohoufo.common.utils.DateUtil; |
@@ -346,10 +347,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -346,10 +347,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
346 | } | 347 | } |
347 | orderDetailInfo.setStatusDetail(statusDetail); | 348 | orderDetailInfo.setStatusDetail(statusDetail); |
348 | GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods); | 349 | GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods); |
350 | + Integer soga = sellerOrderGoods.getAttributes(); | ||
351 | + SkupType skupType = SkupType.getSkupType(soga); | ||
349 | if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){ | 352 | if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){ |
350 | ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId()); | 353 | ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId()); |
351 | BigDecimal leastPrice; | 354 | BigDecimal leastPrice; |
352 | - if ((leastPrice = prdPrice.getLeastPrice())!= null | 355 | + if ((leastPrice = prdPrice.getLeastPrice(skupType))!= null |
353 | && leastPrice.compareTo(BigDecimal.ZERO)>0){ | 356 | && leastPrice.compareTo(BigDecimal.ZERO)>0){ |
354 | goodsInfo.setLeastPrice(leastPrice); | 357 | goodsInfo.setLeastPrice(leastPrice); |
355 | goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice)); | 358 | goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice)); |
@@ -363,7 +366,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -363,7 +366,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
363 | orderDetailInfo.setIsPaid(getIsPaid(skupStatus)); | 366 | orderDetailInfo.setIsPaid(getIsPaid(skupStatus)); |
364 | orderDetailInfo.setSecendLevelCreateTime(order.getCreateTime()); | 367 | orderDetailInfo.setSecendLevelCreateTime(order.getCreateTime()); |
365 | orderDetailInfo.setCreateTime(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); | 368 | orderDetailInfo.setCreateTime(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); |
366 | - orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(sellerOrderGoods.getAttributes())); | 369 | + orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga)); |
367 | return orderDetailInfo; | 370 | return orderDetailInfo; |
368 | } | 371 | } |
369 | 372 |
@@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo; | @@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo; | ||
8 | import com.yohobuy.ufo.model.order.bo.OrderInfo; | 8 | import com.yohobuy.ufo.model.order.bo.OrderInfo; |
9 | import com.yohobuy.ufo.model.order.bo.TimeoutBo; | 9 | import com.yohobuy.ufo.model.order.bo.TimeoutBo; |
10 | import com.yohobuy.ufo.model.order.common.*; | 10 | import com.yohobuy.ufo.model.order.common.*; |
11 | +import com.yohobuy.ufo.model.order.constants.SkupType; | ||
11 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; | 12 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; |
12 | import com.yohobuy.ufo.model.order.resp.PageResp; | 13 | import com.yohobuy.ufo.model.order.resp.PageResp; |
13 | import com.yohobuy.ufo.model.order.vo.OrderListVo; | 14 | import com.yohobuy.ufo.model.order.vo.OrderListVo; |
@@ -285,10 +286,12 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | @@ -285,10 +286,12 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | ||
285 | goodsInfo.setBatchNo(sellerOrderGoods.getBatchNo()); | 286 | goodsInfo.setBatchNo(sellerOrderGoods.getBatchNo()); |
286 | goodsInfo.setStorageNum(storageNum); | 287 | goodsInfo.setStorageNum(storageNum); |
287 | goodsInfo.setSkupList(sellerOrderGoods.getSkupList()); | 288 | goodsInfo.setSkupList(sellerOrderGoods.getSkupList()); |
289 | + Integer soga = sellerOrderGoods.getAttributes(); | ||
290 | + SkupType skupType = SkupType.getSkupType(soga); | ||
288 | if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){ | 291 | if(SkupStatus.CAN_SELL.getCode() == skupStatus.getCode()){ |
289 | ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId()); | 292 | ProductProxyService.PrdPrice prdPrice = getPrdPrice(sellerOrderGoods.getStorageId()); |
290 | - BigDecimal leastPrice = prdPrice.getLeastPrice(); | ||
291 | - if (Objects.nonNull(prdPrice.getLeastPrice()) && leastPrice.compareTo(BigDecimal.ZERO)>0){ | 293 | + BigDecimal leastPrice; |
294 | + if (Objects.nonNull(leastPrice=prdPrice.getLeastPrice(skupType)) && leastPrice.compareTo(BigDecimal.ZERO)>0){ | ||
292 | goodsInfo.setLeastPrice(leastPrice); | 295 | goodsInfo.setLeastPrice(leastPrice); |
293 | goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice)); | 296 | goodsInfo.setLeastPriceOfSkuTips(buildLeastPriceTips(leastPrice)); |
294 | } | 297 | } |
@@ -299,7 +302,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | @@ -299,7 +302,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | ||
299 | if (SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){ | 302 | if (SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())){ |
300 | orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()))); | 303 | orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice()))); |
301 | } | 304 | } |
302 | - orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(sellerOrderGoods.getAttributes())); | 305 | + orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga)); |
303 | return orderListInfo; | 306 | return orderListInfo; |
304 | } | 307 | } |
305 | 308 |
@@ -659,8 +659,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -659,8 +659,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
659 | BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(successCnt).failCnt(failCnt) | 659 | BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(successCnt).failCnt(failCnt) |
660 | .tips(cppDto.getTips()).build(); | 660 | .tips(cppDto.getTips()).build(); |
661 | ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice(); | 661 | ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice(); |
662 | - if (prdPrice!=null && prdPrice.getLeastPrice() != null){ | ||
663 | - resp.setLeastPrice(prdPrice.getLeastPrice()); | 662 | + BigDecimal leastPrice; |
663 | + if (prdPrice!=null && (leastPrice = prdPrice.getLeastPrice(cppDto.getSkupType())) != null){ | ||
664 | + resp.setLeastPrice(leastPrice); | ||
664 | } | 665 | } |
665 | return resp; | 666 | return resp; |
666 | } | 667 | } |
@@ -682,7 +683,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -682,7 +683,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
682 | if (keys.contains(key)){ | 683 | if (keys.contains(key)){ |
683 | continue; | 684 | continue; |
684 | } | 685 | } |
685 | - | ||
686 | skupDetailRKBs.add(CacheKeyBuilder.sellerOrderDetailKey(sog)); | 686 | skupDetailRKBs.add(CacheKeyBuilder.sellerOrderDetailKey(sog)); |
687 | } | 687 | } |
688 | log.info("build detail cache group keys {}", keys); | 688 | log.info("build detail cache group keys {}", keys); |
@@ -721,8 +721,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -721,8 +721,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
721 | BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(result.successCnt).failCnt(result.failCnt) | 721 | BatchChangePriceResp resp = BatchChangePriceResp.builder().successCnt(result.successCnt).failCnt(result.failCnt) |
722 | .tips(cppDto.getTips()).build(); | 722 | .tips(cppDto.getTips()).build(); |
723 | ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice(); | 723 | ProductProxyService.PrdPrice prdPrice = cppDto.getPrdPrice(); |
724 | - if (prdPrice != null && prdPrice.getLeastPrice() != null) { | ||
725 | - resp.setLeastPrice(prdPrice.getLeastPrice()); | 724 | + BigDecimal leastPrice; |
725 | + if (prdPrice != null && (leastPrice = prdPrice.getLeastPrice(cppDto.getSkupType())) != null) { | ||
726 | + resp.setLeastPrice(leastPrice); | ||
726 | } | 727 | } |
727 | return resp; | 728 | return resp; |
728 | } | 729 | } |
@@ -118,6 +118,7 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | @@ -118,6 +118,7 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | ||
118 | .preEarnestMoney(sourceEM) | 118 | .preEarnestMoney(sourceEM) |
119 | .preSalePrice(preSalePrice) | 119 | .preSalePrice(preSalePrice) |
120 | .tips(tips).isSuper(isSuper) | 120 | .tips(tips).isSuper(isSuper) |
121 | + .skupType(skupType) | ||
121 | .build(); | 122 | .build(); |
122 | } | 123 | } |
123 | 124 |
@@ -41,6 +41,14 @@ public class ProductProxyService { | @@ -41,6 +41,14 @@ public class ProductProxyService { | ||
41 | private BigDecimal suggestMaxPrice; | 41 | private BigDecimal suggestMaxPrice; |
42 | private BigDecimal suggestMinPrice; | 42 | private BigDecimal suggestMinPrice; |
43 | private BigDecimal leastPrice; | 43 | private BigDecimal leastPrice; |
44 | + private BigDecimal preSaleLeastPrice; | ||
45 | + | ||
46 | + public BigDecimal getLeastPrice(SkupType skupType){ | ||
47 | + if (Objects.nonNull(skupType) && SkupType.ADVANCE.equals(skupType)){ | ||
48 | + return preSaleLeastPrice; | ||
49 | + } | ||
50 | + return leastPrice; | ||
51 | + } | ||
44 | } | 52 | } |
45 | 53 | ||
46 | @Autowired | 54 | @Autowired |
@@ -159,6 +167,7 @@ public class ProductProxyService { | @@ -159,6 +167,7 @@ public class ProductProxyService { | ||
159 | prdPrice.suggestMaxPrice = storage.getSuggestHighPrice(); | 167 | prdPrice.suggestMaxPrice = storage.getSuggestHighPrice(); |
160 | prdPrice.suggestMinPrice = storage.getSuggestLowPrice(); | 168 | prdPrice.suggestMinPrice = storage.getSuggestLowPrice(); |
161 | prdPrice.leastPrice = storage.getLeastPrice(); | 169 | prdPrice.leastPrice = storage.getLeastPrice(); |
170 | + prdPrice.preSaleLeastPrice = storage.getPreSaleLeastPrice(); | ||
162 | return prdPrice; | 171 | return prdPrice; |
163 | } | 172 | } |
164 | 173 |
-
Please register or login to post a comment