package com.hzs.ground.product.provider;/**
 * @Description:
 * @Author: yuhui
 * @Time: 2023/11/23 18:27
 * @Classname: IBdProductBasSpecsServiceProvider
 * @PackageName: com.hzs.scm.product.provider
 */

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.product.BdProductBasSpecs;
import com.hzs.ground.product.service.IBdProductBasSpecsService;
import com.hzs.scm.product.IBdProductBasSpecsServiceApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 *@BelongsProject: hzs_cloud
 *@BelongsPackage: com.hzs.scm.product.provider
 *@Author: yh
 *@CreateTime: 2023-11-23  18:27
 *@Description: TODO
 *@Version: 1.0
 */
@Slf4j
@DubboService
public class IBdProductBasSpecsServiceProvider implements IBdProductBasSpecsServiceApi {

    @Autowired
    private IBdProductBasSpecsService productBasSpecsService;

    /**
     * 新增
     * @param productBasSpecsList
     * @return
     */
    @Override
    public R<Boolean> saveAll(List<BdProductBasSpecs> productBasSpecsList) {
        return R.ok(productBasSpecsService.saveBatch(productBasSpecsList));
    }
    /**
     * 删除 （根据pkProductBas删除）
     * @param pkProductBasList
     * @return
     */
    @Override
    public R<Boolean> removeByPkProductBasList(List<Integer> pkProductBasList) {
        return R.ok(productBasSpecsService.remove(new QueryWrapper<BdProductBasSpecs>().in("PK_PRODUCT_BAS",pkProductBasList)));
    }
}
