Browse Source

销售来源统计导出百分比处理

anderx 3 years ago
parent
commit
5226bca70d

+ 7 - 5
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1607,14 +1607,16 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
       from t_order_new  where delete_sign in (0,2) and  buyer_id = #{uid}
     </select>
   <select id="orderSalesSource" resultType="com.goafanti.order.bo.OutOrderSalesSource">
-    select y.province,dg.name ,y.total_amount totalAmount,y.counts,y.dh,y.dh/y.counts dhl,y.wl,y.wl/y.counts wll,
+    select y.province,dg.name ,y.total_amount totalAmount,y.counts,y.dhxkf,y.dhxkf/y.counts dhxkfl,
+    y.dhzdzy,y.dhzdzy/y.counts dhzdzyl,y.wl,y.wl/y.counts wll,
     y.qd,y.qd/y.counts qdl,y.zjs,y.zjs/y.counts zjsl,y.qt,y.qt/y.counts qtl,
     y.gxfg,y.gxfg/y.counts gxfgl,y.qtfg,y.qtfg/y.counts qtfgl
     from (select x.province,sum(x.total_amount)total_amount,sum(x.counts)counts,
-    sum(x.dh)dh,sum(x.wl)wl,sum(x.qd)qd, sum(x.zjs)zjs, sum(x.qt)qt,
+    sum(x.dhxkf)dhxkf,sum(x.dhzdzy)dhzdzy,sum(x.wl)wl,sum(x.qd)qd, sum(x.zjs)zjs, sum(x.qt)qt,
     sum(x.gxfg)gxfg, sum(x.qtfg)qtfg
-    from ( select a.order_no ,a.order_dep ,b.province ,1 counts,a.total_amount,a.sales_type ,
-    case a.sales_type when 0 then 1 when 1 then 1 else 0 end dh,
+    from ( select b.province ,1 counts,a.total_amount,a.sales_type ,
+    case a.sales_type when 0 then 1  else 0 end dhxkf,
+    case a.sales_type when 1 then 1 else 0 end dhzdzy,
     case a.sales_type when 2 then 1 else 0 end wl,
     case a.sales_type when 3 then 1 else 0 end qd,
     case a.sales_type when 4 then 1 else 0 end zjs,
@@ -1702,7 +1704,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     select count(*)
     from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
     left join department dep on a.order_dep=dep.id
-    where a.delete_sign in(0,2) and a.process_status >4
+    where a.delete_sign in(0,2) and a.process_status >0
     <if test="province !=null ">
       and dep.province = #{province}
     </if>

+ 32 - 12
src/main/java/com/goafanti/order/bo/OutOrderSalesSource.java

@@ -12,10 +12,14 @@ public class OutOrderSalesSource {
     private BigDecimal totalAmount;
     @Excel(name = "签单数(个)",width = 10)
     private Integer counts;
-    @Excel(name = "电话",width = 10)
-    private Integer dh;
-    @Excel(name = "电话占比",suffix = "%",percentage = 1,width = 10)
-    private String dhl;
+    @Excel(name = "电话新开发",width = 10)
+    private Integer dhxkf;
+    @Excel(name = "电话新开发占比",suffix = "%",percentage = 1,width = 10)
+    private String dhxkfl;
+    @Excel(name = "电话自带资源",width = 10)
+    private Integer dhzdzy;
+    @Excel(name = "电话自带资源占比",suffix = "%",percentage = 1,width = 10)
+    private String dhzdzyl;
     @Excel(name = "网络",width = 10)
     private Integer wl;
     @Excel(name = "网络占比",suffix = "%",percentage = 1,width = 10)
@@ -73,20 +77,36 @@ public class OutOrderSalesSource {
         this.counts = counts;
     }
 
-    public Integer getDh() {
-        return dh;
+    public Integer getDhxkf() {
+        return dhxkf;
     }
 
-    public void setDh(Integer dh) {
-        this.dh = dh;
+    public void setDhxkf(Integer dhxkf) {
+        this.dhxkf = dhxkf;
     }
 
-    public String getDhl() {
-        return dhl;
+    public String getDhxkfl() {
+        return dhxkfl;
     }
 
-    public void setDhl(String dhl) {
-        this.dhl = dhl;
+    public void setDhxkfl(String dhxkfl) {
+        this.dhxkfl = dhxkfl;
+    }
+
+    public Integer getDhzdzy() {
+        return dhzdzy;
+    }
+
+    public void setDhzdzy(Integer dhzdzy) {
+        this.dhzdzy = dhzdzy;
+    }
+
+    public String getDhzdzyl() {
+        return dhzdzyl;
+    }
+
+    public void setDhzdzyl(String dhzdzyl) {
+        this.dhzdzyl = dhzdzyl;
     }
 
     public Integer getWl() {