...
|
...
|
@@ -518,11 +518,17 @@ public class StoreSellerServiceImpl implements IStoredSellerService { |
|
|
|| good.getAttributes() == OrderAttributes.FLAW.getCode()
|
|
|
|| good.getAttributes() == OrderAttributes.SECOND_HAND.getCode()){
|
|
|
rate = 0.04;
|
|
|
earnest = YHMath.add(earnest, YHMath.mul(good.getGoodsPrice().doubleValue(), rate));
|
|
|
|
|
|
earnest = redefinedEarnest(earnest, 200, 28);
|
|
|
|
|
|
}else if(good.getAttributes() == OrderAttributes.ADVANCE_SALE.getCode()){
|
|
|
rate = 0.08;
|
|
|
}
|
|
|
earnest = YHMath.add(earnest, YHMath.mul(good.getGoodsPrice().doubleValue(), rate));
|
|
|
|
|
|
earnest = YHMath.add(earnest, YHMath.mul(good.getGoodsPrice().doubleValue(), rate));
|
|
|
earnest = redefinedEarnest(earnest, 400, 40);
|
|
|
|
|
|
}
|
|
|
|
|
|
skup.add(good.getId());
|
|
|
// 一旦金额达到 指定的金额, 则不需要继续查找skup
|
...
|
...
|
@@ -536,4 +542,15 @@ public class StoreSellerServiceImpl implements IStoredSellerService { |
|
|
return Pair.of(skup, earnest);
|
|
|
}
|
|
|
|
|
|
|
|
|
public double redefinedEarnest(double earnest, double max, double min){
|
|
|
if (earnest>max){
|
|
|
return max;
|
|
|
}else if(earnest<min){
|
|
|
return min;
|
|
|
}else{
|
|
|
return earnest;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|