Browse Source

修改花王核销报表格式

leoone8322 2 weeks ago
parent
commit
6d03724394

+ 8 - 5
src/main/java/com/jzlife/report/dto/kaocf/KaoCom.java

@@ -11,6 +11,9 @@ import java.math.BigDecimal;
 @Data
 public class KaoCom {
 
+    @Excel(name = "服务单号")
+    private String bookId;
+
     @Excel(name = "城市")
     private String city;
 
@@ -23,11 +26,11 @@ public class KaoCom {
     @Excel(name = "购买商品")
     private String goodsName;
 
-    @Excel(name = "预约次数")
-    private Integer serviceTime;
-
-    @Excel(name = "已完成次数")
-    private Integer servicedTime;
+//    @Excel(name = "预约次数")
+//    private Integer serviceTime;
+//
+//    @Excel(name = "已完成次数")
+//    private Integer servicedTime;
 
     @Excel(name = "已完成服务GMV")
     private BigDecimal gmv;

+ 8 - 7
src/main/resources/mybatis/mapper/kaocf/KaocfMapper.xml

@@ -27,22 +27,23 @@
 
     <!--    花王履约-->
     <select id="getKaoCom"  resultType="com.jzlife.report.dto.kaocf.KaoCom">
-        select a.service_city   as city,
+        select a.id             as bookId,
+               a.service_city   as city,
                a.book_date      as bookDate,
-               b.goods_name     as goodsName,
+               ifnull(st.level_two,b.goods_name)     as goodsName,
                ch.name          as orderChannel,
-               count(1)         as serviceTime,
-               sum(if(a.status in (3,4),1,0)) as servicedTime,
-               sum(if(a.status in (3,4),c.actual_price/bk.service_times,0)) as gmv
+--                count(1)         as serviceTime,
+--                sum(if(a.status in (3,4),1,0)) as servicedTime,
+               if(a.status in (3,4),c.actual_price/bk.service_times,0) as gmv
         from jlife_nurse.jz_order_book_detail a
              join jlife_nurse.jz_order_goods b on a.order_id=b.order_id
              join jlife_nurse.jz_order       c on c.id=a.order_id
              join jlife_nurse.jz_dm_channel ch on c.order_channel=ch.id
              join jlife_nurse.jz_order_book bk on a.book_id=bk.id
+             left join jlife_reports.goods_stinct st on st.mall_product_id=b.product_id
         where  a.book_date between #{startTime} and #{endTime}
-           and a.status in (1,2,3,4,7)
+           and a.status in (3,4)
            and b.goods_name like '%花王%'
-          group by a.service_city,a.book_date,b.goods_name,ch.name
     </select>
 
 </mapper>