Преглед изворни кода

公司明细导出excel接口增加判断是否导出各字段总合为0的数据

hcst_sunzhen пре 5 година
родитељ
комит
cb96920ded

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyAgentSumController.java

@@ -273,7 +273,7 @@ public class KuaishouReportDailyAgentSumController {
 			 return result;
 		 }
 
-		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(date, advertiserName);
+		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(date, advertiserName, null);
 		 result.setResult(kuaishouReportDailyAgentList);
 		 result.setSuccess(true);
 		 result.setMessage("success");
@@ -344,7 +344,7 @@ public class KuaishouReportDailyAgentSumController {
 		 result.setMessage("success");
 
 		 //公司报表按天明细
-		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(dto.getDate(), null);
+		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(dto.getDate(), dto.getAdvertiserName(), dto.getIsExportNullData());
 
 		 //导出excel
 		 List<List<Object>> group = new ArrayList<>();

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ParamsDTO.java

@@ -11,4 +11,5 @@ public class ParamsDTO implements Serializable {
     private String endDate;
     private String date;
     private String advertiserName;  //广告主名称
+    private Integer isExportNullData; //是否导出为0数据
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAgentSumMapper.java

@@ -19,7 +19,7 @@ public interface KuaishouReportDailyAgentSumMapper extends BaseMapper<KuaishouRe
     KuaishouReportDailyAgentSum companyReportSum(@Param("startDate")String startDate, @Param("endDate")String endDate);
 
     //根据某天的时间获取公司报表明细
-    List<KuaishouReportDailyAgent> companyReportAccountDetailList(@Param("date")String date, @Param("advertiserName")String advertiserName);
+    List<KuaishouReportDailyAgent> companyReportAccountDetailList(@Param("date")String date, @Param("advertiserName")String advertiserName, @Param("isExportNullData")Integer isExportNullData);
 
     //根据时间段获取公司报表明细
     List<KuaishouReportDailyAgent> companyReportAccountDetailListByDateRange(@Param("startDate")String startDate, @Param("endDate")String endDate);

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAgentSumMapper.xml

@@ -86,6 +86,12 @@
         <if test="advertiserName != null and advertiserName != ''">
             and advertiser_name like concat('%',#{advertiserName},'%')
         </if>
+        <if test="isExportNullData == 0 and isExportNullData == '0'">  <!-- 判断是否导出公司明细中各字段总合为0的数据  1-导出 0-不导出 -->
+            and
+            (cost_campaign_count + balance + cost + xianjin_cost + fandian_cost + kuangfan_cost + jili_cost +
+            xinyong_cost + fengmian_show_count + fengmian_click_count + sucai_show_count + convert_count +
+            fengmian_click_rate + convert_click_rate) != 0
+        </if>
     </select>
 
     <!-- 根据传入开始时间和结束获取公司报表账户的列表 -->

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAgentSumService.java

@@ -16,7 +16,7 @@ public interface IKuaishouReportDailyAgentSumService extends IService<KuaishouRe
     List<KuaishouReportDailyAgentSum> companyReport(String startDate, String endDate);
     KuaishouReportDailyAgentSum companyReportSum(String startDate, String endDate);
 
-    List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date, String advertiserName);
+    List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date, String advertiserName, Integer isExportNullData);
 
     List<KuaishouReportDailyAgent> companyReportAccountDetailListByDateRange(String startDate, String endDate);
 }

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentSumServiceImpl.java

@@ -35,8 +35,8 @@ public class KuaishouReportDailyAgentSumServiceImpl extends ServiceImpl<Kuaishou
 
     //公司报表详情
     @Override
-    public List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date, String advertiserName){
-        return kuaishouReportDailyAgentSumMapper.companyReportAccountDetailList(date, advertiserName);
+    public List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date, String advertiserName, Integer isExportNullData){
+        return kuaishouReportDailyAgentSumMapper.companyReportAccountDetailList(date, advertiserName, isExportNullData);
     }
 
     //公司报表详情