package cn.superdesk.uniorder.dubbo.provider.thirdpart.szhtxx.electronicInvoice;

import cn.hutool.core.date.DateUtil;
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.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxExtendInfo;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxExtendInfoParam;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxExtendInfoQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.szhtxx.electronicInvoice.DubboSzhtxxElectronicInvoiceFptxxExtendInfoService;
import cn.superdesk.uniorder.service.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxExtendInfoService;
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: 2022-03-17 13:52:19
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-03-17 13:52:19
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSzhtxxElectronicInvoiceFptxxExtendInfoServiceImpl implements DubboSzhtxxElectronicInvoiceFptxxExtendInfoService {

    @Autowired
    private SzhtxxElectronicInvoiceFptxxExtendInfoService szhtxxElectronicInvoiceFptxxExtendInfoService;


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

    @Override
    public int insertSelective(SzhtxxElectronicInvoiceFptxxExtendInfo entity) {

        return szhtxxElectronicInvoiceFptxxExtendInfoService.insertSelective(entity);

    }

    @Override
    public int updateByPrimaryKeySelective(SzhtxxElectronicInvoiceFptxxExtendInfo entity) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.updateByPrimaryKeySelective(entity);
    }

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

    @Override
    public SzhtxxElectronicInvoiceFptxxExtendInfo findById(Long id) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.findById(id);
    }

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

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

        return szhtxxElectronicInvoiceFptxxExtendInfoService.findAll(queryMap);
    }

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

    @Override
    public int saveOrUpdate(SzhtxxElectronicInvoiceFptxxExtendInfo entity, LoginSysUser loginSysUser) {

        entity.setUpdateTime(DateUtil.date());
        entity.setUpdateUserId(loginSysUser.getSysUserId());
        entity.setUpdateUserName(loginSysUser.getFullName());

        return szhtxxElectronicInvoiceFptxxExtendInfoService.saveOrUpdateByFpqqlsh(entity);
    }

    @Override
    public int addSzhtxxElectronicInvoiceFptxxExtendInfo(SzhtxxElectronicInvoiceFptxxExtendInfoParam param) {

        SzhtxxElectronicInvoiceFptxxExtendInfo szhtxxElectronicInvoiceFptxxExtendInfo = AnBeanUtils.copy(param, SzhtxxElectronicInvoiceFptxxExtendInfo.class);
        return szhtxxElectronicInvoiceFptxxExtendInfoService.insertSelective(szhtxxElectronicInvoiceFptxxExtendInfo);
    }

    @Override
    public int updateSzhtxxElectronicInvoiceFptxxExtendInfo(SzhtxxElectronicInvoiceFptxxExtendInfoParam param) {

        SzhtxxElectronicInvoiceFptxxExtendInfo szhtxxElectronicInvoiceFptxxExtendInfo = AnBeanUtils.copy(param, SzhtxxElectronicInvoiceFptxxExtendInfo.class);
        return szhtxxElectronicInvoiceFptxxExtendInfoService.updateByPrimaryKeySelective(szhtxxElectronicInvoiceFptxxExtendInfo);
    }


    @Override
    public int deleteSzhtxxElectronicInvoiceFptxxExtendInfo(Long id) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.deleteSzhtxxElectronicInvoiceFptxxExtendInfo(id);
    }

    @Override
    public SzhtxxElectronicInvoiceFptxxExtendInfo findSzhtxxElectronicInvoiceFptxxExtendInfoById(Long id) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.findSzhtxxElectronicInvoiceFptxxExtendInfoById(id);
    }

    @Override
    public SzhtxxElectronicInvoiceFptxxExtendInfo findByFpqqlsh(String fpqqlsh) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.findByFpqqlsh(fpqqlsh);
    }

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

    @Override
    public R<List<SzhtxxElectronicInvoiceFptxxExtendInfo>> pageQueryGenericParam(SzhtxxElectronicInvoiceFptxxExtendInfoQueryCriteria criteria) {
        return szhtxxElectronicInvoiceFptxxExtendInfoService.pageQueryGenericParam(criteria);
    }
}
