| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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()); |
| | |
| | | |
| | | @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) { |
| | | |