| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- package com.goafanti.user.controller;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.controller.BaseApiController;
- import com.goafanti.common.utils.excel.NewExcelUtil;
- import com.goafanti.user.bo.InputUserFollowList;
- import com.goafanti.user.bo.outFollowStatisticsList;
- import com.goafanti.user.bo.outProvinceFollowStatistic;
- import com.goafanti.user.bo.outUserFollowList;
- import com.goafanti.user.service.UserFollowService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- @RestController
- @RequestMapping(value = "/api/admin")
- public class UserFollowController extends BaseApiController {
- @Autowired
- private UserFollowService userFollowService;
- @Value(value = "${upload.path}")
- private String uploadPath = null;
- /**
- * 用户跟进列表
- * @param in
- * @return
- */
- @RequestMapping(value = "/userFollowList", method = RequestMethod.GET)
- public Result userFollowList(InputUserFollowList in){
- Result res =new Result();
- res.data(userFollowService.userFollowList(in));
- return res;
- }
- /**
- * 导出用户跟进列表
- * @param in
- * @return
- */
- @RequestMapping(value = "/userFollowListExport", method = RequestMethod.GET)
- public Result userFollowListExport(InputUserFollowList in){
- Result res =new Result();
- List<outUserFollowList> list= userFollowService.userFollowListExport(in);
- NewExcelUtil<outUserFollowList> excel=new NewExcelUtil<>(outUserFollowList.class);
- return excel.exportExcel(list,"客户跟进列表",uploadPath);
- }
- /**
- * 面谈跟进统计
- * @return
- */
- @RequestMapping(value = "/followStatisticsList", method = RequestMethod.GET)
- public Result followStatisticsList(String depId,String date,Integer province,Integer sort){
- Result res =new Result();
- return res.data(userFollowService.followStatisticsList(depId,date,province,sort));
- }
- /**
- * 面谈跟进统计导出
- * @return
- */
- @RequestMapping(value = "/followStatisticsListExport", method = RequestMethod.GET)
- public Result followStatisticsListExport(String depId,String date,Integer province,Integer sort,String depName,String provinceName){
- Result res =new Result();
- List<outFollowStatisticsList> list=userFollowService.followStatisticsList(depId,date,province,sort);
- NewExcelUtil<outFollowStatisticsList>excelUtil =new NewExcelUtil<>(outFollowStatisticsList.class);
- StringBuffer sb=new StringBuffer("搜索条件=》");
- if (depName!=null)sb=sb.append("部门:").append(depName).append(",");
- if(provinceName!=null)sb=sb.append("省份:").append(provinceName).append(",");
- if(sort!=null){
- sb=sb.append("排序:");
- if (sort==0)sb=sb.append("按总数量");
- else if (sort==1)sb=sb.append("按总金额");
- else if (sort==2)sb=sb.append("按总面谈");
- sb=sb.append(",");
- }
- if (date!=null){
- sb=sb.append("时间:").append(date).append(",");
- }
- return excelUtil.exportExcel(list,"面谈跟进统计",uploadPath,sb.substring(0,sb.toString().length()-1));
- }
- /**
- * 省份面谈跟进统计
- * @return
- */
- @RequestMapping(value = "/provinceFollowStatisticsList", method = RequestMethod.GET)
- public Result provinceFollowStatisticsList(String depId,String date,Integer province,Integer sort){
- Result res =new Result();
- return res.data(userFollowService.provinceFollowStatisticsList(depId,date,province,sort));
- }
- /**
- * 省份面谈跟进统计
- * @return
- */
- @RequestMapping(value = "/provinceFollowStatisticsListExport", method = RequestMethod.GET)
- public Result provinceFollowStatisticsListExport(String depId,String depName,String date,Integer province,String provinceName,Integer sort){
- List<outProvinceFollowStatistic> list = userFollowService.provinceFollowStatisticsList(depId, date, province, sort);
- NewExcelUtil<outProvinceFollowStatistic>excelUtil =new NewExcelUtil<>(outProvinceFollowStatistic.class);
- StringBuffer sb=new StringBuffer("搜索条件=》");
- if (depName!=null)sb=sb.append("部门:").append(depName).append(",");
- if(provinceName!=null)sb=sb.append("省份:").append(provinceName).append(",");
- if(sort!=null){
- sb=sb.append("排序:");
- if (sort==0)sb=sb.append("按签单");
- else if (sort==1)sb=sb.append("按面谈");
- sb=sb.append(",");
- }
- if (date!=null){
- sb=sb.append("时间:").append(date).append(",");
- }
- return excelUtil.exportExcel(list,"省份面谈跟进统计",uploadPath,sb.substring(0,sb.toString().length()-1));
- }
- }
|