package com.weiqi.mis.contorller;

import com.weiqi.vo.OrderInfoVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.weiqi.mis.MsgService;
import com.weiqi.mis.ReturnValue;

/**
 * 下发查询
 */
@Controller
@RequestMapping(value = "mis/down")
//@LoginType
@Slf4j
public class CarController {

    @Autowired
    MsgService msgService;


    /**
     * 订单明细
     *
     * @return
     */
    @RequestMapping(value = "/index")

    public Object list() {

        return "car/orderInfo";
    }

    /**
     * 下行详情数据
     *
     * @return
     */
    @RequestMapping(value = "list")
    @ResponseBody
    public Object getlist(OrderInfoVo records) {

        return msgService.getOrderinfo(records);

    }

    /**
     * 获取appid
     *
     * @return
     */
    @RequestMapping(value = "getappId")
    @ResponseBody
    public Object getappId() {

        return msgService.getAppId();

    }

    /**
     * @return
     */
    @RequestMapping(value = "init123")
    @ResponseBody
    public Object setorderInfo() {

        return msgService.setorderInfo();

    }

    /**
     * 获取通道
     *
     * @return
     */
    @RequestMapping(value = "getsp")
    @ResponseBody
    public Object getsp() {

        return msgService.getsp();

    }

    /**
     * 获取可用sp通道
     *
     * @return
     */
    @RequestMapping(value = "/usable/getsp")
    @ResponseBody
    public Object usableGetsp() {

        return msgService.usableGetsp();
    }


    /**
     * 获取同步
     *
     * @return
     */
    @RequestMapping(value = "/tb")
    @ResponseBody
    public Object tb(int id) {

        log.info("id= {}", id);
        return ReturnValue.buildErrordata(0, "同步成功！");
    }

    @RequestMapping(value = "addinfo")
    @ResponseBody
    public Object addinfo() {

        return msgService.addinfo();

    }

}
