package cn.superdesk.uniorder.dubbo.provider.order.base;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.base.UnifiedOrderGoods;
import cn.superdesk.uniorder.dto.param.order.base.UnifiedOrderGoodsParam;
import cn.superdesk.uniorder.dto.param.order.base.UnifiedOrderGoodsQueryCriteria;
import cn.superdesk.uniorder.dto.vo.order.base.UnifiedOrderGoodsHeadVo;
import cn.superdesk.uniorder.dto.vo.order.base.UnifiedOrderGoodsListItemVo;
import cn.superdesk.uniorder.dubbo.facade.order.base.DubboUnifiedOrderGoodsService;
import cn.superdesk.uniorder.service.order.base.UnifiedOrderGoodsService;
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: 2021-01-06 20:55:13
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-01-06 20:55:13
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 60000)
public class DubboUnifiedOrderGoodsServiceImpl implements DubboUnifiedOrderGoodsService {

    @Autowired
    private UnifiedOrderGoodsService unifiedOrderGoodsService;


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

    @Override
    public int insertSelective(UnifiedOrderGoods entity) {
        return unifiedOrderGoodsService.insertSelective(entity);
    }

    @Override
    public int updateByPrimaryKeySelective(UnifiedOrderGoods entity) {
        return unifiedOrderGoodsService.updateByPrimaryKeySelective(entity);
    }

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

    @Override
    public UnifiedOrderGoods findById(Long id) {
        return unifiedOrderGoodsService.findById(id);
    }

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

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

        return unifiedOrderGoodsService.findAll(queryMap);
    }

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


    @Override
    public int addUnifiedOrderGoods(UnifiedOrderGoodsParam param, LoginSysUser loginSysUser) {

        UnifiedOrderGoods unifiedOrderGoods = AnBeanUtils.copy(param, UnifiedOrderGoods.class);
        return unifiedOrderGoodsService.addUnifiedOrderGoods(unifiedOrderGoods);
    }

    @Override
    public int updateUnifiedOrderGoods(UnifiedOrderGoodsParam param, LoginSysUser loginSysUser) {

        UnifiedOrderGoods unifiedOrderGoods = AnBeanUtils.copy(param, UnifiedOrderGoods.class);
        return unifiedOrderGoodsService.updateUnifiedOrderGoods(unifiedOrderGoods);
    }

    @Override
    public int deleteUnifiedOrderGoods(Long id, LoginSysUser loginSysUser) {
        return unifiedOrderGoodsService.deleteUnifiedOrderGoods(id);
    }

    @Override
    public UnifiedOrderGoods findUnifiedOrderGoodsById(Long id) {
        return unifiedOrderGoodsService.findUnifiedOrderGoodsById(id);
    }

    @Override
    public UnifiedOrderGoodsListItemVo findListItemVoById(Long id, LoginSysUser loginSysUser) {
        return unifiedOrderGoodsService.findListItemVoById(id, loginSysUser);
    }

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

    @Override
    public R<List<UnifiedOrderGoodsListItemVo>> pageQueryGenericParam(
            UnifiedOrderGoodsQueryCriteria queryCriteria,
            LoginSysUser loginSysUser) {
        return unifiedOrderGoodsService.pageQueryGenericParam(queryCriteria, loginSysUser);
    }

    @Override
    public UnifiedOrderGoodsHeadVo queryHeadGenericParam(
            UnifiedOrderGoodsQueryCriteria queryCriteria,
            LoginSysUser loginSysUser) {
        return unifiedOrderGoodsService.queryHeadGenericParam(queryCriteria, loginSysUser);
    }

    @Override
    public List<UnifiedOrderGoodsListItemVo> queryGenericParam(
            UnifiedOrderGoodsQueryCriteria queryCriteria,
            LoginSysUser loginSysUser) {
        return unifiedOrderGoodsService.queryGenericParam(queryCriteria, loginSysUser);
    }

    /****************************************** Biz 部分   end ******************************************/

    /****************************************** 补丁部分 mark by linjinyu at 20210323 start ******************************************/


    @Override
    public String checkAndFixFixTaxRateTaxCodeFiscalCode() {
        return unifiedOrderGoodsService.checkAndFixFixTaxRateTaxCodeFiscalCode();
    }
}
