package cn.superdesk.uniorder.dubbo.provider.accounting.supplier;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierXGoods;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.AccountingUnifiedSupplierXGoodsParam;
import cn.superdesk.uniorder.dubbo.facade.accounting.supplier.DubboAccountingUnifiedSupplierXGoodsService;
import cn.superdesk.uniorder.service.accounting.unified.supplier.AccountingUnifiedSupplierXGoodsService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2020-10-23 17:19:13
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-10-23 17:19:13
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboAccountingUnifiedSupplierXGoodsServiceImpl implements DubboAccountingUnifiedSupplierXGoodsService {

    @Autowired
    private AccountingUnifiedSupplierXGoodsService accountingUnifiedSupplierXGoodsService;


    /****************************************** extends BaseService 部分 start ******************************************/

    @Override
    public void addObj(AccountingUnifiedSupplierXGoodsParam param) {

        AccountingUnifiedSupplierXGoods accountingUnifiedSupplierXGoods = AnBeanUtils.copy(param, AccountingUnifiedSupplierXGoods.class);
        accountingUnifiedSupplierXGoodsService.insertSelective(accountingUnifiedSupplierXGoods);

    }

    @Override
    public void updateObj(AccountingUnifiedSupplierXGoodsParam param) {

        AccountingUnifiedSupplierXGoods accountingUnifiedSupplierXGoods = AnBeanUtils.copy(param, AccountingUnifiedSupplierXGoods.class);
        accountingUnifiedSupplierXGoodsService.updateByPrimaryKeySelective(accountingUnifiedSupplierXGoods);
    }

    @Override
    public void deleteObj(Long id) {
        accountingUnifiedSupplierXGoodsService.deleteObj(id);
    }

    @Override
    public AccountingUnifiedSupplierXGoods findById(Long id) {
        return accountingUnifiedSupplierXGoodsService.findById(id);
    }

    @Override
    public PageInfo<AccountingUnifiedSupplierXGoods> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
        return accountingUnifiedSupplierXGoodsService.findByPaging(conditions, pageNun, pageSize);
    }

    @Override
    public List<AccountingUnifiedSupplierXGoods> findAll(Map<String, Object> queryMap) {

        return accountingUnifiedSupplierXGoodsService.findAll(queryMap);
    }

    /****************************************** extends BaseService 部分   end ******************************************/


    @Override
    public void addAccountingUnifiedSupplierXGoods(AccountingUnifiedSupplierXGoodsParam param) {

        AccountingUnifiedSupplierXGoods accountingUnifiedSupplierXGoods = AnBeanUtils.copy(param, AccountingUnifiedSupplierXGoods.class);
        accountingUnifiedSupplierXGoodsService.addAccountingUnifiedSupplierXGoods(accountingUnifiedSupplierXGoods);
    }

    @Override
    public void updateAccountingUnifiedSupplierXGoods(AccountingUnifiedSupplierXGoodsParam param) {

        AccountingUnifiedSupplierXGoods accountingUnifiedSupplierXGoods = AnBeanUtils.copy(param, AccountingUnifiedSupplierXGoods.class);
        accountingUnifiedSupplierXGoodsService.updateAccountingUnifiedSupplierXGoods(accountingUnifiedSupplierXGoods);
    }

    @Override
    public void deleteAccountingUnifiedSupplierXGoods(Long id) {
        accountingUnifiedSupplierXGoodsService.deleteAccountingUnifiedSupplierXGoods(id);
    }

    @Override
    public AccountingUnifiedSupplierXGoods findAccountingUnifiedSupplierXGoodsById(Long id) {
        return accountingUnifiedSupplierXGoodsService.findAccountingUnifiedSupplierXGoodsById(id);
    }

    @Override
    public R<List<AccountingUnifiedSupplierXGoods>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
        return accountingUnifiedSupplierXGoodsService.pageQuery(conditions, pageNun, pageSize);

    }
}
