Authored by chenchao

fix compare bug

... ... @@ -43,7 +43,7 @@ public class GoodsAmountService {
}
}else{
if (o2gpr == null){
return 1;
return -1;
}else {
return o1gpr.compareTo(o2gpr);
}
... ... @@ -117,25 +117,28 @@ public class GoodsAmountService {
GoodsServiceFeeRateWrapper gsfrw4 = new GoodsServiceFeeRateWrapper();
gsfrw4.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.GOODS_TYPE);
gsfrw4.setGoodsPaymentRate(new BigDecimal(0.045D));
allConfig.add(gsfrw4);
GoodsServiceFeeRateWrapper gsfrw3 = new GoodsServiceFeeRateWrapper();
gsfrw3.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.ONE_USER_ONE_SKN);
gsfrw3.setGoodsPaymentRate(BigDecimal.ZERO);
//gsfrw3.setGoodsPaymentRate(BigDecimal.ZERO);
allConfig.add(gsfrw3);
GoodsServiceFeeRateWrapper gsfrw2 = new GoodsServiceFeeRateWrapper();
gsfrw2.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.ONE_USER_ONE_GOODS_TYPE);
gsfrw2.setGoodsPaymentRate(new BigDecimal(2));
gsfrw2.setGoodsPaymentRate(new BigDecimal(0.05D));
allConfig.add(gsfrw2);
GoodsServiceFeeRateWrapper gsfrw1 = new GoodsServiceFeeRateWrapper();
gsfrw1.setGoodsServiceFeeRateDimension(GoodsServiceFeeRateDimension.SKN);
gsfrw1.setGoodsPaymentRate(new BigDecimal(1));
allConfig.add(gsfrw1);
//
GoodsServiceFeeRateWrapper minGSFRW = allConfig.stream().min(buildGoodsServiceFeeRateWrapperComp()).orElse(new GoodsServiceFeeRateWrapper());
GoodsServiceFeeRateWrapper minGSFRW = allConfig.stream()
.min(buildGoodsServiceFeeRateWrapperComp())
.orElse(new GoodsServiceFeeRateWrapper());
System.out.println("test getGoodsServiceFeeRate -> " + minGSFRW);
}
... ...