From ef98f72cee0a50564724adee879b0849776ba997 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 07 八月 2025 19:10:43 +0800 Subject: [PATCH] 完成商品广场调整 --- framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index 8465e1b..8fb237a 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -18,6 +18,7 @@ import cn.lili.modules.goods.entity.dto.GoodsOperationDTO; import cn.lili.modules.goods.entity.dto.GoodsParamsDTO; import cn.lili.modules.goods.entity.dto.GoodsSearchParams; +import cn.lili.modules.goods.entity.dto.GoodsSortDTO; import cn.lili.modules.goods.entity.enums.GoodsAuthEnum; import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; import cn.lili.modules.goods.entity.vos.GoodsSkuVO; @@ -47,7 +48,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.rocketmq.spring.core.RocketMQTemplate; @@ -218,10 +218,11 @@ if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) { goods.setParams(JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList())); } + Goods previousGoods = this.getById(goodsId); //淇敼鍟嗗搧 this.updateById(goods); //淇敼鍟嗗搧sku淇℃伅 - this.goodsSkuService.update(goods, goodsOperationDTO); + this.goodsSkuService.update(goods, goodsOperationDTO,previousGoods); //娣诲姞鐩稿唽 if (goodsOperationDTO.getGoodsGalleryList() != null && !goodsOperationDTO.getGoodsGalleryList().isEmpty()) { this.goodsGalleryService.add(goodsOperationDTO.getGoodsGalleryList(), goods.getId()); @@ -423,6 +424,22 @@ @Override @Transactional(rollbackFor = Exception.class) + public Boolean goodsSort(GoodsSortDTO req) { + boolean result; + //妫�娴嬬鐞嗗憳鏉冮檺 + this.checkManagerAuthority(); + LambdaUpdateWrapper<Goods> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(Goods::getGoodsSort,req.getSort()); + updateWrapper.eq(Goods::getId, req.getGoodsId()); + result = this.update(updateWrapper); + List<String> goodsIds = new ArrayList<>(); + goodsIds.add(req.getGoodsId()); + this.updateEsGoods(goodsIds); + return result; + } + + @Override + @Transactional(rollbackFor = Exception.class) @SystemLogPoint(description = "鍒犻櫎鍟嗗搧", customerLog = "'鎿嶄綔瀵硅薄:['+#goodsIds+']'") public Boolean deleteGoods(List<String> goodsIds) { -- Gitblit v1.8.0