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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirt;
import cn.superdesk.uniorder.dao.entity.marketing.department.UnifiedAreaCity;
import cn.superdesk.uniorder.dao.entity.sys.SysConfig;
import cn.superdesk.uniorder.dto.vo.unified.*;
import cn.superdesk.uniorder.dubbo.facade.marketing.DubboUnifiedStatisticsVirtCommonService;
import cn.superdesk.uniorder.service.marketing.UnifiedStatisticsVirtCommonService;
import cn.superdesk.uniorder.service.marketing.department.UnifiedAreaCityService;
import cn.superdesk.uniorder.service.sys.SysConfigService;
import cn.superdesk.uniorder.service.unified.UnifiedWarningService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

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


	@Autowired
	private UnifiedStatisticsVirtCommonService unifiedStatisticsVirtCommonService;
	@Autowired
	private UnifiedWarningService              unifiedWarningService;
	@Autowired
	private UnifiedAreaCityService       unifiedAreaCityService;

	@Autowired
	private SysConfigService             sysConfigService;



	@Override
	public List<UnifiedStatisticsVirt> findAll(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.findAll(params);
	}

	@Override
	public List<UnifiedStatisticsVirtVo> findAllVo(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.findAllVo(params);
	}

	@Override
	public UnifiedOrderLastMonth getlastmonth() {

		return unifiedStatisticsVirtCommonService.getlastmonth();
	}

	@Override
	public BigDecimal getReturnAmount(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.getReturnAmount(params);
	}

	@Override
	public BigDecimal getundzamount(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.getundzamount(params);
	}

	@Override
	public BigDecimal getuninvamount(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.getuninvamount(params);
	}

	@Override
	public BigDecimal getunpaymoney(Map<String, Object> params) {

		return unifiedStatisticsVirtCommonService.getunpaymoney(params);
	}

	@Override
	public BigDecimal getOrderAmountByAreaItem(Map<String, Object> queryTJ) {

		return unifiedStatisticsVirtCommonService.getOrderAmountByAreaItem(queryTJ);
	}

	@Override
	public List<WarningOrderAmountVo> getWarningOrderAmount(Map<String, Object> queryMap) {

		return unifiedWarningService.getWarningOrderAmount(queryMap);
	}

	@Override
	public BigDecimal getreturnAmountByAreaItem(Map<String, Object> queryTJ) {

		return unifiedStatisticsVirtCommonService.getreturnAmountByAreaItem(queryTJ);
	}

	@Override
	public R<List<UnifiedCustomerTJ>> getDataByPage(Map<String, Object> params, int pageNum, int pageSize) {
		return unifiedStatisticsVirtCommonService.getDataByPage(params, pageNum, pageSize);
	}

	@Override
	public List<UnifiedCustomerTJ> getStatisticsVirtData(Map<String, Object> params) {
		return unifiedStatisticsVirtCommonService.getStatisticsVirtData(params);
	}

	@Override
	public BigDecimal getOrderCostAmount(Map<String, Object> costQuery) {
		return unifiedStatisticsVirtCommonService.getOrderCostAmount(costQuery);
	}

	@Override
	public UnifiedStatisticsVirtSum getStatisticsSum(Map<String, Object> query) {
		return unifiedStatisticsVirtCommonService.getStatisticsSum(query);
	}

	@Override
	public SysConfig getConfigData(String code) {
		return sysConfigService.findByCode(code);
	}

	@Override
	public void updateConfig(SysConfig config) {
		sysConfigService.updateByPrimaryKeySelective(config);
	}

	@Override
	public List<UnifiedAreaCity> findAllAreaCity() {
		Map<String, Object> query = new HashMap<>();
		return unifiedAreaCityService.findAll(query);
	}

	@Override
	public void updateAreaCity(UnifiedAreaCity item) {
		unifiedAreaCityService.updateObjTran(item);
	}

	@Override
	public List<UnifiedStatisticsVirt> getVirtOrderReturnStatistical(Map<String, Object> queryMap) {
		return unifiedStatisticsVirtCommonService.getVirtOrderReturnStatistical(queryMap);
	}

	@Override
	public void updateStatisticsVirt(UnifiedStatisticsVirt update) {
		unifiedStatisticsVirtCommonService.updateByPrimaryKeySelective(update);
	}

	@Override
	public void insertStatisticsVirt(UnifiedStatisticsVirt add) {
		unifiedStatisticsVirtCommonService.insertSelective(add);
	}

}
