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

import cn.superdesk.uniorder.common.json.AnJsonUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.JwtUtil;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.base.UnifiedOrder;
import cn.superdesk.uniorder.dto.param._function.select.SelectOptionDepartmentCriteria;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.*;
import cn.superdesk.uniorder.dto.param.accounting.unified.customer.ExportCustomerStatementOfAccountDetailCriteria;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.AccountingSupplierNotYetDimGoodsQueryCriteria;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.SuplierStatementOfAccountDetailQueryCriteria;
import cn.superdesk.uniorder.dto.receive.consumer.superdeskappservices.UnifiedLnssOrderAdd;
import cn.superdesk.uniorder.dto.vo._function.select.SelectOptionDepartment;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.notyet.CustomerUnAccountingDimGoodsVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.notyet.UnifiedOrderCustomerHeadSumVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.notyet.UnifiedOrderCustomerNotCheckVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.notyet.UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.notyet.UnifiedOrderSupplierHeadSumVo;
import cn.superdesk.uniorder.dto.vo.invoice.customer.InvoiceApplyDetailDimCreditItemVo;
import cn.superdesk.uniorder.dto.vo.order.Org2VirtStatisticsVo;
import cn.superdesk.uniorder.dto.vo.score.ScoreOrderReconciliationNotYetHeadVo;
import cn.superdesk.uniorder.dto.vo.unified.*;
import cn.superdesk.uniorder.dto.vo.wechat.WxBillOrder;
import cn.superdesk.uniorder.dto.vo.wechat.WxBillVirt;
import cn.superdesk.uniorder.dubbo.consumer._permission.PermissionDubboCustomerService;
import cn.superdesk.uniorder.dubbo.facade.order.base.DubboUnifiedOrderService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;


/**
 * @Description: Java类作用描述
 * @Author: linjinyu 重构
 * @CreateDate: 2020/12/23 下午9:20
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/12/23 下午9:20
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class UnifiedOrderDubboConsumerService {

	@Reference(version = "1.0.0", timeout = 180000, retries = -1)
	private DubboUnifiedOrderService dubboUnifiedOrderService;

	@Resource
	private PermissionDubboCustomerService permissionDubboCustomerService;

	public List<SelectOptionDepartment> getSelectPurchaseDepartment(SelectOptionDepartmentCriteria criteria, String token) {

//		Boolean      isPass       = permissionDubboCustomerService.addOnPerm(token, criteria);
//		if (isPass.equals(false)) {
//			return null;
//		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getSelectPurchaseDepartment(criteria, loginSysUser);
	}

	public Map<String, Object> addObjTran(UnifiedLnssOrderAdd unifiedLnssOrderAdd) {

		return dubboUnifiedOrderService.addObjTran(unifiedLnssOrderAdd);
	}

	public void updateObj(UnifiedOrder unifiedOrder) {
		dubboUnifiedOrderService.updateObj(unifiedOrder);
	}

	public UnifiedOrder findByOrderSn(String sn) {

		return dubboUnifiedOrderService.findByOrderSn(sn);
	}


	/*************************************************  订单管理  start ********************************************************/
	/**
	 * 前端-订单管理-订单管理 列表
	 *
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @param token
	 * @return
	 */
	public R<List<UnifiedOrderGoodsVo>> getOrderManagerGoodsByPage(Map<String, Object> params, int pageNum, int pageSize, String token) {


		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			R<List<UnifiedOrderGoodsVo>> responseResult = new R<>();
			responseResult.setSuccess(false);
			responseResult.setMessage("您没有企业数据权限！");
			return responseResult;
		}

		return dubboUnifiedOrderService.getOrderManagerGoodsByPage(params, pageNum, pageSize);
	}

	/**
	 * 前端-订单管理-订单管理 头部
	 *
	 * @param params
	 * @param token
	 * @return
	 */
	public UnifiedOrderCommonHeadSum getOrderManagerGoodsPageHead(Map<String, Object> params, String token) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getOrderManagerGoodsPageHead(params);
	}

	/**
	 * 前端-订单管理-订单管理(企业采购) opt(按钮) 导出成本
	 *
	 * @param token
	 * @param params
	 * @return
	 */
	public List<UnifiedOrderGoodsVo> getOrderManagerGoodsView(String token, Map<String, Object> params) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		log.info("\n订单管理 > 订单管理 (企业采购) opt 导出成本 params : \n{}", AnJsonUtils.toPrettyJson(params));

		// TODO 排序 订单 create_time 倒
//		params.put("orderBy", "uo.create_time desc , uo.order_sn desc, uog.id asc");
		return dubboUnifiedOrderService.getOrderManagerGoodsView(params);
	}

	/****************************************** export excel mark by linjinyu at 20210305 start ******************************************/

	public String exportExcelOrderManagerGoodsData(String token, Map<String, Object> params) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportExcelOrderManagerGoodsData(params, loginSysUser);
	}

	public String exportExcelOrderManagerGoodsCostPrice(String token, Map<String, Object> params) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportExcelOrderManagerGoodsCostPrice(params, loginSysUser);
	}

	/****************************************** export excel mark by linjinyu at 20210305   end ******************************************/

	/**
	 * 项目 2 企业 订单 统计
	 *
	 * @param token
	 * @param params
	 * @return
	 */
	public R<List<Org2VirtStatisticsVo>> getOrg2VirtStatistics(String token, Map<String, Object> params, int pageNum, int pageSize) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		log.info("\n订单管理 > 订单管理 项目 2 企业 订单 统计 params : \n{}", AnJsonUtils.toPrettyJson(params));

		return dubboUnifiedOrderService.getOrg2VirtStatistics(params, pageNum, pageSize);
	}


	/****************************************** 订单管理   end ******************************************/


	/****************************************** 客户结算 dim order 未对账 订单 start ******************************************/
	/**
	 * 前端 客户结算 > 未对账订单
	 *
	 * @param token
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public R<List<UnifiedOrderCustomerNotCheckVo>> getCustomerUnAccountingDimOrderList(String token, Map<String, Object> params, int pageNum, int pageSize) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			R<List<UnifiedOrderCustomerNotCheckVo>> responseResult = new R<>();
			responseResult.setSuccess(false);
			responseResult.setMessage("您没有企业数据权限！");
			return responseResult;
		}

		return dubboUnifiedOrderService.getCustomerUnAccountingDimOrderList(params, pageNum, pageSize);
	}

	public UnifiedOrderCommonHeadSum getCustomerUnAccountingDimOrderHeadSum(String token, Map<String, Object> params) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getCustomerUnAccountingDimOrderHeadSum(params);
	}
	/****************************************** 客户结算 dim order 未对账 订单   end ******************************************/

	/****************************************** 客户结算 dim goods 未对账 商品 start ******************************************/

	public UnifiedOrderCustomerHeadSumVo getCustomerUnAccountingDimGoodsHeadSum(String token, Map<String, Object> params) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getCustomerUnAccountingDimGoodsHeadSum(params, token);
	}

	public List<CustomerUnAccountingDimGoodsVo> getCustomerUnAccountingDimGoodsList(Map<String, Object> params, String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getCustomerUnAccountingDimGoodsList(params, token);
	}

	public R<List<CustomerUnAccountingDimGoodsVo>> getCustomerUnAccountingDimGoodsList(Map<String, Object> params, int pageNo, int pageSize, String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getCustomerUnAccountingDimGoodsList(params, pageNo, pageSize, token);
	}


	/****************************************** 客户结算 dim goods 未对账 商品   end ******************************************/


	/****************************************** 积分结算 未对账 流水 start ******************************************/

	public ScoreOrderReconciliationNotYetHeadVo getScoreOrderReconciliationNotYetHeadSum(AccountingOrderScoreCustomerNotYetDimCreditQueryCriteria queryCriteria, String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetHeadSum(queryCriteria, loginSysUser);
	}

	public R<List<InvoiceApplyDetailDimCreditItemVo>> getScoreOrderReconciliationNotYetByPageQuery(AccountingOrderScoreCustomerNotYetDimCreditQueryCriteria queryCriteria, String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetByPageQuery(queryCriteria, loginSysUser);
	}

	public List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene1(
			AccountingOrderScoreCustomerNotYetDimCreditScene1QueryCriteria queryCriteria,
			String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetScene1(queryCriteria, loginSysUser);
	}

	public List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene2(
			AccountingOrderScoreCustomerNotYetDimCreditScene2QueryCriteria queryCriteria,
			String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetScene2(queryCriteria, loginSysUser);
	}

	public List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene3(
			AccountingOrderScoreCustomerNotYetDimCreditScene3QueryCriteria queryCriteria,
			String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetScene3(queryCriteria, loginSysUser);
	}

	public R<List<InvoiceApplyDetailDimCreditItemVo>> getScoreOrderReconciliationNotYetScene4(
			AccountingOrderScoreCustomerNotYetDimCreditScene4QueryCriteria queryCriteria,
			String token) {

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getScoreOrderReconciliationNotYetScene4(queryCriteria, loginSysUser);
	}

	public String exportExcelScoreOrderReconciliationNotYet(
			AccountingOrderScoreCustomerNotYetDimCreditScene1QueryCriteria queryCriteria,
			String token) {

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportExcelScoreOrderReconciliationNotYet(queryCriteria, loginSysUser);
	}


	/****************************************** 积分结算 未对账 流水   end ******************************************/

	/****************************************** 供应商结算 dim order 未对账 订单 start ******************************************/

	public UnifiedOrderSupplierHeadSumVo getSupplierUnAccountingDimOrderHeadSum(Map<String, Object> params, String token) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getSupplierUnAccountingDimOrderHeadSum(params);
	}

	public List<UnifiedOrderSupplierNotCheckDetail2GoodsVo> getSupplierUnAccountingDetailDimOrder2Goods(Map<String, Object> params, String token) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}
		return dubboUnifiedOrderService.getSupplierUnAccountingDetail2Goods(params);
	}

	public List<UnifiedOrderSupplierDimOrderNotCheckVo> getSupplierUnAccountingDimOrderList(Map<String, Object> params, String token) {

		return dubboUnifiedOrderService.getSupplierUnAccountingDimOrderList(params);
	}

	public R<List<UnifiedOrderSupplierDimOrderNotCheckVo>> getSupplierUnAccountingDimOrderList(Map<String, Object> params, int pageNum, int pageSize, String token) {

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			R<List<UnifiedOrderSupplierDimOrderNotCheckVo>> responseResult = new R<>();
			responseResult.setSuccess(false);
			responseResult.setMessage("您没有企业数据权限！");
			return responseResult;
		}

		return dubboUnifiedOrderService.getSupplierUnAccountingDimOrderList(params, pageNum, pageSize);
	}

	/****************************************** 供应商结算 dim order 未对账 订单   end ******************************************/

	/****************************************** 供应商结算 dim goods 未对账 商品 start ******************************************/

	public UnifiedOrderSupplierHeadSumVo getSupplierUnAccountingDimGoodsHeadSum(AccountingSupplierNotYetDimGoodsQueryCriteria criteria, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, criteria);
		if (isPass.equals(false)) {
			return null;
		}

		return dubboUnifiedOrderService.getSupplierUnAccountingDimGoodsHeadSum(criteria);
	}

	public List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierUnAccountingDimGoodsList(AccountingSupplierNotYetDimGoodsQueryCriteria criteria, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, criteria);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		// 已加 数据脱敏逻辑 20211203
		return dubboUnifiedOrderService.getSupplierUnAccountingDimGoodsList(criteria, loginSysUser);
	}

	/**
	 * 已添加 数据脱敏逻辑 20211203
	 *
	 * @param criteria
	 * @param token
	 * @return
	 */
	public R<List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo>> getSupplierUnAccountingDimGoodsListByPageQuery(AccountingSupplierNotYetDimGoodsQueryCriteria criteria, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, criteria);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		// 已添加 数据脱敏逻辑 20211203
		return dubboUnifiedOrderService.getSupplierUnAccountingDimGoodsListByPageQuery(criteria, loginSysUser);
	}

	/**
	 * 已添加 数据脱敏逻辑 20211203
	 *
	 * @param criteria
	 * @param token
	 * @return
	 */
	public String exportExcelAccountingSupplierNotYetDimGoods(AccountingSupplierNotYetDimGoodsQueryCriteria criteria, String token) {

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		// 已添加 数据脱敏逻辑 20211203
		return dubboUnifiedOrderService.exportExcelAccountingSupplierNotYetDimGoods(criteria, loginSysUser);
	}

	/****************************************** 供应商结算 dim goods 未对账 商品   end ******************************************/


	/****************************************** 客户结算 对账单 详情 start ******************************************/
	public String exportCustomerStatementOfAccountDetailCompatible(ExportCustomerStatementOfAccountDetailCriteria criteria, String token) {

		/****************************************** 数据权限 start ******************************************/

//		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, criteria);
//		if (isPass.equals(false)) {
//			return null;
//		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportCustomerStatementOfAccountDetailCompatible(criteria, loginSysUser);

	}

	/****************************************** 供应商结算 对账单 详情 start ******************************************/
	/**
	 * 已添加 数据脱敏逻辑 20211203
	 * 对账单 详情 订单维度
	 *
	 * @param queryCriteria
	 * @param token
	 * @return
	 */
	public List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierStatementOfAccountDetailDimOrder2Goods(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, String token) {

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getSupplierStatementOfAccountDetailDimOrder2Goods(queryCriteria, loginSysUser);
	}

	/**
	 * 已添加 数据脱敏逻辑 20211203
	 * 对账单 详情 商品维度
	 *
	 * @param queryCriteria
	 * @param token
	 * @return
	 */
	public List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierStatementOfAccountDetailDimGoods2Goods(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, String token) {


		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getSupplierStatementOfAccountDetailDimGoods2Goods(queryCriteria, loginSysUser);
	}

	public String exportSupplierStatementOfAccountDetailCompatible(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, queryCriteria);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportSupplierStatementOfAccountDetailCompatible(queryCriteria, loginSysUser);

	}

	/****************************************** 供应商结算 对账单 详情   end ******************************************/


	public UnifiedOrderGoodsDetailVo getGoodsDetail(Long id, String token) {

		return dubboUnifiedOrderService.getGoodsDetail(id);
	}


	/****************************************** 客户结算对账 未对账商品 start ******************************************/
	/**
	 * 1. 客户结算对账 未对账商品 列表
	 *
	 * @param params
	 * @param token
	 * @return
	 */
	public List<UnifiedOrderJoinGoodsDetailVo> getUnifiedOrderJoinGoodsDetailVoList(Map<String, Object> params, String token) {

		/****************************************** 数据权限 start ******************************************/

		// 20191205 add 数据权限
		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.getUnifiedOrderJoinGoodsDetailVoList(params);
	}


	/**
	 * 超级前台
	 *
	 * @param params
	 * @param token
	 * @return
	 */
	public String exportExcelAccountingCustomerNotYetDimOrder(Map<String, Object> params, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportExcelAccountingCustomerNotYetDimOrder(params, loginSysUser);
	}

	/**
	 * 超级前台
	 * 1. 客户结算对账 未对账商品 新版 导出
	 *
	 * @param params
	 * @param token
	 * @return
	 */
	public String exportExcelAccountingCustomerNotYetDimGoods(Map<String, Object> params, String token) {

		/****************************************** 数据权限 start ******************************************/

		Boolean isPass = permissionDubboCustomerService.addOnPerm(token, params);
		if (isPass.equals(false)) {
			return null;
		}

		/****************************************** 数据脱敏 start ******************************************/

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		return dubboUnifiedOrderService.exportExcelAccountingCustomerNotYetDimGoods(params, loginSysUser);
	}


	/****************************************** 客户结算对账 未对账商品   end ******************************************/

	public List<UnifiedOrder> findAll(Map<String, Object> queryMap, String token) {

		return dubboUnifiedOrderService.findAll(queryMap);
	}


	public Integer countAll(Map<String, Object> queryMap) {
		return dubboUnifiedOrderService.countAll(queryMap);
	}


	/**
	 * TODO 这个取什么 金额呀?
	 *
	 * @param amountQuery
	 * @return
	 */
	public BigDecimal getAmount(Map<String, Object> amountQuery) {

		return dubboUnifiedOrderService.getAmount(amountQuery);
	}

	public BigDecimal getPayAmount(Map<String, Object> upaymap) {

		return dubboUnifiedOrderService.getPayAmount(upaymap);
	}

	public List<WxBillOrder> getVirtOrder(Map<String, Object> params) {

		return dubboUnifiedOrderService.getVirtOrder(params);
	}

	public WxBillVirt getVirtBill(Long virtId, int syear) {

		return dubboUnifiedOrderService.getVirtBill(virtId, syear);
	}


	public Integer getOrderCount(Map<String, Object> queryMap) {
		return dubboUnifiedOrderService.getOrderCount(queryMap);
	}
}
