Browse Source

销售来源修改开发

anderx 3 years ago
parent
commit
dd1cdde574

+ 207 - 0
src/main/java/com/goafanti/order/bo/outStatistics/OutOrderSalesSourceAmount.java

@@ -0,0 +1,207 @@
+package com.goafanti.order.bo.outStatistics;
+
+import com.goafanti.common.utils.excel.Excel;
+
+import java.math.BigDecimal;
+
+public class OutOrderSalesSourceAmount {
+    private Integer province;
+    @Excel(name = "省份",width = 10)
+    private String name;
+    @Excel(name = "签单金额(万元)",scale=6)
+    private BigDecimal totalAmount;
+    @Excel(name = "签单数(个)",width = 10)
+    private Integer counts;
+    @Excel(name = "电话新开发",width = 10)
+    private BigDecimal dhxkf;
+    @Excel(name = "电话新开发占比",percentage = 1,width = 10)
+    private String dhxkfl;
+    @Excel(name = "电话自带资源",width = 10)
+    private BigDecimal dhzdzy;
+    @Excel(name = "电话自带资源占比",percentage = 1,width = 10)
+    private String dhzdzyl;
+    @Excel(name = "网络",width = 10)
+    private BigDecimal wl;
+    @Excel(name = "网络占比",percentage = 1,width = 10)
+    private String wll;
+    @Excel(name = "渠道",width = 10)
+    private BigDecimal qd;
+    @Excel(name = "渠道占比",percentage = 1,width = 10)
+    private String qdl;
+    @Excel(name = "转介绍",width = 10)
+    private BigDecimal zjs;
+    @Excel(name = "转介绍占比",percentage = 1,width = 10)
+    private String zjsl;
+    @Excel(name = "其他",width = 10)
+    private BigDecimal qt;
+    @Excel(name = "其他占比",percentage = 1,width = 10)
+    private String qtl;
+    @Excel(name = "高新复购",width = 10)
+    private BigDecimal gxfg;
+    @Excel(name = "高新复购占比",percentage = 1,width = 10)
+    private String gxfgl;
+    @Excel(name = "其他复购",width = 10)
+    private BigDecimal qtfg;
+    @Excel(name = "其他复购占比",percentage = 1,width = 10)
+    private String qtfgl;
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Integer getCounts() {
+        return counts;
+    }
+
+    public void setCounts(Integer counts) {
+        this.counts = counts;
+    }
+
+    public BigDecimal getDhxkf() {
+        return dhxkf;
+    }
+
+    public void setDhxkf(BigDecimal dhxkf) {
+        this.dhxkf = dhxkf;
+    }
+
+    public String getDhxkfl() {
+        return dhxkfl;
+    }
+
+    public void setDhxkfl(String dhxkfl) {
+        this.dhxkfl = dhxkfl;
+    }
+
+    public BigDecimal getDhzdzy() {
+        return dhzdzy;
+    }
+
+    public void setDhzdzy(BigDecimal dhzdzy) {
+        this.dhzdzy = dhzdzy;
+    }
+
+    public String getDhzdzyl() {
+        return dhzdzyl;
+    }
+
+    public void setDhzdzyl(String dhzdzyl) {
+        this.dhzdzyl = dhzdzyl;
+    }
+
+    public BigDecimal getWl() {
+        return wl;
+    }
+
+    public void setWl(BigDecimal wl) {
+        this.wl = wl;
+    }
+
+    public String getWll() {
+        return wll;
+    }
+
+    public void setWll(String wll) {
+        this.wll = wll;
+    }
+
+    public BigDecimal getQd() {
+        return qd;
+    }
+
+    public void setQd(BigDecimal qd) {
+        this.qd = qd;
+    }
+
+    public String getQdl() {
+        return qdl;
+    }
+
+    public void setQdl(String qdl) {
+        this.qdl = qdl;
+    }
+
+    public BigDecimal getZjs() {
+        return zjs;
+    }
+
+    public void setZjs(BigDecimal zjs) {
+        this.zjs = zjs;
+    }
+
+    public String getZjsl() {
+        return zjsl;
+    }
+
+    public void setZjsl(String zjsl) {
+        this.zjsl = zjsl;
+    }
+
+    public BigDecimal getQt() {
+        return qt;
+    }
+
+    public void setQt(BigDecimal qt) {
+        this.qt = qt;
+    }
+
+    public String getQtl() {
+        return qtl;
+    }
+
+    public void setQtl(String qtl) {
+        this.qtl = qtl;
+    }
+
+    public BigDecimal getGxfg() {
+        return gxfg;
+    }
+
+    public void setGxfg(BigDecimal gxfg) {
+        this.gxfg = gxfg;
+    }
+
+    public String getGxfgl() {
+        return gxfgl;
+    }
+
+    public void setGxfgl(String gxfgl) {
+        this.gxfgl = gxfgl;
+    }
+
+    public BigDecimal getQtfg() {
+        return qtfg;
+    }
+
+    public void setQtfg(BigDecimal qtfg) {
+        this.qtfg = qtfg;
+    }
+
+    public String getQtfgl() {
+        return qtfgl;
+    }
+
+    public void setQtfgl(String qtfgl) {
+        this.qtfgl = qtfgl;
+    }
+}

+ 17 - 3
src/main/java/com/goafanti/order/controller/StatisticsApiController.java

@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
 import com.alibaba.fastjson.JSONObject;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.*;
+import com.goafanti.order.bo.outStatistics.OutOrderSalesSourceAmount;
 import com.goafanti.order.service.OrderStatisticsService;
 import com.goafanti.order.service.UserStaticticsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -94,8 +95,21 @@ public class StatisticsApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value="/orderSalesSource/export" ,method = RequestMethod.GET)
 	public Result orderSalesSourceExport(InputOrderSalesSource in){
-		List<OutOrderSalesSource>  list =orderStatisticsService.orderSalesSource(in);
+		if (in.getSort()==0){
+		List<OutOrderSalesSource>  list = (List<OutOrderSalesSource>) orderStatisticsService.orderSalesSource(in);
 		NewExcelUtil<OutOrderSalesSource> excelUtil=new NewExcelUtil<>(OutOrderSalesSource.class);
+		StringBuffer str = getStringBuffer(in);
+		return excelUtil.exportExcel(list,"订单销售来源统计表",uploadPath,str.toString());
+		}else if (in.getSort()==1){
+			List<OutOrderSalesSourceAmount>  list = (List<OutOrderSalesSourceAmount>) orderStatisticsService.orderSalesSource(in);
+			NewExcelUtil<OutOrderSalesSourceAmount> excelUtil=new NewExcelUtil<>(OutOrderSalesSourceAmount.class);
+			StringBuffer str = getStringBuffer(in);
+			return excelUtil.exportExcel(list,"订单销售来源统计表",uploadPath,str.toString());
+		}
+		return new Result();
+	}
+
+	private StringBuffer getStringBuffer(InputOrderSalesSource in) {
 		StringBuffer str=new StringBuffer("搜索条件=》");
 		if (in.getDepName()!=null){
 			str=str.append("部门:").append(in.getDepName()).append(";");
@@ -106,11 +120,11 @@ public class StatisticsApiController extends CertifyApiController {
 		if (in.getSort()!=null){
 			str=str.append("排序:").append(in.getSort()==1?"签单数":"签单金额").append(";");
 		}
-		if (in.getStartDate()!=null &&in.getEndDate()!=null){
+		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());
+		return str;
 	}
 
 	/**

+ 1 - 1
src/main/java/com/goafanti/order/service/OrderStatisticsService.java

@@ -12,7 +12,7 @@ import java.util.List;
 public interface OrderStatisticsService {
 
 
-	List<OutOrderSalesSource> orderSalesSource(InputOrderSalesSource in);
+	Object orderSalesSource(InputOrderSalesSource in);
 
 
 }

+ 1 - 1
src/main/java/com/goafanti/order/service/impl/OrderStatisticsServiceImpl.java

@@ -18,7 +18,7 @@ public class OrderStatisticsServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	private TOrderNewMapper tOrderNewMapper;
 
 	@Override
-	public List<OutOrderSalesSource> orderSalesSource(InputOrderSalesSource in) {
+	public Object orderSalesSource(InputOrderSalesSource in) {
 		if (in.getSort()==null)in.setSort(0);
 		if(in.getEndDate()!=null)in.setEndDate(in.getEndDate()+" 23:59:59");
 		if (in.getDeps()!=null){