package cn.superdesk.uniorder.dubbo.provider.accounting.customer;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import cn.superdesk.uniorder.common.enums.accounting.AccountingOrderBackAccountStatusEnum;
import cn.superdesk.uniorder.common.enums.accounting.AccountingOrderInvoiceApplyStatusEnum;
import cn.superdesk.uniorder.common.enums.accounting.customer.AccountingOrderCustomerAccountingStatusEnum;
import cn.superdesk.uniorder.common.enums.common.CommonAccountingStateEnum;
import cn.superdesk.uniorder.common.enums.common.CommonSoftDeleteEnum;
import cn.superdesk.uniorder.common.numerical.AnStringUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.accounting.score.customer.AccountingScoreCustomer;
import cn.superdesk.uniorder.dao.entity.accounting.score.customer.AccountingScoreCustomerXCredit;
import cn.superdesk.uniorder.dao.entity.sys.notify.SysNotify;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerCreateParam;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerOpDetailQueryCriteria;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerQueryCriteria;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerDetailVo;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerHeadVo;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerListItemVo;
import cn.superdesk.uniorder.dto.vo.invoice.customer.InvoiceApplyDetailDimCreditItemVo;
import cn.superdesk.uniorder.dubbo.facade.accounting.customer.DubboAccountingScoreCustomerService;
import cn.superdesk.uniorder.dubbo.facade.sys.notify.DubboSysNotifyService;
import cn.superdesk.uniorder.service.accounting.score.customer.AccountingScoreCustomerExportExcelService;
import cn.superdesk.uniorder.service.accounting.score.customer.AccountingScoreCustomerService;
import cn.superdesk.uniorder.service.accounting.score.customer.AccountingScoreCustomerXCreditService;
import cn.superdesk.uniorder.service.order.base.ScoreOrderService;
import cn.superdesk.uniorder.service.invoice.common.InvoiceBankInfoService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;


/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 6/28/20 11:43 AM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/28/20 11:43 AM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Service(version = "1.0.0", retries = -1, timeout = 30000)
public class DubboAccountingScoreCustomerServiceImpl implements DubboAccountingScoreCustomerService {

    @Autowired
    private AccountingScoreCustomerService        accountingScoreCustomerService;
    @Autowired
    private AccountingScoreCustomerXCreditService accountingScoreCustomerXCreditService;

    @Autowired
    private InvoiceBankInfoService invoiceBankInfoService;

    @Autowired
    private ScoreOrderService scoreOrderService;

    /****************************************** export excel start ******************************************/
    @Autowired
    private AccountingScoreCustomerExportExcelService accountingScoreCustomerExportExcelService;

    /****************************************** 引用自身 Dubbo provider start ******************************************/
    @Reference(version = "1.0.0", timeout = 10000, retries = -1)
    private DubboSysNotifyService dubboSysNotifyService;


    /****************************************** 积分结算 对账单 start ******************************************/

    public List<Long> getAccountingXCreditIdsByAccountingOrderId(Long accountingOrderId) {

        Map<String, Object> setAccountingParams = new HashMap<>();

        return accountingScoreCustomerService.getAccountingXCreditIdsByQueryCriteria(
                AccountingOrderScoreCustomerOpDetailQueryCriteria.builder()
                        .accountingOrderId(accountingOrderId)
                        .build()
        );
    }

    /**
     * 积分结算 对账单 列表数据 带分页
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
    public R<List<AccountingOrderScoreCustomerListItemVo>> pageQueryAccountingOrderList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
        return accountingScoreCustomerService.pageQueryAccountingOrderList(queryCriteria, loginSysUser);
    }

    /**
     * 积分结算 对账单 列表数据
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
    public List<AccountingOrderScoreCustomerListItemVo> queryAccountingOrderList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
        return accountingScoreCustomerService.getAccountingOrderList(queryCriteria, loginSysUser);
    }

    public AccountingOrderScoreCustomerListItemVo getAccountingOrderListByAccountingOrderSn(String accountingOrderSn, LoginSysUser loginSysUser) {

        List<AccountingOrderScoreCustomerListItemVo> resultList = queryAccountingOrderList(
                AccountingOrderScoreCustomerQueryCriteria
                        .builder()
                        .accountingOrderSn(accountingOrderSn)
                        .build(),
                loginSysUser);

        if (CollUtil.isNotEmpty(resultList)) {
            return resultList.get(0);
        } else {
            return null;
        }

    }

    public String exportExcelAccountingOrderScoreCustomerList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser) {

////		 筛选条件
//		Map<String, Object> params = new HashMap<>();
//
//		if (StrUtil.isNotBlank(queryCriteria.getAccountingOrderIds())) {
//
//			Object[] accountingOrderIds = AnStringUtils.stringArrayConvertToLongList(queryCriteria.getAccountingOrderIds(), ",").toArray();
//
//			if (accountingOrderIds.length > 0) {
//				// 对账单 Ids
//				params.put("ids", accountingOrderIds);
//			} else {
//				return "导出任务已经接收,参数异常,未能执行";
//			}
//		} else {
//			queryCriteria.setAccountingOrderIds(null);
//			params = AnBeanUtils.beanToMap(queryCriteria);
//		}


        // 异步操作 包裹 mark by linjinyu at 20210223
        log.info("\n异步操作 包裹 外层 exportExcelAccountingOrderScoreCustomerList params: \n{}", JSONUtil.toJsonStr(queryCriteria));

//		Map<String, Object> finalParams = params;

        CompletableFuture<Void> voidCompletableFuture = CompletableFuture.runAsync(() -> {

            try {

                log.info("\n异步操作 包裹 内层 exportExcelAccountingOrderScoreCustomerList params: \n{}", JSONUtil.toJsonStr(queryCriteria));

                // 三步走 mark by linjinyu at 20210305
                // 1. 数据
                // 2. 生成excel
                // 3. 通知

                // 处理到这里 已经把 table list 的数据填充了
                List<AccountingOrderScoreCustomerListItemVo> resultList = queryAccountingOrderList(queryCriteria, loginSysUser);

                SysNotify sysNotify = accountingScoreCustomerExportExcelService.exportExcelAccountingOrderScoreCustomerList(resultList);

                // 通知
                dubboSysNotifyService.notifyExportExcelUnifiedCustomerInvoice2GoodsDetail(sysNotify, loginSysUser);

            } catch (Exception e2) {
                log.error("\n异步操作 包裹 内层 exportExcelAccountingOrderScoreCustomerList{} -> 执行 异常:{}", JSONUtil.toJsonStr(queryCriteria), e2);
            }
        });

        return "导出任务已经接收,正在处理中...";

    }

    /**
     * 积分结算 对账单 页头 结算单数: 399 订单数: 105770 结算金额: 11859292.39
     *
     * @param queryCriteria
     * @return
     */
    public AccountingOrderScoreCustomerHeadVo getAccountingOrderListHeadSum(AccountingOrderScoreCustomerQueryCriteria queryCriteria) {
        return accountingScoreCustomerService.getAccountingOrderListHeadSum(queryCriteria);
    }

    /**
     * 积分 创建 对账单(结算单) ---- 客户结算
     *
     * @param invoiceApplyDetailDimCreditItemVoList
     * @param scoreAccountingCustomerCreateParam
     * @param loginSysUser
     * @return
     * @throws Exception
     */
    @Override
    public AccountingScoreCustomer createScoreAccountingCustomer(
            List<InvoiceApplyDetailDimCreditItemVo> invoiceApplyDetailDimCreditItemVoList,
            AccountingOrderScoreCustomerCreateParam scoreAccountingCustomerCreateParam,
            LoginSysUser loginSysUser) throws Exception {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");


//		return scoreAccountingCustomerService.addObj();

        /****************************************** 0. 记录一个流水的第一个 start ******************************************/

        InvoiceApplyDetailDimCreditItemVo sample = invoiceApplyDetailDimCreditItemVoList.get(0);


        /****************************************** 1. 处理 ScoreAccountingCustomerXCredit start ******************************************/

        List<AccountingScoreCustomerXCredit> scoreAccountingCustomerXCreditList = new ArrayList<>();

        for (InvoiceApplyDetailDimCreditItemVo item : invoiceApplyDetailDimCreditItemVoList) {

            AccountingScoreCustomerXCredit x = new AccountingScoreCustomerXCredit();

            // add 20200716
            x.setUnifiedOrderId(item.getUnifiedOrderId());
            x.setUnifiedOrderGoodsId(item.getUnifiedOrderGoodsId());
            x.setUnifiedOrderCreditId(item.getUnifiedOrderCreditId());

            /**
             TODO 积分结算2.1 关系中添加 结算与不结算标识 mark by linjinyu at 20220217
             【后端部分处理-20220217-对映文档-2.积分结算-2.3未对账流水-已整理-20220217】https://www.tapd.cn/33003868/prong/stories/view/1133003868001003945
             目前在对账单中的流水就会标识为已对账,按新逻辑来说,就是微信支付的也会这样标记,然而这里是关系中的是否参考结算,关系表中添加标识是否参与结算,然而关系表中的老数据添加这个标识为结算,新做的对账单才会有可能包含这种存丰结算与不结算的标识
             **/

            if (ObjectUtil.isNotNull(item.getBatchs()) && item.getBatchs().equals("wechat")) {
                x.setAccountingState(CommonAccountingStateEnum.不对账.getKey());
            } else {
                x.setAccountingState(CommonAccountingStateEnum.已对账.getKey());
            }

            x.setCreateTime(DateUtil.date());
            x.setCreateUserId(loginSysUser.getSysUserId());
            x.setUpdateTime(DateUtil.date());
            x.setUpdateUserId(loginSysUser.getSysUserId());

            scoreAccountingCustomerXCreditList.add(x);
        }

        /****************************************** 2. 处理 ScoreAccountingCustomer 结算单主体 start ******************************************/

        AccountingScoreCustomer accountingScoreCustomer = new AccountingScoreCustomer();
        if (StringUtils.isNotBlank(scoreAccountingCustomerCreateParam.getJcAccountingOrderSn())) {
            accountingScoreCustomer.setAccountingOrderSn(scoreAccountingCustomerCreateParam.getJcAccountingOrderSn());
        } else {
            accountingScoreCustomer.setAccountingOrderSn("");
        }

        accountingScoreCustomer.setServiceNo(scoreAccountingCustomerCreateParam.getServiceNo());
        accountingScoreCustomer.setSourceFrom(scoreAccountingCustomerCreateParam.getSourceFrom());

        /****************************************** TODO 积分结算2.1 start ******************************************/

        accountingScoreCustomer.setCreditType(AnStringUtils.integerListConvertToString(scoreAccountingCustomerCreateParam.getCreditTypeList()));
        accountingScoreCustomer.setCreditName(AnStringUtils.stringListConvertToString(scoreAccountingCustomerCreateParam.getCreditNameList()));

        /****************************************** TODO 积分结算2.1   end ******************************************/


//		List<String> batchsTemp        = AnStringUtils.stringArrayConvertToStringList(scoreAccountingCustomerCreateParam.getBatchs(), ",");
//		List<String> batchsTempDisinct = batchsTemp.stream().distinct().collect(Collectors.toList());
//
//		log.info("标记\n{}\n{}", JSONUtil.toJsonStr(batchsTemp), JSONUtil.toJsonStr(batchsTempDisinct));
//		accountingScoreCustomer.setBatchs(AnStringUtils.stringListConvertToString(batchsTempDisinct));
//		accountingScoreCustomer.setBatchs(AnStringUtils.stringListConvertToString(batchsList));

        /****************************************** 统计 start ******************************************/

        accountingScoreCustomerService.statisticsScoreAccountingCustomerByCredit(accountingScoreCustomer, invoiceApplyDetailDimCreditItemVoList);


//		accountingScoreCustomer.setCreditTypeStruct(JSONUtil.toJsonStr(creditTypeItemVoList));
//		accountingScoreCustomer.setCreditType(AnStringUtils.integerListConvertToString(creditTypeKeyList));
//		accountingScoreCustomer.setCreditName(AnStringUtils.stringListConvertToString(creditNameValueList));

//		accountingScoreCustomer.setQuantityOrder(quantityOrder);
//		accountingScoreCustomer.setQuantityOrderGoods(quantityOrderGoods);
//		accountingScoreCustomer.setQuantityOrderCredit(quantityOrderCredit);

//		accountingScoreCustomer.setAccountingAmount(accountingAmount);
//		accountingScoreCustomer.setUnAccountingAmount(unAccountingAmount);
//		accountingScoreCustomer.setStatisticsTotalAmount(statisticsTotalAmount);

        /****************************************** 统计   end ******************************************/

        accountingScoreCustomer.setAccountingStatus(AccountingOrderCustomerAccountingStatusEnum.未确认.getKey());
        accountingScoreCustomer.setInvoiceStatus(AccountingOrderInvoiceApplyStatusEnum.未申请.getKey());

//		scoreAccountingCustomer.setInvoiceType();
//		scoreAccountingCustomer.setInvoiceCompanyName();
//		scoreAccountingCustomer.setInvoiceTaxpayersIDCode();

        accountingScoreCustomer.setEnterpriseId(sample.getPurchaseVirtId());

        accountingScoreCustomer.setPurchaseUserId(scoreAccountingCustomerCreateParam.getPurchaseUserId());
        accountingScoreCustomer.setPurchaseUserName(scoreAccountingCustomerCreateParam.getPurchaseUserName());
        accountingScoreCustomer.setPurchasePhone(scoreAccountingCustomerCreateParam.getPurchasePhone());
//		scoreAccountingCustomer.setPurchaseAddress();

        accountingScoreCustomer.setIsSendEmail(scoreAccountingCustomerCreateParam.getIsSendEmail());
//		scoreAccountingCustomer.setSendEmailTime();

        accountingScoreCustomer.setDateType(scoreAccountingCustomerCreateParam.getDateType());
        accountingScoreCustomer.setStartTime(sdf.parse(scoreAccountingCustomerCreateParam.getStartTime()));
        accountingScoreCustomer.setEndTime(sdf.parse(scoreAccountingCustomerCreateParam.getEndTime()));

        accountingScoreCustomer.setBackAccountStatus(AccountingOrderBackAccountStatusEnum.未回款.getKey());

        /****************************************** 收款方 start ******************************************/

        accountingScoreCustomer.setBankInfoId(scoreAccountingCustomerCreateParam.getBankInfoId());
        // 销售方抬头相关内容一旦对账单创建成功不受收款方修改影响;
//		【后端部分处理-20220222-对映文档-2.积分结算-2.3未对账流水-已整理-20220222】https://www.tapd.cn/33003868/prong/stories/view/1133003868001003945
        accountingScoreCustomer.setInvoiceBankInfoSnapshot(JSONUtil.toJsonStr(invoiceBankInfoService.getInvoiceBankInfoByIdOrNullByDefault(scoreAccountingCustomerCreateParam.getBankInfoId())));

        /****************************************** 收款方   end ******************************************/

        accountingScoreCustomer.setCreateUserId(loginSysUser.getSysUserId());
        accountingScoreCustomer.setCreateTime(DateUtil.date());

        accountingScoreCustomer.setUpdateUserId(loginSysUser.getSysUserId());
        accountingScoreCustomer.setUpdateTime(DateUtil.date());

        accountingScoreCustomer.setPayType(0);
        accountingScoreCustomer.setPayStatus(0);
//		scoreAccountingCustomer.setWxQrcodeImgUrl();

        accountingScoreCustomer.setDeleted(CommonSoftDeleteEnum.正常.getKey());
        /**
         * 20220516 订单来源处理
         */
        if (StringUtils.isNotBlank(scoreAccountingCustomerCreateParam.getSourceFrom())) {
            accountingScoreCustomer.setSourceFrom(scoreAccountingCustomerCreateParam.getSourceFrom());
        }

        return accountingScoreCustomerService.createScoreAccountingCustomer(accountingScoreCustomer, scoreAccountingCustomerXCreditList);

    }

    /****************************************** 积分结算 对账单   end ******************************************/


    /****************************************** 积分结算 对账单 详情 start ******************************************/

    /**
     * 用于
     * 1. 对账单-查看详情
     * 2. 对账单-查看详情-导出报表
     * 3. 对账单-查看详情-发送邮件 附件
     *
     * @param queryCriteria
     * @param loginSysUser
     * @return
     */
    @Override
    public AccountingOrderScoreCustomerDetailVo commonStatementOfAccountDetailDimCredit(AccountingOrderScoreCustomerOpDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser) {

        return accountingScoreCustomerService.commonStatementOfAccountDetailDimCredit(queryCriteria, loginSysUser);

    }

    private static Map<Integer, Function<AccountingOrderScoreCustomerDetailVo, SysNotify>> modeOfExportExcelAccountingOrderScoreCustomerDetailDimCredit = new HashMap<>();

    @Override
    public String exportExcelAccountingOrderScoreCustomerDetailDimCredit(AccountingOrderScoreCustomerOpDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser) {

        log.info("\n异步操作 包裹 外层 exportExcelAccountingOrderScoreCustomerDetailDimCredit params: \n{}", JSONUtil.toJsonStr(queryCriteria));

        CompletableFuture.runAsync(() -> {

            try {

                // 三步走 mark by linjinyu at 20210305
                // 1. 数据
                // 2. 生成excel
                // 3. 通知

//                积分结算 > 对账单 > 详情 > op导出账单
//                http://192.168.6.225:8089/web/accounting/score/customer/statement/exportExcelDetail
//                {"accountingOrderId":"1539","creditAccountingState":1}
//                积分结算 > 对账单 > 详情 > op导出账单（含微信支付）
//                http://192.168.6.225:8089/web/accounting/score/customer/statement/exportExcelDetail
//                {"accountingOrderId":"1539","creditAccountingState":0}

//                【后端部分完成-20220316-对映文档-2. 积分结算-2.4 对账单-拆分-2.4.1-2.4.7-部分整理-20220316】
//                https://www.tapd.cn/33003868/prong/stories/view/1133003868001003946

                // 初始化
                // 侨城汇
                // |---- 1. 希望包含微信支付, 传入0-全部; 积分结算 > 对账单 > 详情 > op导出账单（含微信支付）
                // |---- 2. 希望只有对账部分, 传入1-已对账; 积分结算 > 对账单 > 详情 > op导出账单
                modeOfExportExcelAccountingOrderScoreCustomerDetailDimCredit.put(0, (exportData) -> accountingScoreCustomerExportExcelService.exportExcelAccountingOrderScoreCustomerDetailDimCreditWithWechat(exportData));
                modeOfExportExcelAccountingOrderScoreCustomerDetailDimCredit.put(1, (exportData) -> accountingScoreCustomerExportExcelService.exportExcelAccountingOrderScoreCustomerDetailDimCredit(exportData));

                AccountingOrderScoreCustomerDetailVo exportData = commonStatementOfAccountDetailDimCredit(queryCriteria, loginSysUser);

//                SysNotify sysNotify = accountingScoreCustomerExportExcelService.exportExcelAccountingOrderScoreCustomerDetailDimCredit(exportData);
                SysNotify sysNotify = modeOfExportExcelAccountingOrderScoreCustomerDetailDimCredit.get(queryCriteria.getCreditAccountingState()).apply(exportData);

                // 通知
                dubboSysNotifyService.notifyExportExcelAccountingSupplierNotYetDimGoods(sysNotify, loginSysUser);

            } catch (Exception e2) {
                log.error("\n异步操作 包裹 内层 exportExcelAccountingOrderScoreCustomerDetailDimCredit {} -> 执行 异常:{}", JSONUtil.toJsonStr(queryCriteria), e2);
            }
        });

        return "导出任务已经接收,正在处理中...";

    }
    /****************************************** 积分结算 对账单 详情   end ******************************************/


    /****************************************** 积分结算 对账单 操作 start ******************************************/

    /**
     * 重新对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    public int opCancelAccounting(Long accountingOrderId, LoginSysUser loginSysUser) {

        return accountingScoreCustomerService.opCancelAccounting(accountingOrderId, AccountingOrderCustomerAccountingStatusEnum.已取消.getKey(), loginSysUser);

    }

    /**
     * 拒绝对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    public int opRefuseAccounting(Long accountingOrderId, LoginSysUser loginSysUser) {

        return accountingScoreCustomerService.opCancelAccounting(accountingOrderId, AccountingOrderCustomerAccountingStatusEnum.已拒绝.getKey(), loginSysUser);

    }

    /**
     * 确认对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    public int opConfirmAccounting(Long accountingOrderId, LoginSysUser loginSysUser) {

        int                     ret                     = 0;
        AccountingScoreCustomer accountingScoreCustomer = new AccountingScoreCustomer();

        accountingScoreCustomer.setId(accountingOrderId);

        accountingScoreCustomer.setAccountingStatus(AccountingOrderCustomerAccountingStatusEnum.已确认.getKey());

        accountingScoreCustomer.setUpdateTime(DateUtil.date());
        accountingScoreCustomer.setUpdateUserId(loginSysUser.getSysUserId());

        accountingScoreCustomerService.updateByPrimaryKeySelective(accountingScoreCustomer);

        return 1;
//        ret =
//
//        return ret;

    }

    public int opDeleteAccounting(Long accountingOrderId, LoginSysUser loginSysUser) {

        return accountingScoreCustomerService.opDeleteAccounting(accountingOrderId, loginSysUser);

    }

    /****************************************** 积分结算 对账单 操作   end ******************************************/


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

    @Override
    public int opUpdateByPrimaryKeySelective(AccountingScoreCustomer scoreAccountingCustomer, LoginSysUser loginSysUser) {

        return accountingScoreCustomerService.opUpdateByPrimaryKeySelective(scoreAccountingCustomer, loginSysUser);
    }

    @Override
    public int opUpdateFieldRemark(AccountingScoreCustomer statementOfAccount4Update, LoginSysUser loginSysUser) {

//		statementOfAccount4Update.setUpdateUserId(loginSysUser.getSysUserId());
//		statementOfAccount4Update.setUpdateTime(DateUtil.date());

        return accountingScoreCustomerService.opUpdateByPrimaryKeySelective(statementOfAccount4Update, loginSysUser);

    }

    @Override
    public AccountingScoreCustomer findById(Long id) {
        return accountingScoreCustomerService.findById(id);
    }

    @Override
    public AccountingScoreCustomer findByAccountingOrderSn(String accountingOrderSn) {
        return accountingScoreCustomerService.findByAccountingOrderSn(accountingOrderSn);
    }

    @Override
    public List<AccountingScoreCustomer> findByIds(List<Long> accountingOrderIds) {
        return accountingScoreCustomerService.findByIds(accountingOrderIds);
    }

    @Override
    public void addObj(AccountingScoreCustomer scoreAccountingCustomer) {
        accountingScoreCustomerService.insertSelective(scoreAccountingCustomer);
    }

    @Override
    public List<AccountingScoreCustomer> findAll(Map<String, Object> queryMap) {
        return null;
    }
}
