package com.matrix.system.hiveErp.action; 
 | 
  
 | 
import com.matrix.core.constance.MatrixConstance; 
 | 
import com.matrix.core.pojo.AjaxResult; 
 | 
import com.matrix.core.tools.WebUtil; 
 | 
import com.matrix.system.common.bean.SysUsers; 
 | 
import com.matrix.system.common.tools.DataAuthUtil; 
 | 
import com.matrix.system.hive.bean.SysShopInfo; 
 | 
import com.matrix.system.hive.dao.SysShopInfoDao; 
 | 
import com.matrix.system.hive.service.imp.DataAnalysisCustomerServiceImpl; 
 | 
import com.matrix.system.hiveErp.analysUtil.*; 
 | 
import com.matrix.system.hiveErp.dao.TjVipSumDao; 
 | 
import org.jetbrains.annotations.NotNull; 
 | 
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 java.util.*; 
 | 
  
 | 
/** 
 | 
 * 会员数据分析 
 | 
 * @author jyy 
 | 
 */ 
 | 
@Controller 
 | 
@RequestMapping(value = "admin/analysis") 
 | 
public class DataAnalysisCustomer { 
 | 
  
 | 
    @Autowired 
 | 
    TjVipSumDao tjVipSumDao; 
 | 
  
 | 
    @Autowired 
 | 
    SysShopInfoDao shopInfoDao; 
 | 
  
 | 
    @Autowired 
 | 
    DataAnalysisCustomerServiceImpl dataAnalysisCustomerService; 
 | 
  
 | 
  
 | 
    /** 
 | 
     * 会员人头数统计 
 | 
     * 业务说明: 
 | 
     * 人头指门店所有进店客户的总人数,同一个人在一段时间内无论进店几次都视为一次进店 
 | 
     * 比如:张三1个月来了3次做护理,李四来2次做护理,杨欢来2次做护理,但是只统计客户名字,那人头就是3个 
 | 
     * @param statisticsParam 
 | 
     * @return 
 | 
     */ 
 | 
    @RequestMapping(value = "/customerHeadCompare") 
 | 
    public @ResponseBody  AjaxResult customerHeadCompare(StatisticsParamVo statisticsParam) { 
 | 
        return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { 
 | 
            @Override 
 | 
            public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { 
 | 
                //从员工业绩统计表中,按时间段,门店的维度统计人头数 
 | 
                return tjVipSumDao.customerHeadCompare(timeSpaceParam,shopId); 
 | 
            } 
 | 
        }); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 会员人次统计 
 | 
     * 业务说明: 
 | 
     * 一个会员在一天进店一次或者多次即为一个人次 
 | 
     * @param statisticsParam 
 | 
     * @return 
 | 
     */ 
 | 
    @RequestMapping(value = "/customerEnterCountCompare") 
 | 
    public @ResponseBody  AjaxResult customerEnterCountCompare(StatisticsParamVo statisticsParam) { 
 | 
        return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { 
 | 
            @Override 
 | 
            public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { 
 | 
                //从员工业绩统计表中,按时间段,门店的维度统计人次 
 | 
                return tjVipSumDao.customerEnterCountCompare(timeSpaceParam,shopId); 
 | 
            } 
 | 
        }); 
 | 
    } 
 | 
  
 | 
  
 | 
    /** 
 | 
     * 到店率 
 | 
     * 业务说明: 
 | 
     * 门店所有客户人次数除以人头数 
 | 
     * @param statisticsParam 
 | 
     * @return 
 | 
     */ 
 | 
    @RequestMapping(value = "/customerEnterRateCompare") 
 | 
    public @ResponseBody  AjaxResult customerEnterRateCompare(StatisticsParamVo statisticsParam) { 
 | 
        return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { 
 | 
            @Override 
 | 
            public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { 
 | 
                //从员工业绩统计表中,按时间段,门店的维度统计人次 
 | 
                return tjVipSumDao.customerEnterRateCompare(timeSpaceParam,shopId); 
 | 
            } 
 | 
        }); 
 | 
    } 
 | 
  
 | 
  
 | 
  
 | 
  
 | 
  
 | 
  
 | 
  
 | 
  
 | 
} 
 |