浏览代码

修改报表工具逻辑

syh 5 年之前
父节点
当前提交
821e577917

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/PlatformCampaignStatisticInfoMapper.java

@@ -17,4 +17,6 @@ public interface PlatformCampaignStatisticInfoMapper extends BaseMapper<Platform
     List<StatisticCampaignVo> getVoByParams(@Param("statisticDate") String statisticDate, @Param("accountId") Long accountId);
 
     StatisticCampaignVo getTotalStatisticVoByparams(@Param("statisticDate") String statisticDate, @Param("accountId") Long accountId);
+
+    List<StatisticCampaignVo> sumZeroVoByParams(@Param("statisticDate") String statisticDate, @Param("accountId") Long accountId);
 }

+ 23 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReportServiceImpl.java

@@ -11,6 +11,7 @@ import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.ibatis.annotations.Param;
 import org.apache.poi.hssf.usermodel.HSSFDataFormat;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
@@ -258,12 +259,22 @@ public class ReportServiceImpl implements IReportService {
         int index;
         for (index = 1; index < statisticCampaign1Vos.size() + 1; index++) {
             StatisticCampaignVo vo = statisticCampaign1Vos.get(index - 1);
-            System.out.println(vo.toString());
             String content = vo.getContent();
             String[] contents = content.split("-");
             Row row = xssfSheet.getRow(index);
             setExcelRow(numbericCellStyle, vo, contents, row, "single");
         }
+        List<StatisticCampaignVo> zero1Vos = statisticInfoMapper.sumZeroVoByParams(date, accountId1);
+        if (null != zero1Vos && zero1Vos.size() > 0) {
+            for (int z = 0; z < zero1Vos.size(); z++) {
+                index++;
+                StatisticCampaignVo vo = statisticCampaign1Vos.get(z);
+                Row row = xssfSheet.getRow(index);
+                String content = vo.getContent();
+                String[] contents = content.split("-");
+                setExcelRow(numbericCellStyle, vo, contents, row, "single");
+            }
+        }
         Row totalRow1 = xssfSheet.getRow(index);
         StatisticCampaignVo total = statisticInfoMapper.getTotalStatisticVoByparams(date, accountId1);
         if (null != total) {
@@ -273,12 +284,22 @@ public class ReportServiceImpl implements IReportService {
         for (int j = 0; j < statisticCampaign4Vos.size(); j++) {
             index++;
             StatisticCampaignVo vo = statisticCampaign4Vos.get(j);
-            System.out.println(vo.toString());
             String content = vo.getContent();
             String[] contents = content.split("-");
             Row row = xssfSheet.getRow(index);
             setExcelRow(numbericCellStyle, vo, contents, row, "single");
         }
+        List<StatisticCampaignVo> zero4Vos = statisticInfoMapper.sumZeroVoByParams(date, accountId4);
+        if (null != zero4Vos && zero4Vos.size() > 0) {
+            for (int z = 0; z < zero1Vos.size(); z++) {
+                index++;
+                StatisticCampaignVo vo = statisticCampaign1Vos.get(z);
+                Row row = xssfSheet.getRow(index);
+                String content = vo.getContent();
+                String[] contents = content.split("-");
+                setExcelRow(numbericCellStyle, vo, contents, row, "single");
+            }
+        }
         index++;
         Row totalRow4 = xssfSheet.getRow(index);
         StatisticCampaignVo total1 = statisticInfoMapper.getTotalStatisticVoByparams(date, accountId4);