|
|
|
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 organizationId 零售公司id
|
|
|
|
* @param shopId 店铺id
|
|
|
|
* @param sevenDayStartTime 近七天开始时间
|
|
|
|
* @param sevenDayEndTime 近七天结束时间
|
|
|
|
* @return 客户概览VO
|
|
|
|
*/
|
|
|
|
@ResponseBody
|
|
|
|
@RequestMapping(value = "/main", method = RequestMethod.GET)
|
|
|
|
public Map<String,Object> getMainData(@RequestParam("userId")Long userId, Long organizationId, Long shopId,
|
|
|
|
@RequestParam("sevenDayStartTime")String sevenDayStartTime, @RequestParam("sevenDayEndTime")String sevenDayEndTime){
|
|
|
|
try{
|
|
|
|
CustomerViewVO result = customerViewService.selectCustomerViewMain(userId, organizationId, shopId, sevenDayStartTime, sevenDayEndTime);
|
|
|
|
return data(result);
|
|
|
|
}catch (Exception e){
|
|
|
|
log.error("查询客户数据概览出错", e);
|
|
|
|
return fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|