package com.kiisoo.ic.customer.controller; import com.kiisoo.ic.common.BaseController; import com.kiisoo.ic.customer.entity.CustomerViewVO; import com.kiisoo.ic.customer.service.CustomerViewService; 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.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.util.Map; /** * @Description: 客户数据概览 * @Author: wangyinjia * @Date: 2020/4/9 * @Company: kiisoo * @Version: 1.0 */ @Slf4j @Controller @RequestMapping("/customer/view") public class CustomerViewController extends BaseController { /** * 客户数据概览service */ @Autowired private CustomerViewService customerViewService; /** * 客户概览main * @param userId 用户id * @param selectStartTime 选中开始时间 * @param selectEndTime 选中结束时间 * @param startTime 柱状图开始时间 * @param endTime 柱状图结束时间 * @return 客户概览VO */ @ResponseBody @RequestMapping(value = "/main", method = RequestMethod.GET) public Map getMainData(@RequestParam("userId")Long userId, @RequestParam("selectStartTime")String selectStartTime, @RequestParam("selectEndTime")String selectEndTime, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime){ try{ CustomerViewVO result = customerViewService.selectCustomerViewMain(userId, selectStartTime, selectEndTime, startTime, endTime); return data(result); }catch (Exception e){ log.error("查询客户数据概览出错", e); return fail(); } } }