Authored by chenjian

bugfix

... ... @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.support.ThreeFunction;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
... ... @@ -41,9 +42,9 @@ public class BuyerOrderButtonsHandler {
return this;
}
BiFunction<BuyerOrder,List<ButtonShowBo>,List<ButtonShowBo>> fmtBtnFunc;
ThreeFunction<BuyerOrder, List<ButtonShowBo>, Integer, List<ButtonShowBo>> fmtBtnFunc;
public BuyerOrderButtonsHandler loadFmtBtnFunc(BiFunction<BuyerOrder,List<ButtonShowBo>,List<ButtonShowBo>> fmtBtnFunc){
public BuyerOrderButtonsHandler loadFmtBtnFunc(ThreeFunction<BuyerOrder,List<ButtonShowBo>, Integer, List<ButtonShowBo>> fmtBtnFunc){
this.fmtBtnFunc = fmtBtnFunc;
return this;
}
... ... @@ -64,7 +65,7 @@ public class BuyerOrderButtonsHandler {
pbos = buyerOrderDS.apply(paidOrderCodes, statusList);
if (CollectionUtils.isNotEmpty(pbos)){
BuyerOrder pbo = pbos.get(0);
List<ButtonShowBo> fbsbs = fmtBtnFunc.apply(pbo, orderDetailInfo.getButtons());
List<ButtonShowBo> fbsbs = fmtBtnFunc.apply(pbo, orderDetailInfo.getButtons(), 2);
orderDetailInfo.setButtons(fbsbs);
}
}
... ... @@ -91,7 +92,7 @@ public class BuyerOrderButtonsHandler {
if(olip.test(oli)) {
Long orderCode = oli.getOrderCode();
BuyerOrder pbo = codeBuyorderMap.get(orderCode);
List<ButtonShowBo> fbsbs = fmtBtnFunc.apply(pbo, oli.getButtons());
List<ButtonShowBo> fbsbs = fmtBtnFunc.apply(pbo, oli.getButtons(), 1);
oli.setButtons(fbsbs);
}
}
... ...
package com.yohoufo.order.service.support;
@FunctionalInterface
public interface ThreeFunction<T, U, V, R> {
R apply(T t, U u, V v);
}
... ...