Explorar o código

头条 下载结算单,日期参数变更

zhaoxian %!s(int64=2) %!d(string=hai) anos
pai
achega
206f29d018

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/ICreateSheetService.java

@@ -12,7 +12,7 @@ import java.util.List;
  */
 public interface ICreateSheetService {
 
-    void createBytedance(HSSFWorkbook wb, HSSFCellStyle style, List<String> accountIdList, String uploadYears);
+    void createBytedance(HSSFWorkbook wb, HSSFCellStyle style, List<String> accountIdList, String startTime, String endTime);
 
     void createKuaiShou(HSSFWorkbook wb, HSSFCellStyle style, List<String> accountIdList, String startTime, String endTime);
 }

+ 19 - 19
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/impl/CreateSheetServiceImpl.java

@@ -1,28 +1,28 @@
 package org.jeecg.ctop.finance.policy.service.impl;
 
-import cn.com.ctop.common.module.mapper.SysUserMapper;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.util.CellRangeAddress;
-import org.jeecg.common.system.entity.SysUser;
-import org.jeecg.ctop.finance.policy.entity.CwjsPolicyInfo;
-import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyInfoMapper;
 import org.jeecg.ctop.finance.policy.service.ICreateSheetService;
-import org.jeecg.ctop.finance.policy.service.ICwjsPolicyInfoService;
 import org.jeecg.ctop.finance.policy.utils.Check;
-import org.jeecg.ctop.finance.settlement.entity.vo.*;
+import org.jeecg.ctop.finance.settlement.entity.vo.SheetBytedanceVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SheetKuaiShouVo;
 import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
 import org.jeecg.ctop.finance.utils.SettlementUtil;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -37,7 +37,7 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
     private ReportSettlementMapper reportSettlementMapper;
 
 
-    public void createBytedance(HSSFWorkbook wb, HSSFCellStyle style, List<String> accountIdList, String uploadYears) {
+    public void createBytedance(HSSFWorkbook wb, HSSFCellStyle style, List<String> accountIdList, String startTime, String endTime) {
         DecimalFormat sf = new DecimalFormat("#.####");//保留四位小数
         //2:创建sheet 设置sheet名称
         HSSFSheet sheet = wb.createSheet("汇总页");
@@ -45,7 +45,7 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
         HSSFRow row0 = sheet.createRow(0);
         HSSFCell cell0 = row0.createCell(0);
         //设置 第一行 表头
-        cell0.setCellValue(uploadYears + "-头条结算单汇总");
+        cell0.setCellValue(startTime + "~" + endTime + "-头条结算单汇总");
         CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
         sheet.addMergedRegion(region);//合并行
         cell0.setCellStyle(style);
@@ -117,9 +117,9 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
         sheet.autoSizeColumn(0, true);
         List<SheetBytedanceVo> resultList = new ArrayList<>(accountIdList.size());
         //获取当前年月的 第一天 和 最后一天
-        Map<String, String> timeMap = SettlementUtil.getFirstAndLastDayOfMonth(uploadYears);
+//        Map<String, String> timeMap = SettlementUtil.getFirstAndLastDayOfMonth(uploadYears);
         //查看账户数据
-        List<Map<String, Object>> list = reportSettlementMapper.getAccountTransactionDayBytedanceSheet(accountIdList, uploadYears);
+        List<Map<String, Object>> list = reportSettlementMapper.getAccountTransactionDayBytedanceSheet(accountIdList, startTime, endTime);
         for (Map<String, Object> map : list) {
             SheetBytedanceVo voSource = new SheetBytedanceVo();
             voSource.setAgentId(map.get("agentId") + "");
@@ -131,7 +131,7 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
             List<String> policyDaysList = new ArrayList<>();
             if (!Check.isNull(map.get("productName"))) {
                 //查询 头条利润表  返点类型和比列
-                List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName") + "", map.get("productName") + "", null, "1", timeMap.get("startTime"), timeMap.get("endTime"));
+                List<Map<String, Object>> rateMap = reportSettlementMapper.getProfitBytedance(map.get("advertiserName") + "", map.get("productName") + "", null, "1", startTime, endTime);
                 List listPolicyTIme = new ArrayList();
                 for (Map<String, Object> rate : rateMap) {
                     listPolicyTIme.add(rate.get("policyStartDate"));
@@ -188,7 +188,7 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
 
             //不使用政策 的时间段
             // 获取两个日期之间 所有的 时间 年-月-日
-            List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(timeMap.get("startTime"), timeMap.get("endTime"));
+            List<String> betweenDaysList = SettlementUtil.getAllDatesOfTwoTimes(startTime, endTime);
             // 时间差集(所有时间段 - 使用政策的时间段)
             List<String> reduceList = betweenDaysList.stream().filter(item -> !policyDaysList.contains(item)).collect(Collectors.toList());
             //差集拼接  开始 和 结束时间
@@ -224,7 +224,7 @@ public class CreateSheetServiceImpl implements ICreateSheetService {
             sheet.autoSizeColumn(0, true);
             sheet.autoSizeColumn(i + 1, true);
             //创建单元格并且添加数据
-            row.createCell(0).setCellValue(uploadYears);
+            row.createCell(0).setCellValue(startTime + "~" + endTime);
             row.createCell(1).setCellValue(vo.getAccountName());
             row.createCell(2).setCellValue(vo.getAccountId());
             row.createCell(3).setCellValue(vo.getAgentName());

+ 2 - 2
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java

@@ -38,9 +38,9 @@ public class ExportReportController {
     @GetMapping(value = "/settlementReportBytedance")
     public Result settlementReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) throws Exception {
         SysUser user = userService.getById(paramsVo.getUserId());
-        String date = paramsVo.getUploadYears();
+        String date = paramsVo.getStartTime();
         if (null == date || date.equals("")) {
-            paramsVo.setUploadYears(DateUtils.formatDate(new Date(), "yyyy-MM"));
+            return Result.errorMsg("请选择日期");
         }
         return reportSettlementService.settlementReportBytedance(paramsVo, response, user);
     }

+ 28 - 50
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java

@@ -12,9 +12,7 @@ import java.util.Set;
 
 
 /**
- *
  * @description:
- *
  * @return:
  * @author: zianY
  * @time: 2021/7/28 17:07
@@ -22,106 +20,86 @@ import java.util.Set;
 public interface ReportSettlementMapper {
 
     /**
-     *获取头条 账户 日流水信息 根据账户id 和 年月 查询数据
-     * @param
-     * @return
+     * 获取头条 账户 日流水信息 根据账户id 和 年月 查询数据
      */
     List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance(SettlementFileParamsVo paramsVo);
 
-    List<Map<String,Object>> getAccountTransactionDayBytedanceSheet(@Param("accountIds") List<String> accountIds, @Param("uploadYears")String uploadYears);
-
-
-
-
+    List<Map<String, Object>> getAccountTransactionDayBytedanceSheet(@Param("accountIds") List<String> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     /**
      * 获取快手 账户 日流水信息 根据账户id 和 年月 查询数据
-     * @param paramsVo
-     * @return
      */
     List<SettlementReportKuaiShouVo> getAccountTransactionDayKuaiShou(SettlementFileParamsVo paramsVo);
+
     //获取快手 账户 日流水信息  代理商维度
     List<SettlementReportKuaiShouVo> getAccountTransactionDayKuaiShouAgent(SettlementFileParamsVo paramsVo);
+
     // 获取快手 结算单 账户 和 代理商 维度
     List<SettlementReportKuaiShouVo> getTransactionDayKuaiShouAgentAndAccount(SettlementFileParamsVo paramsVo);
 
-    List<SheetKuaiShouVo> getTransactionDayKuaiShouSheet(@Param("accountId")String accountId, @Param("startTime")String startTime , @Param("endTime")String endTime);
-
+    List<SheetKuaiShouVo> getTransactionDayKuaiShouSheet(@Param("accountId") String accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 
     /**
      * 查询 账户id
-     * @return
      */
-   List<String> getAccountIdBytedance(@Param("sales") Set<String> sales, @Param("mediaId")String mediaId, @Param("advertiserId")String advertiserId, @Param("productId")String productId,@Param("projectId")String projectId);
-   List<String> getAccountIdBytedanceRepeat(@Param("accountIds") List<String> accountIds,@Param("uploadYears")String uploadYears);
-   List<String> getAccountIdKuaiShouRepeat(@Param("accountIds") List<String> accountIds,@Param("uploadYears")String uploadYears);
+    List<String> getAccountIdBytedance(@Param("sales") Set<String> sales, @Param("mediaId") String mediaId, @Param("advertiserId") String advertiserId, @Param("productId") String productId, @Param("projectId") String projectId);
+
+    List<String> getAccountIdBytedanceRepeat(@Param("accountIds") List<String> accountIds, @Param("uploadYears") String uploadYears);
+
+    List<String> getAccountIdKuaiShouRepeat(@Param("accountIds") List<String> accountIds, @Param("uploadYears") String uploadYears);
 
     /**
      * 查询 头条 账户 图片
-     * @param accountId
-     * @return
      */
-   List<String> getAccountImagesBytedance(@Param("accountId") String accountId,@Param("time")String time);
+    List<String> getAccountImagesBytedance(@Param("accountId") String accountId, @Param("time") String time);
 
 
     /**
      * 查询 头条利润表 总花费
-     * @return
      */
-    List<Map<String,Object>> getProfitBytedanceAccount(@Param("startTime") String startTime,@Param("endTime") String endTime);
-    Map<String,Object> getProfitBytedanceAccountCost(@Param("accountId") String accountId,@Param("startTime") String startTime,@Param("endTime") String endTime);
+    List<Map<String, Object>> getProfitBytedanceAccount(@Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    Map<String, Object> getProfitBytedanceAccountCost(@Param("accountId") String accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<Map<String,Object>> getProfitBytedanceCost(@Param("accountId") String accountId,@Param("startTime") String startTime,@Param("endTime") String endTime);
+    List<Map<String, Object>> getProfitBytedanceCost(@Param("accountId") String accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     /**
      * 查询 快手 利润表 所有账户
-     * @param
-     * @return
      */
-    List<Map<String,Object>> getProfitKuaiShouAgentAccount(@Param("startTime")String startTime ,@Param("endTime")String endTime);
-    Map<String,Object> getProfitKuaiShouAccountCost(@Param("accountId")String accountId,@Param("startTime")String startTime ,@Param("endTime")String endTime);
-    List<Map<String,Object>> getProfitKuaiShouAccountCostSheet(@Param("accountIds")List<String> accountIds,@Param("startTime")String startTime ,@Param("endTime")String endTime);
-    //快手 利润表 账户 时间段内的数据信息
-    List<Map<String,Object>> getProfitKuaiShouCost(@Param("accountId")String accountId,@Param("startTime")String startTime ,@Param("endTime")String endTime);
+    List<Map<String, Object>> getProfitKuaiShouAgentAccount(@Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    Map<String, Object> getProfitKuaiShouAccountCost(@Param("accountId") String accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    List<Map<String, Object>> getProfitKuaiShouAccountCostSheet(@Param("accountIds") List<String> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    //快手 利润表 账户 时间段内的数据信息
+    List<Map<String, Object>> getProfitKuaiShouCost(@Param("accountId") String accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 
     /**
      * 查询 头条利润表  返点类型和比列
-     * @param
-     * @return
      */
-    List<Map<String,Object>> getProfitBytedance(@Param("advertiserName") String advertiserName,@Param("productName") String productName,@Param("saleId") String saleId,@Param("mediaType") String mediaType,@Param("startTime")String startTime,@Param("endTime")String endTime);
-
-    Map<String,Object> getProfitRebate(@Param("advertiserName") String advertiserName,@Param("productName") String productName,@Param("saleId") String saleId,@Param("mediaType") String mediaType,@Param("startTime")String startTime,@Param("endTime")String endTime);
-
-    Map<String,Object> getProfitReportSale(String accountId);
-
-    Map<String,Object> getProfitBytedanceOperate(String accountId);
-
-    Map<String,Object> getProfitReportOperateAndArea(String accountId);
-
+    List<Map<String, Object>> getProfitBytedance(@Param("advertiserName") String advertiserName, @Param("productName") String productName, @Param("saleId") String saleId, @Param("mediaType") String mediaType, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    Map<String, Object> getProfitRebate(@Param("advertiserName") String advertiserName, @Param("productName") String productName, @Param("saleId") String saleId, @Param("mediaType") String mediaType, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    Map<String, Object> getProfitReportSale(String accountId);
 
+    Map<String, Object> getProfitBytedanceOperate(String accountId);
 
+    Map<String, Object> getProfitReportOperateAndArea(String accountId);
 
 
     /**
      * 查询 所有已绑定用户的运营人员id
-     * @return
      */
-    List<Map<String,Object>> getAccountOperateUserId();
+    List<Map<String, Object>> getAccountOperateUserId();
 
     /**
      * 查询运营人员 绑定的账户 以及产品
-     * @return
      */
-    List<Map<String,Object>> getAccountAndProductByOperate(String userId);
-
-
+    List<Map<String, Object>> getAccountAndProductByOperate(String userId);
 
 
 }

+ 35 - 33
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -6,38 +6,41 @@
     <select id="getAccountTransactionDayBytedance"
             resultType="org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo">
         select t.*, c.auth_name as accountName
-        from (select id,
-                     advertiser_id,
-                  date, DATE_FORMAT(date, '%Y-%m') as uploadYears,
-                  balance, cash_cost, cost, frozen, income, reward_cost, shared_wallet_cost, transfer_in, transfer_out, create_time,
-                  (
-                  SELECT
-                  DISTINCT ag.agent_id
-                  from
-                  ctop_cwjs_agent_info ag
-                  LEFT JOIN ctop_agent_account ac on ag.agent_id = ac.agent_id
-                  where ag.`status` = 0
-                  and ag.enabled = 0
-                  and ac.account_id =
-                     #{accountId} limit 1) as agentId,
-                  (
-                  SELECT
-                  DISTINCT ag.name
-                  from
-                  ctop_cwjs_agent_info ag
-                  LEFT JOIN ctop_agent_account ac on ag.agent_id = ac.agent_id
-                  where ag.`status` = 0
-                  and ag.enabled = 0
-                  and ac.account_id =
-                     #{accountId} limit 1) as agentName
-              from
-                  ctop_account_transaction_day
-              where cost
-                  >0
-                and advertiser_id = #{accountId}
+        from (
+                 select id,
+                        advertiser_id,
+                     date,
+                     DATE_FORMAT(date, '%Y-%m') as uploadYears,
+                     balance, cash_cost, cost, frozen, income, reward_cost, shared_wallet_cost, transfer_in, transfer_out, create_time,
+                     (
+                     SELECT
+                     DISTINCT ag.agent_id
+                     from
+                     ctop_cwjs_agent_info ag
+                     LEFT JOIN ctop_agent_account ac on ag.agent_id = ac.agent_id
+                     where ag.`status` = 0
+                     and ag.enabled = 0
+                     and ac.account_id =
+                        #{accountId} limit 1) as agentId,
+                     (
+                     SELECT
+                     DISTINCT ag.name
+                     from
+                     ctop_cwjs_agent_info ag
+                     LEFT JOIN ctop_agent_account ac on ag.agent_id = ac.agent_id
+                     where ag.`status` = 0
+                     and ag.enabled = 0
+                     and ac.account_id =
+                        #{accountId} limit 1) as agentName
+                 from
+                     ctop_account_transaction_day
+                 where cost
+                     >0
+                   and advertiser_id = #{accountId}
              ) t
                  LEFT JOIN ctop_user_allocation c on t.advertiser_id = c.account_id
-        where uploadYears = #{uploadYears}
+        where date >= #{startTime}
+          AND date &lt;= #{endTime}
         ORDER BY date
     </select>
     <!-- 获取头条 账户 日流水信息 汇总页数据 -->
@@ -63,8 +66,6 @@
         productId,
         (SELECT pd.product_name from ctop_project pr, ctop_product pd WHERE ua.project_id = pr.id and pr.product_id =
         pd.id) productName
-
-
         FROM
         ctop_account_transaction_day t
         LEFT JOIN (SELECT DISTINCT account_id,agent_id from ctop_agent_account where 1 = 1
@@ -80,7 +81,8 @@
         LEFT JOIN ctop_user_allocation ua on ua.account_id = t.advertiser_id
         WHERE
         t.cost > 0
-        AND DATE_FORMAT( t.date, '%Y-%m' ) = #{uploadYears}
+        AND t.date >= #{startTime}
+        AND t.date &lt;= #{endTime}
         <if test='accountIds != null and accountIds.size() > 0'>
             AND t.advertiser_id in
             <foreach collection="accountIds" item="item" separator=","

+ 36 - 17
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java

@@ -5,24 +5,32 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.ImportParams;
 import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
-import cn.com.ctop.common.module.entity.SysLog;
 import cn.com.ctop.common.module.entity.UserAllocation;
-import cn.com.ctop.common.module.mapper.*;
+import cn.com.ctop.common.module.mapper.MailLogMapper;
+import cn.com.ctop.common.module.mapper.SysLogMapper;
+import cn.com.ctop.common.module.mapper.SysRoleMapper;
+import cn.com.ctop.common.module.mapper.SysUserMapper;
+import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
-import cn.com.ctop.common.module.utils.ImageUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.google.gson.JsonObject;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+import org.apache.poi.hssf.usermodel.HSSFDataFormat;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.ClientAnchor;
 import org.apache.poi.ss.usermodel.HorizontalAlignment;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.entity.SysUser;
-import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.ctop.finance.policy.entity.CwjsCompanySubject;
 import org.jeecg.ctop.finance.policy.entity.CwjsPolicyApprovalLog;
@@ -35,12 +43,15 @@ import org.jeecg.ctop.finance.policy.mapper.CwjsPolicyProductMapper;
 import org.jeecg.ctop.finance.policy.service.ICreateSheetService;
 import org.jeecg.ctop.finance.policy.service.impl.CwjsSaleAssistantInfoServiceImpl;
 import org.jeecg.ctop.finance.policy.utils.Check;
-import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
 import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSlettementReport;
-import org.jeecg.ctop.finance.settlement.entity.vo.*;
+import org.jeecg.ctop.finance.settlement.entity.vo.PolicyImportVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.ProfitReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.ProfitReportKuaiShouVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
 import org.jeecg.ctop.finance.settlement.mapper.CwjsProfitMapper;
 import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
-import org.jeecg.ctop.finance.settlement.mapper.SettlementInfoMapper;
 import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
 import org.jeecg.ctop.finance.utils.SettlementUtil;
 import org.jeecg.ctop.finance.utils.createExcelByTemplate;
@@ -53,17 +64,25 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletResponse;
-import javax.swing.*;
 import java.awt.*;
 import java.awt.image.BufferedImage;
-import java.io.*;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
 import java.net.URL;
 import java.net.URLEncoder;
 import java.text.MessageFormat;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 
@@ -130,7 +149,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
 
 
             //设置第一个sheet页 汇总页
-            createSheetService.createBytedance(wb, style, accountIdList, paramsVo.getUploadYears());
+            createSheetService.createBytedance(wb, style, accountIdList, paramsVo.getStartTime(), paramsVo.getEndTime());
 
 
             for (int k = 0; k < accountIdList.size(); k++) {
@@ -154,7 +173,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                 HSSFRow row0 = sheet.createRow(0);
                 HSSFCell cell0 = row0.createCell(0);
                 //设置 第一行 表头
-                cell0.setCellValue(paramsVo.getUploadYears() + "-头条结算单");
+                cell0.setCellValue(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-头条结算单");
                 CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
                 sheet.addMergedRegion(region);//合并行
                 cell0.setCellStyle(style);
@@ -238,7 +257,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                 }
 
                 //查询 图片 url
-                List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId, paramsVo.getUploadYears());
+                List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId, paramsVo.getEndTime());
 
                 if (!Check.isNull(imageUrlList)) {
                     for (int j = 0; j < imageUrlList.size(); j++) {
@@ -276,7 +295,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
             response.setHeader("Pragma", "no-cache");
             response.setHeader("Cache-Control", "no-cache");
             response.setDateHeader("Expires", 0);
-            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getUploadYears() + "-头条结算单.xlsx", "UTF-8"));
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getStartTime() + "~" + paramsVo.getEndTime() + "-头条结算单.xlsx", "UTF-8"));
             OutputStream output = response.getOutputStream();
             BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
             wb.write(bufferedOutPut);