com.macro.mall.model.PmsSkuStock Java Examples

The following examples show how to use com.macro.mall.model.PmsSkuStock. 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 macrozheng with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #2
Source File: OmsPromotionServiceImpl.java    From mall-swarm with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #3
Source File: OmsPromotionServiceImpl.java    From mall with Apache License 2.0 6 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        if(skuStock!=null){
            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        }
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #4
Source File: OmsPromotionServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
/**
 * 获取购物车中指定商品的总价
 */
private BigDecimal getCartItemAmount(List<OmsCartItem> itemList, List<PromotionProduct> promotionProductList) {
    BigDecimal amount = new BigDecimal(0);
    for (OmsCartItem item : itemList) {
        //计算出商品原价
        PromotionProduct promotionProduct = getPromotionProductById(item.getProductId(), promotionProductList);
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        amount = amount.add(skuStock.getPrice().multiply(new BigDecimal(item.getQuantity())));
    }
    return amount;
}
 
Example #5
Source File: OmsPromotionServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 对没满足优惠条件的商品进行处理
 */
private void handleNoReduce(List<CartPromotionItem> cartPromotionItemList, List<OmsCartItem> itemList,PromotionProduct promotionProduct) {
    for (OmsCartItem item : itemList) {
        CartPromotionItem cartPromotionItem = new CartPromotionItem();
        BeanUtils.copyProperties(item,cartPromotionItem);
        cartPromotionItem.setPromotionMessage("无优惠");
        cartPromotionItem.setReduceAmount(new BigDecimal(0));
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
        cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
        cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
        cartPromotionItemList.add(cartPromotionItem);
    }
}
 
Example #6
Source File: PmsSkuStockController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public Object getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
    List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
    return new CommonResult().success(skuStockList);
}
 
Example #7
Source File: PmsSkuStockServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
    PmsSkuStockExample example = new PmsSkuStockExample();
    PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
    if (!StringUtils.isEmpty(keyword)) {
        criteria.andSkuCodeLike("%" + keyword + "%");
    }
    return skuStockMapper.selectByExample(example);
}
 
Example #8
Source File: PmsSkuStockServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
    PmsSkuStockExample example = new PmsSkuStockExample();
    PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
    if (!StringUtils.isEmpty(keyword)) {
        criteria.andSkuCodeLike("%" + keyword + "%");
    }
    return skuStockMapper.selectByExample(example);
}
 
Example #9
Source File: PmsSkuStockController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
    int count = skuStockService.update(pid,skuStockList);
    if(count>0){
        return CommonResult.success(count);
    }else{
        return CommonResult.failed();
    }
}
 
Example #10
Source File: OmsPromotionServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 获取购物车中指定商品的总价
 */
private BigDecimal getCartItemAmount(List<OmsCartItem> itemList, List<PromotionProduct> promotionProductList) {
    BigDecimal amount = new BigDecimal(0);
    for (OmsCartItem item : itemList) {
        //计算出商品原价
        PromotionProduct promotionProduct = getPromotionProductById(item.getProductId(), promotionProductList);
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        amount = amount.add(skuStock.getPrice().multiply(new BigDecimal(item.getQuantity())));
    }
    return amount;
}
 
Example #11
Source File: PmsSkuStockController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
    List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
    return CommonResult.success(skuStockList);
}
 
Example #12
Source File: OmsPromotionServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 获取购物车中指定商品的总价
 */
private BigDecimal getCartItemAmount(List<OmsCartItem> itemList, List<PromotionProduct> promotionProductList) {
    BigDecimal amount = new BigDecimal(0);
    for (OmsCartItem item : itemList) {
        //计算出商品原价
        PromotionProduct promotionProduct = getPromotionProductById(item.getProductId(), promotionProductList);
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        amount = amount.add(skuStock.getPrice().multiply(new BigDecimal(item.getQuantity())));
    }
    return amount;
}
 
Example #13
Source File: OmsPromotionServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
/**
 * 获取商品的原价
 */
private PmsSkuStock getOriginalPrice(PromotionProduct promotionProduct, Long productSkuId) {
    for (PmsSkuStock skuStock : promotionProduct.getSkuStockList()) {
        if (productSkuId.equals(skuStock.getId())) {
            return skuStock;
        }
    }
    return null;
}
 
Example #14
Source File: PmsSkuStockController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
    List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
    return CommonResult.success(skuStockList);
}
 
Example #15
Source File: PmsSkuStockController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
    int count = skuStockService.update(pid,skuStockList);
    if(count>0){
        return CommonResult.success(count);
    }else{
        return CommonResult.failed();
    }
}
 
Example #16
Source File: PmsSkuStockController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("根据商品编号及编号模糊搜索sku库存")
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
    List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
    return CommonResult.success(skuStockList);
}
 
Example #17
Source File: PmsSkuStockController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
    int count = skuStockService.update(pid,skuStockList);
    if(count>0){
        return CommonResult.success(count);
    }else{
        return CommonResult.failed();
    }
}
 
Example #18
Source File: PmsSkuStockServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
    PmsSkuStockExample example = new PmsSkuStockExample();
    PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
    if (!StringUtils.isEmpty(keyword)) {
        criteria.andSkuCodeLike("%" + keyword + "%");
    }
    return skuStockMapper.selectByExample(example);
}
 
Example #19
Source File: PmsSkuStockController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("批量更新库存信息")
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
    int count = skuStockService.update(pid,skuStockList);
    if(count>0){
        return new CommonResult().success(count);
    }else{
        return new CommonResult().failed();
    }
}
 
Example #20
Source File: PmsSkuStockServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public List<PmsSkuStock> getList(Long pid, String keyword) {
    PmsSkuStockExample example = new PmsSkuStockExample();
    PmsSkuStockExample.Criteria criteria = example.createCriteria().andProductIdEqualTo(pid);
    if (!StringUtils.isEmpty(keyword)) {
        criteria.andSkuCodeLike("%" + keyword + "%");
    }
    return skuStockMapper.selectByExample(example);
}
 
Example #21
Source File: OmsPromotionServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 获取购物车中指定商品的总价
 */
private BigDecimal getCartItemAmount(List<OmsCartItem> itemList, List<PromotionProduct> promotionProductList) {
    BigDecimal amount = new BigDecimal(0);
    for (OmsCartItem item : itemList) {
        //计算出商品原价
        PromotionProduct promotionProduct = getPromotionProductById(item.getProductId(), promotionProductList);
        PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
        amount = amount.add(skuStock.getPrice().multiply(new BigDecimal(item.getQuantity())));
    }
    return amount;
}
 
Example #22
Source File: OmsPromotionServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 获取商品的原价
 */
private PmsSkuStock getOriginalPrice(PromotionProduct promotionProduct, Long productSkuId) {
    for (PmsSkuStock skuStock : promotionProduct.getSkuStockList()) {
        if (productSkuId.equals(skuStock.getId())) {
            return skuStock;
        }
    }
    return null;
}
 
Example #23
Source File: PromotionProduct.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
public List<PmsSkuStock> getSkuStockList() {
    return skuStockList;
}
 
Example #24
Source File: PromotionProduct.java    From macrozheng-mall with MIT License 4 votes vote down vote up
public void setSkuStockList(List<PmsSkuStock> skuStockList) {
    this.skuStockList = skuStockList;
}
 
Example #25
Source File: CartProduct.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
public List<PmsSkuStock> getSkuStockList() {
    return skuStockList;
}
 
Example #26
Source File: PromotionProduct.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
public void setSkuStockList(List<PmsSkuStock> skuStockList) {
    this.skuStockList = skuStockList;
}
 
Example #27
Source File: PmsSkuStockServiceImpl.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
@Override
public int update(Long pid, List<PmsSkuStock> skuStockList) {
    return skuStockDao.replaceList(skuStockList);
}
 
Example #28
Source File: PromotionProduct.java    From macrozheng-mall with MIT License 4 votes vote down vote up
public List<PmsSkuStock> getSkuStockList() {
    return skuStockList;
}
 
Example #29
Source File: CartProduct.java    From mall with Apache License 2.0 4 votes vote down vote up
public void setSkuStockList(List<PmsSkuStock> skuStockList) {
    this.skuStockList = skuStockList;
}
 
Example #30
Source File: PromotionProduct.java    From mall with Apache License 2.0 4 votes vote down vote up
public List<PmsSkuStock> getSkuStockList() {
    return skuStockList;
}