From f995b45da163cea907cd5b109e7b5dbc2ff276c8 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期一, 11 十一月 2019 11:03:32 +0800 Subject: [PATCH] 商城后端设置 --- fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 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 634d06c..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) { - return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key); + 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) { - return banLiShopGoodsSetsMapper.countQuery(key); + 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