package com.jkcredit.invoice.service.lowerService.impl;

import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleRegisterRequest;
import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleRegisterResponse;
import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.*;
import com.jkcredit.invoice.common.CommonConstants;
import com.jkcredit.invoice.mapper.Binvoce.BillInvoiceMapper;
import com.jkcredit.invoice.mapper.calculateInfor.NoCarCalculateInforMapper;
import com.jkcredit.invoice.mapper.customer.CustomerCarRecMapper;
import com.jkcredit.invoice.mapper.customer.CustomerMapper;
import com.jkcredit.invoice.mapper.customer.CustomerRecMapper;
import com.jkcredit.invoice.mapper.waybill.NoCarWaybillMapper;
import com.jkcredit.invoice.model.entity.Calculate.NoCarCalculateInfor;
import com.jkcredit.invoice.model.entity.customer.Customer;
import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
import com.jkcredit.invoice.service.lowerService.NoCarService;
import com.jkcredit.invoice.service.lowerService.vo.HCInvoiceQueryVo;
import com.jkcredit.invoice.service.lowerService.vo.MonthAccountQueryVo;
import com.jkcredit.invoice.service.upService.NoCarInterface;
import com.jkcredit.invoice.util.DateUtil;
import com.jkcredit.invoice.util.RespR;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import java.util.Date;
import java.util.List;

@Repository("noCarService")
public class NoCarServiceImpl implements NoCarService{
    @Autowired
    NoCarInterface noCarInterface;

    @Autowired
    NoCarWaybillMapper noCarWaybillMapper;

    @Autowired
    CustomerCarRecMapper customerCarRecMapper;

    @Autowired
    CustomerMapper customerMapper;

    @Autowired
    CustomerRecMapper customerRecMapper;

    @Autowired
    BillInvoiceMapper billInvoiceMapper;

    @Autowired
    NoCarCalculateInforMapper calculateInforMapper;



    @Override
    public RespR customerCarRec(List<CustomerCarRec> customerCarRecs) {
        if(customerCarRecs== null || customerCarRecs.size()<=0){
            return new RespR(false,"无备案车辆");
        }
        StringBuffer res = new StringBuffer();
        CustomerCarRec customerCarRec2 = customerCarRecs.get(0);
        Customer customer = customerMapper.selectByCustomerName(customerCarRec2.getCustomerName());
        if(customer == null || customer.getAccstatus()!=0){
            res.append("#客户："+customerCarRec2.getCustomerName()+"不存在或状态异常");
            return new RespR(false,res.toString());
        }
        CustomerRec customerRecP = new CustomerRec();
        customerRecP.setCustomerName(customerCarRec2.getCustomerName());
        customerRecP.setCompanyName(customerCarRec2.getCompanyName());
        CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecP);
        if(customerRec == null){
            res.append("#客户："+customerCarRec2.getCustomerName()+"企业:"+customerCarRec2.getCompanyName()+"备案信息不存在");
            return new RespR(false,res.toString());
        }
        return customerCarRecForNoCar(customerCarRecs,res,customerRec);
    }
    public  RespR customerCarRecForNoCar(List<CustomerCarRec> customerCarRecs, StringBuffer res, CustomerRec customerRec) {
        try {

            for (CustomerCarRec customerCarRec : customerCarRecs) {
                if(!customerRec.getBussinessType().equals(customerCarRec.getBusinessType())){
                    res.append("#客户："+customerCarRec.getCustomerName()+"企业:"+customerCarRec.getCompanyName()+"车辆:"+customerCarRec.getCarNum()+"业务类型错误");
                    continue;
                }
                //如果业务类型是无车
                VehicleRegisterRequest vehicleRegisterRequest = new VehicleRegisterRequest();
                vehicleRegisterRequest.setCompanyName(customerCarRec.getCompanyName());
                vehicleRegisterRequest.setCompanyNum(customerRec.getCompanyNum());
                vehicleRegisterRequest.setPlateColor(Integer.parseInt(customerCarRec.getCarColor()));
                vehicleRegisterRequest.setPlateNum(customerCarRec.getCarNum());
                RespR<VehicleRegisterResponse> respR = noCarInterface.vehicleRegister(vehicleRegisterRequest);
                if (respR.getCode() == 1) {
                    res.append("#客户：" + customerCarRec.getCustomerName() + "企业:" + customerCarRec.getCompanyName() + "车辆:" + customerCarRec.getCarNum() + "注册失败，原因：" + respR.getMsg());
                    customerCarRec.setRecStatus(CommonConstants.REC_STATUS_FAIL);
                    customerCarRec.setFailReason(respR.getMsg());
                    customerCarRec.setFailTime(DateUtil.getCurrentDateStr());
                } else {
                    customerCarRec.setRecStatus(CommonConstants.REC_STATUS_SUC);
                    customerCarRec.setSuccTime(DateUtil.getCurrentDateStr());
                }
                //根据车牌号查询是新增还是更新
                updateCustomerCarRec(customerCarRec);

            }
            if(StringUtils.isEmpty(res.toString())){
                return new RespR("成功");
            }else {
                return new RespR(false,res.toString());
            }

        }catch (Exception e){
            e.printStackTrace();
            return new RespR(false,e.getMessage());
        }

    }

    @Override
    public RespR customerCarRecQueryUpper(CustomerCarRec customerCarRec) {
        return null;
    }

    public void updateCustomerCarRec(CustomerCarRec customerCarRec){
        //根据车牌号查询是新增还是更新
        CustomerCarRec customerCarRec1 = customerCarRecMapper.selectByCarNum(customerCarRec.getCarNum());
        if (customerCarRec1 == null) {
            customerCarRecMapper.insert(customerCarRec);
        } else {
            customerCarRecMapper.updateByPrimaryKey(customerCarRec);
        }
    }


    @Override
    public RespR customerCarRecQuery(CustomerCarRec customerCarRec) {

        return new RespR(customerCarRecMapper.selectByCustName(customerCarRec.getCustomerName()));
    }

    @Override
    public RespR noCarWaybillStart(NoCarWayBill noCarWayBill) {
        //如果运单时间和当前时间差了三天，直接返回
        if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),new Date())<-72){
            return new RespR(false,"已经超过72小时，请20天后上传历史运单");
        }
        RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
        if(respR.getCode() == 1){
            return  respR;
        }
        WaybillStartRequest waybillStartRequest = buildWaybillStartRequest(noCarWayBill);
        RespR<WaybillStartResponse> responseRespR = noCarInterface.waybillStart(waybillStartRequest);
        if(responseRespR.getCode() == 1){
            return new RespR(false,responseRespR.getMsg());
        }else{
            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
            noCarWayBill.setHisFlag(0);
            noCarWayBill.setBillwayStatus(1);
            noCarWaybillMapper.insert(noCarWayBill);
        }
        return new RespR("成功");
    }

    /**
     * 组装指令报文
     */
    public WaybillStartRequest buildWaybillStartRequest(NoCarWayBill noCarWayBill){
        WaybillStartRequest waybillStartRequest = new WaybillStartRequest();
        waybillStartRequest.setCompanyNum(noCarWayBill.getCompanyNum());
        waybillStartRequest.setNum(noCarWayBill.getBillNum());
        waybillStartRequest.setPlateNum(noCarWayBill.getPlateNum());
        waybillStartRequest.setPlateColor(Integer.parseInt(noCarWayBill.getPlateColor()));
        waybillStartRequest.setStartTime(DateUtil.dateFormate(noCarWayBill.getStartTime()));
        waybillStartRequest.setSourceAddr(noCarWayBill.getSourceAddr());
        waybillStartRequest.setDestAddr(noCarWayBill.getDestAddr());
        waybillStartRequest.setPredictEndTime(DateUtil.dateFormate(noCarWayBill.getPredictEndTime()));
        waybillStartRequest.setFee(noCarWayBill.getFee());
        waybillStartRequest.setTitleType(noCarWayBill.getTitleType());
        waybillStartRequest.setTaxplayerCode(noCarWayBill.getTaxplayerCode());
        waybillStartRequest.setName(noCarWayBill.getCompanyName());
        waybillStartRequest.setAddress(noCarWayBill.getCompanyAdress());
        waybillStartRequest.setTel(noCarWayBill.getCompanyTel());
        waybillStartRequest.setBank(noCarWayBill.getCompanyBank());
        waybillStartRequest.setBankAccount(noCarWayBill.getCompanyBankAcc());
        waybillStartRequest.setCompanyName(noCarWayBill.getCompanyName());
        return waybillStartRequest;
    }
    public RespR checkCarWayBillAndSetInfo(NoCarWayBill noCarWayBill){
        Customer customer = customerMapper.selectByCustomerName(noCarWayBill.getCustomerName());
        if(customer==null || customer.getAccstatus() ==1){
            return new RespR(false,"客户不存在或者已经停用");
        }
        CustomerRec customerRecParm = new CustomerRec();
        customerRecParm.setCompanyName(noCarWayBill.getCompanyName());
        customerRecParm.setCustomerName(noCarWayBill.getCustomerName());
        CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecParm);
        if(customerRec == null || customerRec.getRecStatus()!=1){
            return new RespR(false,"客户未备案或备案失败");
        }
        CustomerCarRec customerCarRec = customerCarRecMapper.selectByCarNum(noCarWayBill.getPlateNum());
        if(customerCarRec == null || customerCarRec.getRecStatus() !=1 ){
            return new RespR(false,"未正常备案的车辆");
        }
        noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
        noCarWayBill.setCompanyAdress(customerRec.getCompanyAdress());
        noCarWayBill.setCompanyTel(customerRec.getCompanyPhone());
        noCarWayBill.setCompanyBank(customerRec.getCompanyOpenbank());
        noCarWayBill.setCompanyBankAcc(customerRec.getCompanyOpenbankAcc());
        return new RespR();
    }
    @Override
    public RespR noCarWaybillEnd(NoCarWayBill noCarWayBill) {
        //查询运单号为开始指令
        NoCarWayBill noCarWayBill1 = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
        noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
        noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
        if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96){
            noCarWayBill.setBillwayStatus(4);
            return new RespR(false,"运单已经超时，请拆分");
        }
        if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill.getHisFlag() ==1 ){
            return new RespR(false,"当前运单状态无法结束");
        }
        WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
        waybillEndRequest.setCompanyNum(noCarWayBill1.getCompanyNum());
        waybillEndRequest.setNum(noCarWayBill1.getBillNum());
        waybillEndRequest.setRealDestAddr(noCarWayBill1.getDestAddr());
        waybillEndRequest.setEndTime(DateUtil.dateFormate(noCarWayBill1.getPredictEndTime()));
        RespR<WaybillEndResponse> waybillEndResponseRespR = noCarInterface.waybillEnd(waybillEndRequest);
        if(waybillEndResponseRespR.getCode() == 1){
            return new RespR(false,waybillEndResponseRespR.getMsg());
        }else if("4".equals(waybillEndResponseRespR.getData().getInfo())){
            noCarWayBill.setBillwayStatus(2);
            return new RespR(false,"运单已经超时，请拆分");
        }
        noCarWayBill1.setInterfaceEndTime(DateUtil.getCurrentDateStr());
        noCarWayBill1.setBillwayStatus(0);
        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
        noCarWaybillMapper.updateByBillNum(noCarWayBill1);
        return new RespR();
    }

    @Override
    public RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill) {
        if(DateUtil.getDistanceDays(noCarWayBill.getStartTime(),new Date())>-20){
            return new RespR(false,"必须是二十天前的运单");
        }
        RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
        if(respR.getCode() == 1){
            return  respR;
        }
        WaybillHistoryStartRequest waybillHistoryStartRequest = BuildNoCarHisWaybill(noCarWayBill);
        RespR<WaybillHistoryStartResponse> responseRespR = noCarInterface.waybillHistoryStart(waybillHistoryStartRequest);

        if(responseRespR.getCode() == 1){
            return new RespR(false,responseRespR.getMsg());
        }else{
            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
            noCarWayBill.setHisFlag(1);
            noCarWayBill.setBillwayStatus(1);
            noCarWaybillMapper.insert(noCarWayBill);
        }
        return null;
    }

    public WaybillHistoryStartRequest BuildNoCarHisWaybill(NoCarWayBill noCarWayBill){
        WaybillHistoryStartRequest waybillStartRequest = new WaybillHistoryStartRequest();
        waybillStartRequest.setCompanyNum(noCarWayBill.getCompanyNum());
        waybillStartRequest.setNum(noCarWayBill.getBillNum());
        waybillStartRequest.setPlateNum(noCarWayBill.getPlateNum());
        waybillStartRequest.setPlateColor(Integer.parseInt(noCarWayBill.getPlateColor()));
        waybillStartRequest.setStartTime(DateUtil.tTimeToDate(noCarWayBill.getStartTime()));
        waybillStartRequest.setSourceAddr(noCarWayBill.getSourceAddr());
        waybillStartRequest.setPredictEndTime(noCarWayBill.getPredictEndTime());
        waybillStartRequest.setFee(noCarWayBill.getFee());
        waybillStartRequest.setTitleType(noCarWayBill.getTitleType());
        waybillStartRequest.setTaxplayerCode(noCarWayBill.getTaxplayerCode());
        waybillStartRequest.setName(noCarWayBill.getCompanyName());
        waybillStartRequest.setAddress(noCarWayBill.getCompanyAdress());
        waybillStartRequest.setTel(noCarWayBill.getCompanyTel());
        waybillStartRequest.setBank(noCarWayBill.getCompanyBank());
        waybillStartRequest.setBankAccount(noCarWayBill.getCompanyBankAcc());
        return waybillStartRequest;
    }
    @Override
    public RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill) {
        //查询运单号为开始指令
        NoCarWayBill noCarWayBill1 = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
        noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
        noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
        if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96){
            noCarWayBill.setBillwayStatus(4);
            return new RespR(false,"运单已经超时，请拆分");
        }
        if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=-1 || noCarWayBill.getHisFlag() ==0 ){
            return new RespR(false,"当前运单状态无法结束");
        }
        WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
        waybillEndRequest.setCompanyNum(noCarWayBill1.getCompanyNum());
        waybillEndRequest.setNum(noCarWayBill1.getBillNum());
        waybillEndRequest.setRealDestAddr(noCarWayBill1.getDestAddr());
        waybillEndRequest.setEndTime(noCarWayBill1.getPredictEndTime());
        RespR<WaybillEndResponse> waybillEndResponseRespR = noCarInterface.waybillEnd(waybillEndRequest);
        if(waybillEndResponseRespR.getCode() == 1){
            return new RespR(false,waybillEndResponseRespR.getMsg());
        }else if("4".equals(waybillEndResponseRespR.getData().getInfo())){
            noCarWayBill.setBillwayStatus(4);
            return new RespR(false,"运单已经超时，请拆分");
        }
        noCarWayBill1.setInterfaceEndTime(DateUtil.getCurrentDateStr());
        noCarWayBill1.setBillwayStatus(2);
        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
        noCarWaybillMapper.updateByBillNum(noCarWayBill1);
        return new RespR();
    }

    @Override
    @Transactional
    public RespR getInvoiceByWayBillNumReal(NoCarWayBill noCarWayBill, boolean isCurr) {
        NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
        RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
        if(respR.getCode() == 1){
            return  respR;
        }
        int status = noCarWayBillDb.getBillwayStatus();
        if(status == 1 || status == 4){
            return new RespR(false,"运单状态无法开票");
        }
        if(!isCurr){
            //查询本地数据库 如果有发票直接返回
           List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
           if(billInvoices!=null && billInvoices.size()>0){
               return new RespR(billInvoices);
           }
        }
        if(noCarWayBillDb.getBillwayStatus() == 3){
            //直接返回发票信息
            List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
            return new RespR(billInvoices);
        }
        //进行取票操作
        WaybillNumFindInvoiceRequest waybillNumFindInvoiceRequest = new WaybillNumFindInvoiceRequest();
        waybillNumFindInvoiceRequest.setCompanyNum(noCarWayBillDb.getCompanyNum());
        waybillNumFindInvoiceRequest.setWaybillNum(noCarWayBillDb.getBillNum());
        RespR<WaybillNumFindInvoiceResponse> responseRespR = noCarInterface.waybillNumFindInvoice(waybillNumFindInvoiceRequest);
        if(responseRespR.getCode() == 1){
            return new RespR(false,responseRespR.getMsg());
        }else{
            int tempStatus = responseRespR.getData().getWaybillStatus().intValue();
            //更改票状态
            noCarWayBillDb.setBillwayStatus(tempStatus);
            noCarWayBillDb.setUpdateTime(DateUtil.getCurrentDateStr());
            noCarWaybillMapper.updateByBillNum(noCarWayBillDb);
            if(tempStatus == 2 || tempStatus==3){
                List<BillInvoice> billInvoices = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
                if(billInvoices!=null && billInvoices.size()>0){
                    return new RespR(billInvoices);
                }
                //发票入库
                List<InvoiceProcessingListModel> invoiceProcessingListModels = responseRespR.getData().getResult();
                invoiceProcessingListModels.stream().forEach(invoiceProcessingListModel -> {
                    BillInvoice billInvoice = buildFromInvoiceProcessingListModel(invoiceProcessingListModel);
                    billInvoice.setCompanyName(noCarWayBillDb.getCompanyName());
                    billInvoice.setCompanyNum(noCarWayBillDb.getCompanyNum());
                    billInvoice.setCustomerName(noCarWayBillDb.getCustomerName());
                    billInvoiceMapper.insert(billInvoice);
                    //扣费明细入账
                    NoCarCalculateInfor calculateInfor = new NoCarCalculateInfor();
                    calculateInfor.setCalculateTime(DateUtil.getCurrentDateStr());
                    calculateInfor.setCompanyNum(noCarWayBillDb.getCompanyNum());
                    calculateInfor.setCtype(1);
                    calculateInfor.setCustomId(noCarWayBill.getCustomerName());
                    calculateInfor.setBuyerName(invoiceProcessingListModel.getBuyerName());
                    calculateInfor.setBuyerTaxpayerCode(invoiceProcessingListModel.getBuyerTaxpayerCode());
                    calculateInfor.setInvoiceMakeTime(invoiceProcessingListModel.getInvoiceMakeTime());
                    /**
                     * 这个设置为动态的 TODO
                     */
                    calculateInfor.setFee(1500L);
                    calculateInfor.setTradeId(billInvoice.getTransactionId());
                    //先查询数据库中有没有这个交易id
                    if(calculateInforMapper.selectByTradeId(billInvoice.getTransactionId())==null){
                        //todo 扣除客户费用
                        calculateInforMapper.insert(calculateInfor);
                    }

                });
                List<BillInvoice> billInvoices1 = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
                if(billInvoices1!=null && billInvoices1.size()>0){
                    return new RespR(billInvoices1);
                }
            }

        }
        //查询
        return new RespR(false,"未获取到发票,请联系管理员");
    }
    public BillInvoice buildFromInvoiceProcessingListModel(InvoiceProcessingListModel invoiceProcessingListModel){
        BillInvoice billInvoice = new BillInvoice();
        BeanUtils.copyProperties(invoiceProcessingListModel,billInvoice);
        //设置时间
        billInvoice.setExTime(DateUtil.tTimeToDate(billInvoice.getExTime()));
        billInvoice.setInvoiceMakeTime(DateUtil.tTimeToDate(billInvoice.getInvoiceMakeTime()));
        billInvoice.setWaybillEndTime(DateUtil.tTimeToDate(billInvoice.getWaybillEndTime()));
        billInvoice.setTradeMatchTime(DateUtil.getCurrentDateStr());
        billInvoice.setWaybillStartTime(DateUtil.tTimeToDate(billInvoice.getWaybillStartTime()));
        return billInvoice;
    }

    @Override
    public RespR hCInvoiceQuery(HCInvoiceQueryVo hcInvoiceQueryVo) {
        WaybillInvoiceRedQueryRequest redQueryRequest = new WaybillInvoiceRedQueryRequest();
        redQueryRequest.setCompanyNum(hcInvoiceQueryVo.getCompanyNum());
        redQueryRequest.setMonth(hcInvoiceQueryVo.getMonth());
        RespR<WaybillInvoiceRedQueryResponse> respR = noCarInterface.waybillInvoiceRedQuery(redQueryRequest);
        if(respR.getCode() == 1){
            return new RespR(false,respR.getMsg());
        }
        return new RespR(respR.getData().getResult());
    }

    @Override
    public RespR monthAccQuery(MonthAccountQueryVo monthAccountQueryVo) {
        Customer customer = customerMapper.selectByCustomerName(monthAccountQueryVo.getCustomeName());
        if(customer==null || customer.getAccstatus() ==1){
            return new RespR(false,"客户不存在或者已经停用");
        }
        CustomerRec customerRecParm = new CustomerRec();
        customerRecParm.setCompanyName(monthAccountQueryVo.getComPanyName());
        customerRecParm.setCustomerName(monthAccountQueryVo.getCustomeName());
        CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecParm);
        if(customerRec == null || customerRec.getRecStatus()==1){
            return new RespR(false,"客户未备案或备案失败");
        }
        WaybillCountQueryRequest waybillCountQueryRequest = new WaybillCountQueryRequest();
        waybillCountQueryRequest.setCompanyNum(customerRec.getCompanyNum());
        waybillCountQueryRequest.setTaxCode(monthAccountQueryVo.getTaxCode());
        waybillCountQueryRequest.setTradeMonth(monthAccountQueryVo.getTradeMonth());
        waybillCountQueryRequest.setWaybillSource(monthAccountQueryVo.getWaybillSource());
        waybillCountQueryRequest.setPageNo(monthAccountQueryVo.getPageNo());
        RespR<WaybillCountQueryResponse> waybillCountQueryResponseRespR =  noCarInterface.waybillCountQuery(waybillCountQueryRequest);
        return waybillCountQueryResponseRespR;
    }
}
