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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.exception.UnifiedOrderRuntimeException;
import cn.superdesk.uniorder.dao.entity.fund.SysFundActivated;
import cn.superdesk.uniorder.dto.vo.fund.SysFundActivatedVoEx;
import cn.superdesk.uniorder.service.fund.SysFundActivatedService;
import cn.superdesk.uniorder.service.fund.SysFundGrantService;
import cn.superdesk.uniorder.service.fund.SysFundUserService;
import cn.superdesk.uniorder.dubbo.facade.fund.DubboSysFundActivatedService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

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

@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysFundActivatedServiceImpl implements DubboSysFundActivatedService {

	@Autowired
	private SysFundActivatedService sysFundActivatedService;
	@Autowired
	private SysFundGrantService     sysFundGrantService;
	@Autowired
	private SysFundUserService      sysFundUserService;

	@Override
	public void create(String token, SysFundActivated sysFundActivated) throws UnifiedOrderRuntimeException {
		sysFundActivatedService.create(sysFundActivated, token);
	}

	public void update(String token, SysFundActivated sysFundActivated) throws UnifiedOrderRuntimeException {
		sysFundActivatedService.update(sysFundActivated, token);
	}

	@Override
	public R<List<SysFundActivatedVoEx>> findAllViewPage(Map<String, Object> params, int pageNum, int pageSize) {
		return sysFundActivatedService.findAllViewPage(params, pageNum, pageSize);
	}

	@Override
	public void importExcel(String token, Map<String, List<Map<String, Object>>> map) throws UnifiedOrderRuntimeException {
		sysFundActivatedService.importExcel(map, token);
	}
}
