|
|
@@ -3,12 +3,16 @@ package com.goafanti.order.controller;
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
|
import com.goafanti.order.bo.InputOrderSalesSource;
|
|
|
+import com.goafanti.order.bo.OutOrderSalesSource;
|
|
|
import com.goafanti.order.service.OrderStatisticsService;
|
|
|
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;
|
|
|
@@ -23,6 +27,8 @@ import com.goafanti.order.service.ProjectStatisticsService;
|
|
|
@RequestMapping(value = "/api/admin/statistis")
|
|
|
public class StatisticsApiController extends CertifyApiController {
|
|
|
|
|
|
+ @Value(value = "${upload.path}")
|
|
|
+ private String uploadPath = null;
|
|
|
@Autowired
|
|
|
private ProjectStatisticsService projectStatisticsService;
|
|
|
@Autowired
|
|
|
@@ -93,6 +99,22 @@ public class StatisticsApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 订单销售来源统计
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/orderSalesSource/export" ,method = RequestMethod.GET)
|
|
|
+ public Result orderSalesSourceExport(InputOrderSalesSource in){
|
|
|
+ List<OutOrderSalesSource> list =orderStatisticsService.orderSalesSource( in);
|
|
|
+ NewExcelUtil<OutOrderSalesSource> excelUtil=new NewExcelUtil<>(OutOrderSalesSource.class);
|
|
|
+ StringBuffer str=new StringBuffer("搜索条件=》");
|
|
|
+ if (in.getDepName()!=null)str=str.append("部门:").append(in.getDepName()).append(";");
|
|
|
+ if(in.getProvinceName()!=null)str=str.append("省份:").append(in.getProvinceName()).append(";");
|
|
|
+ if (in.getSort()!=null)str=str.append("排序:").append(in.getSort()==1?"签单数":"签单金额").append(";");
|
|
|
+ if (in.getStartDate()!=null &&in.getEndDate()!=null)str=str.append("时间:").append(in.getStartDate()).append("~")
|
|
|
+ .append(in.getEndDate()).append(";");
|
|
|
+ return excelUtil.exportExcel(list,"订单销售来源统计表",uploadPath,str.toString());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|