|
|
@@ -4,12 +4,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.kxs.product.api.dto.admin.shopGood.DownShelfDTO;
|
|
|
+import com.kxs.product.api.dto.admin.shopGood.SysShopGoodsAddDTO;
|
|
|
+import com.kxs.product.api.dto.admin.shopGood.SysShopGoodsPageDTO;
|
|
|
+import com.kxs.product.api.dto.admin.shopGood.UpShelfDTO;
|
|
|
import com.kxs.product.api.model.KxsShopGoodsPic;
|
|
|
-import com.kxs.product.api.model.KxsShopGoodsSku;
|
|
|
+import com.kxs.product.api.vo.admin.shopGoods.SysShopGoodsPageVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopGoodsDetailVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopGoodsListVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopGoodsSkuVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopGoodsSpecVO;
|
|
|
+import com.kxs.product.biz.constant.enums.GoodsStatusEnum;
|
|
|
import com.kxs.product.biz.mapper.KxsShopGoodsMapper;
|
|
|
import com.kxs.product.api.model.KxsShopGoods;
|
|
|
import com.kxs.product.biz.mapper.KxsShopGoodsPicMapper;
|
|
|
@@ -17,6 +22,7 @@ import com.kxs.product.biz.mapper.KxsShopGoodsSkuMapper;
|
|
|
import com.kxs.product.biz.mapper.KxsShopGoodsSpecMapper;
|
|
|
import com.kxs.product.biz.service.KxsShopGoodsService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.checkerframework.checker.units.qual.K;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -74,14 +80,44 @@ public class KxsShopGoodsServiceImpl extends ServiceImpl<KxsShopGoodsMapper, Kxs
|
|
|
return goodsDetailVO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<SysShopGoodsPageVO> shopGoodsPage(Page page, SysShopGoodsPageDTO param) {
|
|
|
+ List<SysShopGoodsPageVO> list = baseMapper.shopGoodsPage(page, param);
|
|
|
+ if(page != null){
|
|
|
+ page.setRecords(list);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void shopGoodsAdd(SysShopGoodsAddDTO param) {
|
|
|
+ KxsShopGoods kxsShopGoods = new KxsShopGoods();
|
|
|
+ BeanUtils.copyProperties(param,kxsShopGoods);
|
|
|
+ this.save(kxsShopGoods);
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void upShelf(UpShelfDTO upShelfDTO) {
|
|
|
+ Integer id = upShelfDTO.getId();
|
|
|
+ KxsShopGoods shopGoods = this.getById(id);
|
|
|
+ if(shopGoods != null){
|
|
|
+ shopGoods.setUpTime(upShelfDTO.getUpTime());
|
|
|
+ shopGoods.setStatus(GoodsStatusEnum.UP_SHELF.getType());
|
|
|
+ }
|
|
|
+ this.updateById(shopGoods);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ @Override
|
|
|
+ public void downShelf(DownShelfDTO downShelfDTO) {
|
|
|
+ Integer id = downShelfDTO.getId();
|
|
|
+ KxsShopGoods shopGoods = this.getById(id);
|
|
|
+ if(shopGoods != null){
|
|
|
+ shopGoods.setDownTime(downShelfDTO.getDownTime());
|
|
|
+ shopGoods.setStatus(GoodsStatusEnum.DOWN_SHELF.getType());
|
|
|
+ }
|
|
|
+ this.updateById(shopGoods);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|