/*
 * Author: wangjian
 * 生成ServiceImpl
 */
package com.tofly.watermeter.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tofly.common.core.util.StringUtil;
import com.tofly.common.oauth.exception.ToflyDeniedException;
import com.tofly.watermeter.custom.entity.file.FileInfo;
import com.tofly.watermeter.custom.entity.meterRead.AppRead;
import com.tofly.watermeter.custom.entity.meterRead.readstatic.AuditMap;
import com.tofly.watermeter.entity.Qfcbqfmx;
import com.tofly.watermeter.entity.Readmeterhis;
import com.tofly.watermeter.mapper.QfcbqfmxMapper;
import com.tofly.watermeter.service.QfcbqfmxService;
import org.springframework.stereotype.Service;

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

/**
 * 抄表业务抄表欠费明细表
 *
 * @author wangjieliu
 * @date Wed Apr 14 00:00:00 CST 2021
 */
@Service("qfcbqfmxService")
public class QfcbqfmxServiceImpl extends ServiceImpl<QfcbqfmxMapper, Qfcbqfmx> implements QfcbqfmxService {

//    @Override
//    public List<Map> getReadAppPlan(Page page, ReadSearch search) {
//        return baseMapper.getReadAppPlan(page,search);
//    }


    /**
     * 抄表数据
     *
     * @return
     */
    @Override
    public IPage<AppRead> getListByYhbh(Page page, Integer day, String month, String isGeneral, Long cbry, Long planId,String type,String zone) {
        return baseMapper.getListByYhbh(page, day, month, isGeneral, cbry, planId,type,zone);
    }

    /**
     * 查询客户基本信息
     *
     * @param byKhjbxxList 用户
     * @return
     */
    @Override
    public List<AppRead> getKhjbxx(List<Readmeterhis> byKhjbxxList, String month, String isGeneral) {
        return baseMapper.getKhjbxx(byKhjbxxList, month, isGeneral);
    }

    @Override
    public boolean updateCb(List<Qfcbqfmx> collect) {
        return baseMapper.updateCb(collect);
    }

    @Override
    public IPage<AuditMap> getAuditCbData(Page page, String startTime, String cbpq, String cbb,
                                          String cbry, String isDis, String isGeneral) {
        return baseMapper.getAuditCbData(page, startTime, cbpq, cbb, cbry, isDis, isGeneral);
    }

    @Override
    public IPage<AuditMap> getOfflineInfo(Page page, String cwyf, List<String> cbpq, List<String> cbb,
                                          List<String> cbry, String isDis, String isGeneral, String state,
                                          String isEstimate, String issyn, List<String> cbfsList,
                                          String inputContent , String isUpdate) {
        return baseMapper.getOfflineInfo(page, cwyf, cbpq, cbb, cbry, isDis, isGeneral, state,
                isEstimate, issyn, cbfsList,inputContent , isUpdate);
    }

    @Override
    public List<AuditMap> getOfflineInfoList(String cwyf, List<String> qybmList, List<String> qydbmList, List<String> cbryList,
                                             String isDis, String isGeneral, String state, String isEstimate, String issyn,
                                             List<String> cbfsList, String inputContent , String isUpdate) {
        return baseMapper.getOfflineInfoList(cwyf, qybmList, qydbmList, cbryList, isDis, isGeneral, state, isEstimate, issyn, cbfsList, inputContent , isUpdate);
    }

    /**
     * 这个与上面的是一模一样的，只不过前端有多处调用这里，其中有个页面传的是抄表人员名称，一个传的是抄表人员ID；现在前端不好更改了，后端就多加一个配合对接
     *
     * @param cwyf
     * @param qybmList
     * @param qydbmList
     * @param cbryList
     * @param isDis
     * @param isGeneral
     * @param state
     * @param isEstimate
     * @param issyn
     * @return
     */
    @Override
    public List<AuditMap> getOfflineInfoList2(String cwyf, List<String> qybmList, List<String> qydbmList, List<String> cbryList,
                                              String isDis, String isGeneral, String state, String isEstimate, String issyn, List<String> cbfsList) {
        return baseMapper.getOfflineInfoList2(cwyf, qybmList, qydbmList, cbryList, isDis, isGeneral, state, isEstimate, issyn, cbfsList);
    }

    /**
     * 这个与上面的是一模一样的，只不过前端有多处调用这里，其中有个页面传的是抄表人员名称，一个传的是抄表人员ID；现在前端不好更改了，后端就多加一个配合对接
     *
     * @param cwyf
     * @param qybmList
     * @param qydbmList
     * @param cbryList
     * @param isDis
     * @param isGeneral
     * @param state
     * @param isEstimate
     * @param issyn
     * @return
     */
    @Override
    public IPage<AuditMap> getOfflineInfo2(Page page, String cwyf, List<String> qybmList, List<String> qydbmList, List<String> cbryList,
                                           String isDis, String isGeneral, String state, String isEstimate, String issyn, List<String> cbfsList) {
        return baseMapper.getOfflineInfo2(page, cwyf, qybmList, qydbmList, cbryList, isDis, isGeneral, state, isEstimate, issyn, cbfsList);
    }

    @Override
    public IPage<AuditMap> cardUpdateTwo(Page page, String cwyf, List<String> qybmList, List<String> qydbmList, List<String> cbryList,
                                         String isGeneral, String state, String inputContent, String isUpdate) {
        return baseMapper.cardUpdateTwo(page, cwyf, qybmList, qydbmList, cbryList, isGeneral, state, inputContent, isUpdate);
    }

    @Override
    public AppRead queryOfflineByYhbh(String cbrq, String yhbh) {
        return baseMapper.queryOfflineByYhbh(cbrq,yhbh);
    }

    @Override
    public AppRead getOfflineByYhbh(String yearMonth, String yhbh, String isGeneral, Long cbryId, String soleSign) {
        if (StringUtil.isEmpty(soleSign)) {
            throw new ToflyDeniedException("请传递抄表唯一标识");
        }
        AppRead appReads = baseMapper.getOfflineByYhbh(yearMonth, yhbh, isGeneral, cbryId, soleSign);
        return appReads;
    }


    @Override
    public boolean updateReadPlan(String cwRq, List<String> yhbhList) {
        return baseMapper.updateReadPlan(cwRq, yhbhList);
    }

    @Override
    public List<Map> staPlanByCbb(List<String> cbbList, String cwRq) {
        return baseMapper.staPlanByCbb(cbbList, cwRq);
    }

    @Override
    public int insertOrUpdate(List<Qfcbqfmx> qfcbqfmxes) {
        return baseMapper.insertOrUpdate(qfcbqfmxes);
    }

    @Override
    public List<FileInfo> getFileByIds(String fileid) {
        return baseMapper.getFileByIds(fileid);
    }


}
