package cn.superdesk.uniorder.dubbo.provider.channel;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.dubbo.facade.channel.DubboUnifiedChannelProfitSyncService;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.channel.UnifiedChannelProfitSync;
import cn.superdesk.uniorder.dto.dubbo.channel.UnifiedChannelProfitSyncParam;
import cn.superdesk.uniorder.dto.vo.unified.UnifiedChannelProfitSyncPage;
import cn.superdesk.uniorder.service.channel.UnifiedChannelProfitSyncService;
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-08-28 16:37:32
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-08-28 16:37:32
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboUnifiedChannelProfitSyncServiceImpl implements DubboUnifiedChannelProfitSyncService {

	@Autowired
	private UnifiedChannelProfitSyncService unifiedChannelProfitSyncService;


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

	@Override
	public void addObj(UnifiedChannelProfitSyncParam param) {

		UnifiedChannelProfitSync unifiedChannelProfitSync = AnBeanUtils.copy(param, UnifiedChannelProfitSync.class);
		unifiedChannelProfitSyncService.insertSelective(unifiedChannelProfitSync);

	}

	@Override
	public void updateObj(UnifiedChannelProfitSyncParam param) {

		UnifiedChannelProfitSync unifiedChannelProfitSync = AnBeanUtils.copy(param, UnifiedChannelProfitSync.class);
		unifiedChannelProfitSyncService.updateByPrimaryKeySelective(unifiedChannelProfitSync);
	}

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

	@Override
	public UnifiedChannelProfitSync findById(Long id) {
		return unifiedChannelProfitSyncService.findById(id);
	}

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

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

		return unifiedChannelProfitSyncService.findAll(queryMap);
	}

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


	@Override
	public void addUnifiedChannelProfitSync(UnifiedChannelProfitSyncParam param) {

		UnifiedChannelProfitSync unifiedChannelProfitSync = AnBeanUtils.copy(param, UnifiedChannelProfitSync.class);
		unifiedChannelProfitSyncService.addUnifiedChannelProfitSync(unifiedChannelProfitSync);
	}

	@Override
	public void addUnifiedChannelProfitSync(UnifiedChannelProfitSync channelSync) {
		unifiedChannelProfitSyncService.insertSelective(channelSync);
	}

	@Override
	public void updateUnifiedChannelProfitSync(UnifiedChannelProfitSyncParam param) {

		UnifiedChannelProfitSync unifiedChannelProfitSync = AnBeanUtils.copy(param, UnifiedChannelProfitSync.class);
		unifiedChannelProfitSyncService.updateUnifiedChannelProfitSync(unifiedChannelProfitSync);
	}

	@Override
	public void updateUnifiedChannelProfitSync(UnifiedChannelProfitSync channelSync) {
		unifiedChannelProfitSyncService.updateByPrimaryKeySelective(channelSync);
	}

	@Override
	public void deleteUnifiedChannelProfitSync(Long id) {
		unifiedChannelProfitSyncService.deleteUnifiedChannelProfitSync(id);
	}
//	@Override
//	public void deleteUnifiedChannelProfitSync(Long id) {
//		unifiedChannelProfitSyncService.deleteObj(id);
//	}

	@Override
	public UnifiedChannelProfitSync findUnifiedChannelProfitSyncById(Long id) {
		return unifiedChannelProfitSyncService.findUnifiedChannelProfitSyncById(id);
	}

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

	}


	////////////////////

	@Override
	public List<UnifiedChannelProfitSync> getChannelProfitAll(Map<String, Object> params) {
		return unifiedChannelProfitSyncService.findAll(params);
	}

	@Override
	public UnifiedChannelProfitSync findUnifiedChannelProfitSyncBySyncId(Long id) {
		return unifiedChannelProfitSyncService.findChannelProfitBySyncId(id);
	}


	@Override
	public R<List<UnifiedChannelProfitSyncPage>> getChannelPage(Map<String, Object> params, int pageNum, int pageSize) {
		return unifiedChannelProfitSyncService.getChannelPage(params, pageNum, pageSize);
	}

	@Override
	public void deleteReceiveUnifiedChannelProfitSync(String message) {
		unifiedChannelProfitSyncService.deleteReceiveUnifiedChannelProfitSync(message);
	}

	@Override
	public void mergeReceiveUnifiedChannelProfitSync(String message) {
		unifiedChannelProfitSyncService.mergeReceiveUnifiedChannelProfitSync(message);

	}
}
