From fdb089cb8bee6099efcbd7b0ca2672c63cbb6784 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期一, 11 十一月 2019 09:33:56 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java index c80db69..4d8a42f 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java @@ -126,16 +126,25 @@ banLiShopGoodsSetPayService.deleteByPrimaryKey(pay.getId()); } } - - + @Override public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId) { return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key, goodsId); } - + @Override public long countQuery(String key, Long goodsId) { return banLiShopGoodsSetsMapper.countQuery(key, goodsId); } + @Override + public void addSalesCount(Long id, int count) { + BanLiShopGoodsSets set = banLiShopGoodsSetsMapper.selectByPrimaryKey(id); + BanLiShopGoodsSets update = new BanLiShopGoodsSets(); + update.setId(set.getId()); + update.setSalesCount(set.getSalesCount() + count); + update.setStock(set.getStock() - count); + banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(update); + } + } -- Gitblit v1.8.0