package com.jkcredit.invoice.controller.service;

import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
import com.jkcredit.invoice.service.lowerService.CustomeLowerService;
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.util.RespR;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "无车下游接口")
@RestController
@RequestMapping(value = {"/noCarService"})
public class NoCarServiceController {
    @Autowired
    private NoCarService noCarService;

    /**
     * @param noCarWayBill
     * @return
     */
    @PostMapping("/noCarBillStart")
    @ApiOperation(value="实时运单开始指令", notes="实时运单开始指令")
    //@LoginRequired
    public RespR noCarBillStart(@RequestBody NoCarWayBill noCarWayBill){
        return noCarService.noCarWaybillStart(noCarWayBill);
    }
    /**
     * @param noCarWayBill
     * @return
     */
    @PostMapping("/noCarBillEnd")
    @ApiOperation(value="实时运单结束指令", notes="实时运单结束指令")
    //@LoginRequired
    public RespR noCarBillEnd(@RequestBody NoCarWayBill noCarWayBill){
        return noCarService.noCarWaybillEnd(noCarWayBill);
    }
    /**
     * @param noCarWayBill
     * @return
     */
    @PostMapping("/noCarHisWaybillStart")
    @ApiOperation(value="历史运单开始指令", notes="用户运单结束指令")
    //@LoginRequired
    public RespR noCarHisWaybillStart(@RequestBody NoCarWayBill noCarWayBill){
        return noCarService.noCarHisWaybillStart(noCarWayBill);
    }
    /**
     * @param noCarWayBill
     * @return
     */
    @PostMapping("/noCarHisWaybillEnd")
    @ApiOperation(value="历史运单结束指令", notes="历史运单结束指令")
    //@LoginRequired
    public RespR noCarHisWaybillEnd(@RequestBody NoCarWayBill noCarWayBill){
        return noCarService.noCarHisWaybillEnd(noCarWayBill);
    }

    /**
     * @param
     * @return
     */
    @PostMapping("/noCarVoiceQuery")
    @ApiOperation(value="发票查询接口（走本地库）", notes="发票查询接口（走本地库）")
    //@LoginRequired
    public RespR noCarVoiceQuery(@RequestBody NoCarWayBill noCarWayBill){
        return noCarService.getInvoiceByWayBillNumReal(noCarWayBill,false);
    }

    /**
     * @param
     * @return
     */
    @PostMapping("/hCVoiceQuery")
    @ApiOperation(value="红冲发票查询接口", notes="红冲发票查询接口")
    //@LoginRequired
    public RespR hCVoiceQuery(@RequestBody HCInvoiceQueryVo hcInvoiceQueryVo){
        return noCarService.hCInvoiceQuery(hcInvoiceQueryVo);
    }

    /**
     * @param
     * @return
     */
    @PostMapping("/monthAccQuery")
    @ApiOperation(value="月账单交易查询", notes="月账单交易查询")
    //@LoginRequired
    public RespR monthAccQuery(@RequestBody MonthAccountQueryVo monthAccountQueryVo){
        return noCarService.monthAccQuery(monthAccountQueryVo);
    }

    /**
     * @param customerCarRecs
     * @return
     */
    @PostMapping("/customerCarRec")
    @ApiOperation(value="", notes="车辆备案")
    //@LoginRequired
    public RespR customerCarRec(@RequestBody List<CustomerCarRec> customerCarRecs){
        return noCarService.customerCarRec(customerCarRecs);
    }
    /**
     * @param customerCarRec
     * @return
     */
    @PostMapping("/customeRecUpperQuery")
    @ApiOperation(value="车辆备案信息查询", notes="用户备案信息查询")
    //@LoginRequired
    public RespR customeRecUpperQuery(@RequestBody CustomerCarRec customerCarRec){
        return noCarService.customerCarRecQueryUpper(customerCarRec);
    }



    /**
     * @param customerCarRec
     * @return
     */
    @PostMapping("/customerCarRecQuery")
    @ApiOperation(value="", notes="车辆备案查询")
    // @LoginRequired
    public RespR customerCarRecQuery(@RequestBody CustomerCarRec customerCarRec){
        return noCarService.customerCarRecQuery(customerCarRec);
    }
}
