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

import cn.superdesk.uniorder.common.rest.response.R;
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 java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2020/10/27 下午8:58
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/10/27 下午8:58
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface DubboUnifiedOrderService {


    List<SelectOptionDepartment> getSelectPurchaseDepartment(SelectOptionDepartmentCriteria criteria, LoginSysUser loginSysUser);


    Map<String, Object> addObjTran(UnifiedLnssOrderAdd unifiedLnssOrderAdd);

    void updateObj(UnifiedOrder unifiedOrder);


    /****************************************** 客户结算 对账单 详情 start ******************************************/

//	accountingUnifiedCustomerDubboConsumerService.getCustomerStatementOfAccountDetailDimOrder2Goods(id);
//	accountingUnifiedCustomerDubboConsumerService.getCustomerStatementOfAccountDetailDimGoods2Goods(id);

    String exportCustomerStatementOfAccountDetailCompatible(ExportCustomerStatementOfAccountDetailCriteria criteria, LoginSysUser loginSysUser);

    /****************************************** 客户结算 对账单 详情   end ******************************************/


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

    /**
     * 供应商 对账单 详情 订单维度
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
    List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierStatementOfAccountDetailDimOrder2Goods(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    /**
     * 供应商 对账单
     * 1. 详情 商品维度
     * 2. 详情 导出
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
    List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierStatementOfAccountDetailDimGoods2Goods(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    String exportSupplierStatementOfAccountDetailCompatible(SuplierStatementOfAccountDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser);

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

    UnifiedOrder findByOrderSn(String sn);

    UnifiedOrderGoodsDetailVo getGoodsDetail(Long id);


    /****************************************** 1. 页面-客户结算对账 未对账商品 start ******************************************/

    /**
     * 列表
     *
     * @param params
     * @return
     */
    List<UnifiedOrderJoinGoodsDetailVo> getUnifiedOrderJoinGoodsDetailVoList(Map<String, Object> params);

    /**
     * 导出
     *
     * @param params
     * @param loginSysUser
     * @return
     */
    String exportExcelAccountingCustomerNotYetDimOrder(Map<String, Object> params, LoginSysUser loginSysUser);

    String exportExcelAccountingCustomerNotYetDimGoods(Map<String, Object> params, LoginSysUser loginSysUser);

    /****************************************** 1. 页面-客户结算对账 未对账商品   end ******************************************/


    List<UnifiedOrder> findAll(Map<String, Object> queryMap);


    Integer countAll(Map<String, Object> queryMap);

    Integer getOrderCount(Map<String, Object> queryMap);


    /****************************************** 订单管理 start ******************************************/
    UnifiedOrderCommonHeadSum getOrderManagerGoodsPageHead(Map<String, Object> params);

    /**
     * 用于 订单管理 订单管理
     *
     * @param params
     * @return
     */
    List<UnifiedOrderGoodsVo> getOrderManagerGoodsView(Map<String, Object> params);

    R<List<Org2VirtStatisticsVo>> getOrg2VirtStatistics(Map<String, Object> params, int pageNum, int pageSize);


    /**
     * 一般订单 得未结算数据 商品维度
     * getGoodsByPage
     * getScoreOrderReconciliationNotYet
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    R<List<UnifiedOrderGoodsVo>> getOrderManagerGoodsByPage(Map<String, Object> params, int pageNum, int pageSize);

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

    /****************************************** 订单管理-列表数据导出 export excel start ******************************************/

    String exportExcelOrderManagerGoodsData(Map<String, Object> params, LoginSysUser loginSysUser);

    String exportExcelOrderManagerGoodsCostPrice(Map<String, Object> params, LoginSysUser loginSysUser);

    /****************************************** 订单管理-列表数据导出 export excel   end ******************************************/


    /****************************************** 客户结算 dim order 未对账 订单 start ******************************************/

    UnifiedOrderCommonHeadSum getCustomerUnAccountingDimOrderHeadSum(Map<String, Object> params);

    R<List<UnifiedOrderCustomerNotCheckVo>> getCustomerUnAccountingDimOrderList(Map<String, Object> params, int pageNum, int pageSize);

    /****************************************** 客户结算 dim order 未对账 订单   end ******************************************/

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

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

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

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

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


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

    ScoreOrderReconciliationNotYetHeadVo getScoreOrderReconciliationNotYetHeadSum(AccountingOrderScoreCustomerNotYetDimCreditQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    /**
     * 积分订单 得未结算数据 积分流水维度
     * getGoodsByPage
     * getScoreOrderReconciliationNotYet
     *
     * @param queryCriteria
     * @param loginSysUserj
     * @return
     */
    R<List<InvoiceApplyDetailDimCreditItemVo>> getScoreOrderReconciliationNotYetByPageQuery(AccountingOrderScoreCustomerNotYetDimCreditQueryCriteria queryCriteria, LoginSysUser loginSysUserj);

    /**
     * 重点关注 积分结算2.1 后封闭 按场景开放
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
//	List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYet(AccountingScoreCustomerNotYetDimCreditQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene1(
            AccountingOrderScoreCustomerNotYetDimCreditScene1QueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

    List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene2(
            AccountingOrderScoreCustomerNotYetDimCreditScene2QueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

    List<InvoiceApplyDetailDimCreditItemVo> getScoreOrderReconciliationNotYetScene3(
            AccountingOrderScoreCustomerNotYetDimCreditScene3QueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

    R<List<InvoiceApplyDetailDimCreditItemVo>> getScoreOrderReconciliationNotYetScene4(
            AccountingOrderScoreCustomerNotYetDimCreditScene4QueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

    String exportExcelScoreOrderReconciliationNotYet(
            AccountingOrderScoreCustomerNotYetDimCreditScene1QueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

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


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

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

    List<UnifiedOrderSupplierDimOrderNotCheckVo> getSupplierUnAccountingDimOrderList(Map<String, Object> params);

    /**
     * 已添加 数据脱敏逻辑 20211203
     *
     * @param criteria
     * @param loginSysUser
     * @return
     */
    String exportExcelAccountingSupplierNotYetDimGoods(AccountingSupplierNotYetDimGoodsQueryCriteria criteria, LoginSysUser loginSysUser);

    UnifiedOrderSupplierHeadSumVo getSupplierUnAccountingDimOrderHeadSum(Map<String, Object> params);

    List<UnifiedOrderSupplierNotCheckDetail2GoodsVo> getSupplierUnAccountingDetail2Goods(Map<String, Object> params);

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


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

    UnifiedOrderSupplierHeadSumVo getSupplierUnAccountingDimGoodsHeadSum(
            AccountingSupplierNotYetDimGoodsQueryCriteria criteria);

    List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo> getSupplierUnAccountingDimGoodsList(
            AccountingSupplierNotYetDimGoodsQueryCriteria criteria,
            LoginSysUser loginSysUser);

    /**
     * 已添加 数据脱敏逻辑 20211203
     *
     * @param criteria
     * @param loginSysUser
     * @return
     */
    R<List<UnifiedOrderJoinGoodsOfSupplierStatementOfAccountVo>> getSupplierUnAccountingDimGoodsListByPageQuery(
            AccountingSupplierNotYetDimGoodsQueryCriteria criteria,
            LoginSysUser loginSysUser);

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


    /****************************************** 微信端 start ******************************************/

    /**
     * 消费总额
     *
     * @param amountQuery
     * @return
     */
    BigDecimal getAmount(Map<String, Object> amountQuery);

    /**
     * 待付款总额
     *
     * @param unPayMap
     * @return
     */
    BigDecimal getPayAmount(Map<String, Object> unPayMap);

    /**
     * 企业订单
     *
     * @param params
     * @return
     */
    List<WxBillOrder> getVirtOrder(Map<String, Object> params);

    WxBillVirt getVirtBill(Long virtId, int syear);

    /****************************************** 微信端   end ******************************************/


}
