Java Code Examples for com.macro.mall.model.PmsProductLadder#getCount()

The following examples show how to use com.macro.mall.model.PmsProductLadder#getCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OmsPromotionServiceImpl.java    From mall-swarm with Apache License 2.0 6 votes vote down vote up
/**
 * 根据购买商品数量获取满足条件的打折优惠策略
 */
private PmsProductLadder getProductLadder(int count, List<PmsProductLadder> productLadderList) {
    //按数量从大到小排序
    productLadderList.sort(new Comparator<PmsProductLadder>() {
        @Override
        public int compare(PmsProductLadder o1, PmsProductLadder o2) {
            return o2.getCount() - o1.getCount();
        }
    });
    for (PmsProductLadder productLadder : productLadderList) {
        if (count >= productLadder.getCount()) {
            return productLadder;
        }
    }
    return null;
}
 
Example 2
Source File: OmsPromotionServiceImpl.java    From macrozheng with Apache License 2.0 6 votes vote down vote up
/**
 * 根据购买商品数量获取满足条件的打折优惠策略
 */
private PmsProductLadder getProductLadder(int count, List<PmsProductLadder> productLadderList) {
    //按数量从大到小排序
    productLadderList.sort(new Comparator<PmsProductLadder>() {
        @Override
        public int compare(PmsProductLadder o1, PmsProductLadder o2) {
            return o2.getCount() - o1.getCount();
        }
    });
    for (PmsProductLadder productLadder : productLadderList) {
        if (count >= productLadder.getCount()) {
            return productLadder;
        }
    }
    return null;
}
 
Example 3
Source File: OmsPromotionServiceImpl.java    From mall with Apache License 2.0 6 votes vote down vote up
/**
 * 根据购买商品数量获取满足条件的打折优惠策略
 */
private PmsProductLadder getProductLadder(int count, List<PmsProductLadder> productLadderList) {
    //按数量从大到小排序
    productLadderList.sort(new Comparator<PmsProductLadder>() {
        @Override
        public int compare(PmsProductLadder o1, PmsProductLadder o2) {
            return o2.getCount() - o1.getCount();
        }
    });
    for (PmsProductLadder productLadder : productLadderList) {
        if (count >= productLadder.getCount()) {
            return productLadder;
        }
    }
    return null;
}
 
Example 4
Source File: OmsPromotionServiceImpl.java    From macrozheng-mall with MIT License 6 votes vote down vote up
/**
 * 根据购买商品数量获取满足条件的打折优惠策略
 */
private PmsProductLadder getProductLadder(int count, List<PmsProductLadder> productLadderList) {
    //按数量从大到小排序
    productLadderList.sort(new Comparator<PmsProductLadder>() {
        @Override
        public int compare(PmsProductLadder o1, PmsProductLadder o2) {
            return o2.getCount() - o1.getCount();
        }
    });
    for (PmsProductLadder productLadder : productLadderList) {
        if (count >= productLadder.getCount()) {
            return productLadder;
        }
    }
    return null;
}