package com.yxproject.start.api;

//import com.yxproject.start.service.FindCbCountByDealdateViewService;
import com.yxproject.start.service.CardBodyService;
import com.yxproject.start.service.FindStationCountService;
import com.yxproject.start.service.FindTaskByDealdateViewService;
import com.yxproject.start.utils.YXJSONResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/11/21.
 */
@RestController
@RequestMapping("yingxin")
public class YingxinApi {
    @Autowired
    private FindTaskByDealdateViewService findTaskByDealdateViewService;

//    private FindCbCountByDealdateViewService findCbCountByDealdateViewService;
    @Autowired
    private CardBodyService cardBodyService;
    @Autowired
    private FindStationCountService findStationCountService;

    @RequestMapping("getGroupInfo")
    public List<Map<String, Object>> getGroupInfo() {
        List<Map<String, Object>> list = findTaskByDealdateViewService.getAccGroupData();
        return list;
    }
    @RequestMapping("getCbCountInfo")
    public  List<Map<String,Object>> getCbCountInfo() {
        List<Map<String, Object>> list=cardBodyService.getCbCount();
        return list;
    }
    @RequestMapping("getCbBodyCountInfo")
    public List<Map<String,Object>> getCbBodyCountInfo() {
        List<Map<String,Object>> list=cardBodyService.getCbBodyCount();
        return list;
    }

    @RequestMapping("getStationCountInfo")
    public String getStationCountInfo(@RequestParam("submitDate") String submitDate, HttpServletResponse resp){
        List<Map<String,Object>> list=findStationCountService.getStationCountData(submitDate);
        YXJSONResponse yxjsonResponse = new YXJSONResponse();
        resp.setCharacterEncoding("UTF-8");
        yxjsonResponse.outPutSuccess(list);
        Map map = new HashMap();
//      map.put("MakeType",productionTaskListEntity);
        return yxjsonResponse.toJSONString();
    }


}

