Authored by wujiexiang

尾款支付

... ... @@ -251,7 +251,7 @@
<if test="originalStatus != null">
and status = #{originalStatus,jdbcType=INTEGER}
</if>
<if test="bidType != null">
<if test="bidType > 0">
and bid_type = #{bidType,jdbcType=INTEGER}
</if>
</update>
... ...
package com.yohoufo.order.service.impl;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
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.OrderDetailInfo;
import com.yohobuy.ufo.model.response.BidStoragePriceResp;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
... ... @@ -26,10 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.helpers.MessageFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
* Created by chao.chen on 2018/11/26.
... ... @@ -214,4 +213,12 @@ public abstract class AbsOrderViewService {
return null;
}
}
public void refreshGoodsInfo(GoodsInfo goodsInfo, Map<Integer, BidStoragePriceResp> statisticalPriceMap) {
BidStoragePriceResp bidStoragePriceResp = statisticalPriceMap.get(goodsInfo.getStorageId());
if (bidStoragePriceResp != null) {
goodsInfo.setLeastPrice(bidStoragePriceResp.getLeastPrice());
goodsInfo.setBidHighestPrice(bidStoragePriceResp.getBidHighestPrice());
}
}
}
... ...
... ... @@ -10,7 +10,6 @@ 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.yohobuy.ufo.model.response.BidStoragePriceResp;
import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
... ... @@ -81,7 +80,7 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
}
orderDetailInfo = super.getOrderDetail(orderRequest);
//刷新动态数据
refreshGoodsInfo(orderDetailInfo);
refreshGoodsInfoIfNeed(orderDetailInfo);
if(Objects.nonNull(orderDetailInfo)){
Integer oac;
... ... @@ -237,7 +236,7 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
@Override
protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo,String appVersion) {
refreshGoodsInfo(orderDetailInfo);
refreshGoodsInfoIfNeed(orderDetailInfo);
procsessButtons(orderDetailInfo);
Integer oac = orderDetailInfo.getAttributes();
... ... @@ -260,16 +259,12 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
removeButtonIfRequired(leftTime, orderStatusCode, orderDetailInfo.getButtons());
}
private void refreshGoodsInfo(OrderDetailInfo orderDetailInfo) {
private void refreshGoodsInfoIfNeed(OrderDetailInfo orderDetailInfo) {
if (!orderDetailInfo.refreshStatisticalPrice()) {
return;
}
GoodsInfo goodsInfo = orderDetailInfo.getGoodsInfo();
BidStoragePriceResp bidStoragePriceResp = bidProductProxyService.getStatisticalPrice(Sets.newHashSet(goodsInfo.getStorageId())).get(goodsInfo.getStorageId());
if (bidStoragePriceResp != null) {
goodsInfo.setLeastPrice(bidStoragePriceResp.getLeastPrice());
goodsInfo.setBidHighestPrice(bidStoragePriceResp.getBidHighestPrice());
}
refreshGoodsInfo(goodsInfo, bidProductProxyService.getStatisticalPrice(Sets.newHashSet(goodsInfo.getStorageId())));
}
@Override
... ...
... ... @@ -4,7 +4,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderListType;
... ... @@ -160,7 +159,7 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
@Override
protected void resetDynamicProporties(List<OrderListInfo> list, int type) {
if(CollectionUtils.isNotEmpty(list)){
refreshGoodsInfos(list);
refreshGoodsInfosIfNeed(list);
processButtons(list);
list.forEach(oli -> {
... ... @@ -176,26 +175,22 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
}
}
public void refreshGoodsInfos(List<OrderListInfo> list) {
public void refreshGoodsInfosIfNeed(List<OrderListInfo> list) {
if (CollectionUtils.isEmpty(list)) {
return;
}
Set<Integer> storageIds = list.stream().filter(item -> item.refreshStatisticalPrice()).map(item -> item.getGoodsInfo().getStorageId()).collect(Collectors.toSet());
//需要刷新的OrderListInfo
List<OrderListInfo> refreshList = list.stream().filter(OrderListInfo::refreshStatisticalPrice).collect(Collectors.toList());
if (CollectionUtils.isEmpty(refreshList)) {
return;
}
Set<Integer> storageIds = refreshList.stream().map(item -> item.getGoodsInfo().getStorageId()).collect(Collectors.toSet());
Map<Integer, BidStoragePriceResp> statisticalPriceMap = bidProductProxyService.getStatisticalPrice(storageIds);
list.forEach(item -> {
refreshGoodsInfo(item, statisticalPriceMap);
refreshList.forEach(item -> {
refreshGoodsInfo(item.getGoodsInfo(), statisticalPriceMap);
});
}
private void refreshGoodsInfo(OrderListInfo orderListInfo, Map<Integer, BidStoragePriceResp> statisticalPriceMap) {
GoodsInfo goodsInfo = orderListInfo.getGoodsInfo();
BidStoragePriceResp bidStoragePriceResp = statisticalPriceMap.get(goodsInfo.getStorageId());
if (bidStoragePriceResp != null) {
goodsInfo.setLeastPrice(bidStoragePriceResp.getLeastPrice());
goodsInfo.setBidHighestPrice(bidStoragePriceResp.getBidHighestPrice());
}
}
@Override
public void setAddressInfo(OrderListInfo orderListInfo) {
orderListInfo.setAddressInfo(getAddressInfo(orderListInfo.getBuyerUid(), orderListInfo.getOrderCode(),
... ...
... ... @@ -74,7 +74,7 @@ public class BuyerOrderViewService implements IOrderListService, IOrderDetailSer
PageResp orderListInfoRsp = buyerOrderListService.getOrderList(request, isPlatform);
if (orderListInfoRsp != null){
buyerOrderListService.refreshGoodsInfos(orderListInfoRsp.getData());
buyerOrderListService.refreshGoodsInfosIfNeed(orderListInfoRsp.getData());
orderListVo = OrderListVo.builder().page(orderListInfoRsp.getPage())
.pageSize(orderListInfoRsp.getPageSize())
... ...
... ... @@ -57,7 +57,8 @@ public class BuyerOrderBidingCancelChanger extends AbstractBuyerOrderStateChange
protected Collection<Statement> afterStatements(RequestedStatusChangeBuyerOrder statusChangeBuyerOrder) {
BuyerOrder buyerOrder = statusChangeBuyerOrder.getBuyerOrder();
//退款
return Lists.newArrayList(() -> refundDeposit(buyerOrder),
return Lists.newArrayList(
() -> refundDeposit(buyerOrder),
() -> messageNotice(buyerOrder, statusChangeBuyerOrder.getTargetStatus()));
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yohoufo.order.service.proxy;
import com.yoho.message.sdk.common.constants.UFOMessageScene;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yoho.message.sdk.service.ufo.UFOBidMessageService;
import com.yoho.message.sdk.service.ufo.UFOMessageService;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohoufo.dal.order.model.BuyerOrder;
... ... @@ -31,7 +31,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
private ProductMapper productMapper;
@Autowired
private UFOBidMessageService ufoBidMessageService;
private UFOMessageService ufoMessageService;
@Override
public Logger getLogger() {
... ... @@ -477,7 +477,7 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
.withLogPrefix("Buyer Message Notice")
.withInBox(() -> buildInboxContent(inbox, parameters.values().toArray(new Object[0])))
.withSmsIf(sms != null, () -> buildSmsContent(sms, params))
.withPushIf(push != null, () -> ufoBidMessageService.sendMessage(String.valueOf(buyerUid), push, parameters))
.withPushIf(push != null, () -> ufoMessageService.sendMessage(String.valueOf(buyerUid), push, parameters))
.send();
}
... ...