From 389d0c6d923532e3af63582e37946a5cda1fa90b Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 06 十二月 2018 14:13:15 +0800 Subject: [PATCH] 浏览记录调整 邀请更改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java index f513882..e392bda 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java @@ -65,6 +65,23 @@ commonGoodsMapper.insertSelective(commonGoods); return commonGoods; } + + + @Override + public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { + filterCommonGoods(commonGoods); + CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(), + commonGoods.getGoodsType()); + if (goods != null) { + commonGoods.setId(goods.getId()); + return commonGoods; + } + commonGoods.setCreateTime(new Date()); + commonGoods.setUpdateTime(new Date()); + commonGoodsMapper.insertSelective(commonGoods); + return commonGoods; + } + @Override public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException { -- Gitblit v1.8.0