客户数据概览后台
parent
0acd3161f8
commit
cdb15a30dd
@ -0,0 +1,58 @@
|
|||||||
|
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 regionId 区域id
|
||||||
|
* @param shopId 店铺id
|
||||||
|
* @param sellerId 导购id
|
||||||
|
* @param sevenDayStartTime 近七天开始时间
|
||||||
|
* @param sevenDayEndTime 近七天结束时间
|
||||||
|
* @return 客户概览VO
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = "/main", method = RequestMethod.GET)
|
||||||
|
public Map<String,Object> getMainData(@RequestParam("userId")Long userId, Long regionId, Long shopId, Long sellerId,
|
||||||
|
@RequestParam("sevenDayStartTime")String sevenDayStartTime, @RequestParam("sevenDayEndTime")String sevenDayEndTime){
|
||||||
|
try{
|
||||||
|
CustomerViewVO result = customerViewService.selectCustomerViewMain(userId, regionId, shopId, sellerId, sevenDayStartTime, sevenDayEndTime);
|
||||||
|
return data(result);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("查询客户数据概览出错", e);
|
||||||
|
return fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.kiisoo.ic.customer.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 客户概览VO
|
||||||
|
* @Author: wangyinjia
|
||||||
|
* @Date: 2020/4/9
|
||||||
|
* @Company: kiisoo
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CustomerViewVO {
|
||||||
|
/**未关联的客户*/
|
||||||
|
private Long customer;
|
||||||
|
/**已关联人数*/
|
||||||
|
private Long common;
|
||||||
|
/**未关联的会员*/
|
||||||
|
private Long vip;
|
||||||
|
/**近七天新增客户list*/
|
||||||
|
List<OpCustomer> sevenDayCustomerList;
|
||||||
|
/**近七天新增会员list*/
|
||||||
|
List<OpVip> sevenDayVipList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*/
|
||||||
|
public CustomerViewVO(){
|
||||||
|
customer = 0L;
|
||||||
|
common = 0L;
|
||||||
|
vip = 0L;
|
||||||
|
sevenDayCustomerList = new ArrayList<>();
|
||||||
|
sevenDayVipList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.kiisoo.ic.customer.mapper.OpVipDOMapper">
|
||||||
|
|
||||||
|
<!--会员list-->
|
||||||
|
<select id="selectVipList" resultType="com.kiisoo.ic.customer.entity.OpVip">
|
||||||
|
select t1.id as id, t1.register_time as registerTime, t1.phone as phone, t2.register_store_id as shopId
|
||||||
|
from op_vip t1,op_vip_attr t2
|
||||||
|
where t1.id = t2.vip_id
|
||||||
|
<if test="shopIds != null and shopIds.size > 0">
|
||||||
|
and t2.register_store_id in
|
||||||
|
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
and t1.register_time <![CDATA[ >= ]]> #{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate != null">
|
||||||
|
and t1.register_time <![CDATA[ <= ]]> #{endDate}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue