浏览代码

Merge branch 'master' into yumeng

yumeng 3 年之前
父节点
当前提交
4e32115f68
共有 18 个文件被更改,包括 3334 次插入570 次删除
  1. 3 3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 2 2
      jeecg-boot-material-view/pom.xml
  3. 1 2
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/JeecgBootMaterialApplication.java
  4. 1321 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/AccountReportConstants.java
  5. 66 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/Check.java
  6. 96 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/CtopAdConstant.java
  7. 331 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/ExportExcelUtils.java
  8. 936 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/HttpUtils.java
  9. 122 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/JsonResourceUtil.java
  10. 3 4
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/MaterialReportOverViewV2Controller.java
  11. 20 15
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialReportOverViewV3Mapper.java
  12. 312 335
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialReportOverViewV3Mapper.xml
  13. 1 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/IMaterialReportOverViewV2Service.java
  14. 55 46
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialReportOverViewV2ServiceImpl.java
  15. 1 1
      jeecg-boot-material-view/src/main/resources/application-dev.yml
  16. 2 2
      jeecg-boot-material-view/src/main/resources/application-prod.yml
  17. 49 146
      jeecg-boot-material-view/src/main/resources/application-test.yml
  18. 13 13
      jeecg-boot-module-system/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

+ 3 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -114,9 +114,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
         filterChainDefinitionMap.put("/dimension/report/*", "anon");
         filterChainDefinitionMap.put("/dimension/report/*", "anon");
         filterChainDefinitionMap.put("/userAllocation/updateAuthName", "anon");
         filterChainDefinitionMap.put("/userAllocation/updateAuthName", "anon");
-        filterChainDefinitionMap.put("/account/report/**", "anon");
-       /* filterChainDefinitionMap.put("/account/report/kuaishou/list", "anon");
-        filterChainDefinitionMap.put("/account/report/kuaishou/chart", "anon");*/
+        filterChainDefinitionMap.put("/account/report/getProjectAccountByUserId", "anon");
+        filterChainDefinitionMap.put("/account/report/kuaishou/list", "anon");
+        filterChainDefinitionMap.put("/account/report/kuaishou/chart", "anon");
         filterChainDefinitionMap.put("/material/report/getProjectAccountByUserId", "anon");
         filterChainDefinitionMap.put("/material/report/getProjectAccountByUserId", "anon");
         filterChainDefinitionMap.put("/material/report/kuaishou/list", "anon");
         filterChainDefinitionMap.put("/material/report/kuaishou/list", "anon");
         filterChainDefinitionMap.put("/material/report/kuaishou/detail", "anon");
         filterChainDefinitionMap.put("/material/report/kuaishou/detail", "anon");

+ 2 - 2
jeecg-boot-material-view/pom.xml

@@ -68,10 +68,10 @@
             <version>3.15</version>
             <version>3.15</version>
         </dependency>
         </dependency>
 
 
-        <dependency>
+      <!--  <dependency>
             <groupId>org.jeecgframework.boot</groupId>
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>jeecg-boot-module-system</artifactId>
             <artifactId>jeecg-boot-module-system</artifactId>
-        </dependency>
+        </dependency>-->
 
 
 
 
 
 

+ 1 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/JeecgBootMaterialApplication.java

@@ -1,6 +1,6 @@
 package org.jeecg.ctop.material;
 package org.jeecg.ctop.material;
 
 
-import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
+
 import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
 import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
 import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
 import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
 import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
 import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
@@ -10,7 +10,6 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 
 @SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
 @SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
-@EnableDubbo
 @ComponentScan(basePackages = {"org.jeecg", "cn.com.ctop"})
 @ComponentScan(basePackages = {"org.jeecg", "cn.com.ctop"})
 @EnableTransactionManagement
 @EnableTransactionManagement
 public class JeecgBootMaterialApplication {
 public class JeecgBootMaterialApplication {

文件差异内容过多而无法显示
+ 1321 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/AccountReportConstants.java


+ 66 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/Check.java

@@ -0,0 +1,66 @@
+package org.jeecg.ctop.material.constants;
+
+import com.alibaba.fastjson.JSONArray;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+public class Check {
+    private Check() {
+    }
+
+    public static boolean isNull(List<?> list) {
+        return list == null || list.isEmpty();
+    }
+
+    public static boolean isNull(Long l) {
+        return l == null || l == 0;
+    }
+
+    public static boolean isNull(Collection<?> collection) {
+        return collection == null || collection.isEmpty();
+    }
+
+    public static boolean isNull(JSONArray jsonArray) {
+        return jsonArray == null || jsonArray.isEmpty();
+    }
+
+
+    public static boolean isNull(String str) {
+        return str == null || str.isEmpty();
+    }
+
+    public static boolean isNull(byte[] bytes) {
+        return bytes == null || bytes.length == 0;
+    }
+
+    public static boolean hasNull(Object... objects) {
+        for (Object obj : objects) {
+            if (obj == null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean allEmpty(String... strs) {
+        for (String str : strs) {
+            if (StringUtils.isNotEmpty(str)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean isNull(Object object) {
+        return object == null;
+    }
+
+    public static boolean isNullMap(Map<?, ?> map) {
+        return map == null || map.isEmpty();
+    }
+}

+ 96 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/CtopAdConstant.java

@@ -0,0 +1,96 @@
+package org.jeecg.ctop.material.constants;
+
+import java.math.BigDecimal;
+
+/**
+ * 广告相关常量数据
+ */
+public class CtopAdConstant {
+    //头条
+    public static final String PLATFORM_TYPE_BYTEDANCE = "1";
+    public static final  int PLATFORM_TYPE_BYTEDANCE_INT = 1;
+    //快手
+    public static final String PLATFORM_TYPE_KUAISHOU = "2";
+    public static final  int   PLATFORM_TYPE_KUAISHOU_INT = 2;
+    //头条内广
+    public static final String PLATFORM_TYPE_BYTEDANCE_INSIDE = "3";
+    public static final  int PLATFORM_TYPE_BYTEDANCE_INSIDE_INT = 3;
+    //头条内广
+    public static final String PLATFORM_TYPE_KUAISHOU_INSIDE = "4";
+    public static final  int PLATFORM_TYPE_KUAISHOU_INSIDE_INT = 4;
+
+    public static final String PLATFORM_TYPE_PANGOLIN = "5";
+
+    public static final String PLATFORM_TYPE_BYTEDANCE_PY = "bytedance";
+    public static final String PLATFORM_TYPE_KUAISHOU_PY = "kuaishou";
+    public static final String PLATFORM_TYPE_PANGOLIN_PY = "pangolin";
+
+    public static final String BYTEDANCE_REPORT_TYPE_DAILY = "STAT_TIME_GRANULARITY_DAILY";
+    public static final String BYTEDANCE_REPORT_TYPE_HOURLY = "STAT_TIME_GRANULARITY_HOURLY";
+
+    public static final String UREPORT_PREVIEW_URL_PREFIX = "/jeecg-boot/ureport/designer?_u=mysql:";
+
+
+    public static final String CTOP_ORGCODE_NORTH_CHINA_PREFIX = "A01";
+    public static final String CTOP_ORGCODE_EAST_CHINA_PREFIX = "A02";
+
+    public static final String KUAISHOU_LOAD_JOB_TYPE_HISTORY = "history";
+    public static final String KUAISHOU_LOAD_JOB_TYPE_DAILY = "daily";
+
+    public static final String BYTEDANCE_LOAD_JOB_TYPE_ASYNC = "async";
+    public static final String BYTEDANCE_LOAD_JOB_TYPE_DAILY = "daily";
+
+    /**
+     * 销售角色Id
+     */
+    public static final String SYSTEM_SALE_CODE = "75ee837e6f3de29c0e3ed75d4629438e";
+
+    /**
+     * 销售AM角色Id
+     */
+    public static final String SYSTEM_SALE_AM_CODE = "f5a68aa2acf86e842100f0fa4b050d28";
+
+    /**
+     * 头条销售媒体季度任务
+     */
+    public static final BigDecimal BYTEDANCE_MEDIA_TASK_COST = new BigDecimal("150000000");
+    /**
+     * 快手销售媒体季度任务
+     */
+    public static final BigDecimal KUAISHOU_MEDIA_TASK_COST = new BigDecimal("147000000");
+    /**
+     * 头条销售季度个人任务
+     */
+    public static final BigDecimal BYTEDANCE_PERSONAL_TASK_COST = new BigDecimal("2400000");
+    /**
+     * 快手销售季度个人任务
+     */
+    public static final BigDecimal KUAISHOU_PERSONAL_TASK_COST = new BigDecimal("2400000");
+
+    /**
+     * 华北快手销售机构号
+     */
+    public static final String HB_KUAISHOU_SALE_ORG_CODE = "A01A11A01";
+    /**
+     * 华北头条销售机构号
+     */
+    public static final String HB_BYTEDANCE_SALE_ORG_CODE = "A01A11A02";
+
+    public static final String BYTEDANCE_GENDER_TYPE_NONE = "NONE";
+    public static final String BYTEDANCE_GENDER_TYPE_GENDER_MALE = "GENDER_MALE";
+    public static final String BYTEDANCE_GENDER_TYPE_GENDER_FEMALE = "GENDER_FEMALE";
+
+
+    public static final Integer COMMON_STATUS_ENABLED = 1;
+
+    public static final Integer COMMON_STATUS_NOT_ENABLED = 0;
+
+    public static final String COMMON_ORDER_TYPE_ASC = "asc";
+    public static final String COMMON_ORDER_TYPE_DESC = "desc";
+
+    /**
+     * 视频类型
+     */
+    public static final String VIDEO_TYPR_ZR = "真人";
+    public static final String VIDEO_TYPR_ZZ = "制作";
+}

+ 331 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/ExportExcelUtils.java

@@ -0,0 +1,331 @@
+package org.jeecg.ctop.material.constants;
+
+
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+public class ExportExcelUtils {
+
+
+    /**
+     * @param workbook
+     * @param sheetNum   (sheet的位置,0表示第一个表格中的第一个sheet)
+     * @param sheetTitle (sheet的名称)
+     * @param headers    (表格的标题)
+     * @param result     (表格的数据)
+     * @return
+     * @throws Exception
+     * @Title: exportExcel
+     * @Description: 导出Excel的方法
+     */
+
+    public void exportExcel(XSSFWorkbook workbook, int sheetNum,
+                            String sheetTitle, String[] headers, List<List<Object>> result) {
+        // 生成一个表格
+        XSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        XSSFCellStyle style = workbook.createCellStyle();
+        // 设置这些样式
+        style.setFillForegroundColor(IndexedColors.PALE_BLUE.index);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style.setBorderBottom(BorderStyle.THIN);
+        style.setBorderLeft(BorderStyle.THIN);
+        style.setBorderRight(BorderStyle.THIN);
+        style.setBorderTop(BorderStyle.THIN);
+        // style.setAlignment(HorizontalAlignment.CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
+        // 生成一个字体
+        XSSFFont font = workbook.createFont();
+        font.setColor(IndexedColors.BLACK.index);
+        font.setFontHeightInPoints((short) 12);
+        font.setBold(true);
+        // 把字体应用到当前的样式
+        style.setFont(font);
+
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+
+        // 产生表格标题行
+        XSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            XSSFCell cell = row.createCell((short) i);
+            cell.setCellStyle(style);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<Object> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+                for (Object obj : m) {
+                    XSSFCell cell = row.createCell((short) cellIndex);
+                    if (!Check.isNull(obj)) {
+                        if (obj instanceof String) {
+                            cell.setCellValue((String) obj);
+                        } else if (obj instanceof Double) {
+                            cell.setCellValue((Double) obj);
+                        } else if (obj instanceof BigDecimal) {
+                            BigDecimal bigDecimal = (BigDecimal) obj;
+                            cell.setCellValue(bigDecimal.doubleValue());
+                        } else if (obj instanceof Long) {
+                            cell.setCellValue(String.valueOf(obj));
+                        } else {
+                            cell.setCellValue(obj.toString());
+                        }
+                    } else {
+                        cell.setCellValue(0);
+                    }
+
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
+
+
+    public void exportExcelForAttendance(XSSFWorkbook workbook, int sheetNum, String sheetTitle, String[] headers, List<List<Object>> result) {
+        // 生成一个表格
+        XSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        XSSFCellStyle style = workbook.createCellStyle();
+        XSSFCellStyle style2 = workbook.createCellStyle();
+        XSSFCellStyle style3 = workbook.createCellStyle();
+        // 设置这些样式
+        style.setFillForegroundColor(IndexedColors.PALE_BLUE.index);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style.setBorderBottom(BorderStyle.THIN);
+        style.setBorderLeft(BorderStyle.THIN);
+        style.setBorderRight(BorderStyle.THIN);
+        style.setBorderTop(BorderStyle.THIN);
+        // style.setAlignment(HorizontalAlignment.CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
+        // 生成一个字体
+        XSSFFont font = workbook.createFont();
+        font.setColor(IndexedColors.BLACK.index);
+        font.setFontHeightInPoints((short) 12);
+        font.setBold(true);
+        // 把字体应用到当前的样式
+        style.setFont(font);
+
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+        //迟到时间超过15分钟的考勤记录样式(标黄)
+        style2.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.index);
+        style2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style2.setBorderBottom(BorderStyle.THIN);
+        style2.setBorderLeft(BorderStyle.THIN);
+        style2.setBorderRight(BorderStyle.THIN);
+        style2.setBorderTop(BorderStyle.THIN);
+        // 产生表格标题行
+        XSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            XSSFCell cell = row.createCell((short) i);
+            cell.setCellStyle(style);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<Object> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+                //迟到时间超过15分钟的考勤记录判断
+                boolean changeColor = false;
+                if (m.contains("迟到")) {
+                    String duration = String.valueOf(m.get(m.size() - 2));
+                    if (!Check.isNull(duration) && Integer.valueOf(duration.replace(" min", "")) - 10 > 0) {
+                        changeColor = true;
+                    }
+                }
+                for (Object obj : m) {
+                    XSSFCell cell = row.createCell((short) cellIndex);
+                    if (!Check.isNull(obj)) {
+                        if (changeColor) {
+                            cell.setCellStyle(style2);
+                        }
+                        if (obj instanceof String) {
+                            cell.setCellValue((String) obj);
+                        } else if (obj instanceof Double) {
+                            cell.setCellValue((Double) obj);
+                        } else if (obj instanceof BigDecimal) {
+                            BigDecimal bigDecimal = (BigDecimal) obj;
+                            cell.setCellValue(bigDecimal.doubleValue());
+                        } else if (obj instanceof Long) {
+                            cell.setCellValue(String.valueOf(obj));
+                        } else {
+                            cell.setCellValue(obj.toString());
+                        }
+                    }
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
+
+    public void exportExcelForMediaReport(XSSFWorkbook workbook, int sheetNum, String sheetTitle, String[] headers, List<List<Object>> result) {
+        // 生成一个表格
+        XSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        sheet.setColumnWidth(0, 15 * 256);
+        sheet.setColumnWidth(1, 40 * 256);
+        sheet.setColumnWidth(2, 30 * 256);
+        sheet.setColumnWidth(3, 35 * 256);
+        sheet.setColumnWidth(4, 20 * 256);
+        sheet.setColumnWidth(5, 20 * 256);
+        sheet.setColumnWidth(6, 20 * 256);
+        sheet.setColumnWidth(7, 20 * 256);
+        sheet.setColumnWidth(8, 15 * 256);
+        // 生成一个样式
+        XSSFCellStyle style = workbook.createCellStyle();
+        // 设置这些样式
+        style.setFillForegroundColor(IndexedColors.PALE_BLUE.index);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style.setBorderBottom(BorderStyle.THIN);
+        style.setBorderLeft(BorderStyle.THIN);
+        style.setBorderRight(BorderStyle.THIN);
+        style.setBorderTop(BorderStyle.THIN);
+        // style.setAlignment(HorizontalAlignment.CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
+        // 生成一个字体
+        XSSFFont font = workbook.createFont();
+        font.setColor(IndexedColors.BLACK.index);
+        font.setFontHeightInPoints((short) 12);
+        font.setBold(true);
+        // 把字体应用到当前的样式
+        style.setFont(font);
+
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+
+        //同一行第一个cell
+        XSSFCellStyle cellStyle = workbook.createCellStyle();
+        cellStyle.setAlignment(HorizontalAlignment.CENTER);
+        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        cellStyle.setWrapText(true);
+
+        // 产生表格标题行
+        XSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            XSSFCell cell = row.createCell((short) i);
+            cell.setCellStyle(style);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<Object> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+
+                for (Object obj : m) {
+                    XSSFCell cell = row.createCell((short) cellIndex);
+                    if (!Check.isNull(obj)) {
+                        if (obj instanceof String) {
+                            cell.setCellValue((String) obj);
+                        } else if (obj instanceof Double) {
+                            cell.setCellValue((Double) obj);
+                        } else if (obj instanceof BigDecimal) {
+                            BigDecimal bigDecimal = (BigDecimal) obj;
+                            cell.setCellValue(bigDecimal.doubleValue());
+                        } else if (obj instanceof Long) {
+                            cell.setCellValue(String.valueOf(obj));
+                        } else {
+                            cell.setCellValue(obj.toString());
+                        }
+                    } else {
+                        cell.setCellValue(0);
+                    }
+                    cell.setCellStyle(cellStyle);
+
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
+
+    //发送响应流方法
+    public void putResponseHeader(HttpServletResponse response, String fileName) {
+        try {
+            try {
+                fileName = new String(fileName.getBytes(), "ISO8859-1");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+//            response.setContentType("multipart/form-data;charset=ISO8859-1");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+            response.addHeader("Pargam", "no-cache");
+            response.addHeader("Cache-Control", "no-cache");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public String getCellValue(Cell cell) {
+        String value = "";
+        if (cell != null) {
+            // 以下是判断数据的类型
+            switch (cell.getCellType()) {
+                case HSSFCell.CELL_TYPE_NUMERIC: // 数字
+                    value = cell.getNumericCellValue() + "";
+                    if (HSSFDateUtil.isCellDateFormatted(cell)) {
+                        Date date = cell.getDateCellValue();
+                        if (date != null) {
+                            value = new SimpleDateFormat("yyyy-MM-dd").format(date);
+                        } else {
+                            value = "";
+                        }
+                    } else {
+                        value = new DecimalFormat("0").format(cell.getNumericCellValue());
+                    }
+                    break;
+                case HSSFCell.CELL_TYPE_STRING: // 字符串
+                    value = cell.getStringCellValue();
+                    break;
+                case HSSFCell.CELL_TYPE_BOOLEAN: // Boolean
+                    value = cell.getBooleanCellValue() + "";
+                    break;
+                case HSSFCell.CELL_TYPE_FORMULA: // 公式
+                    value = cell.getCellFormula() + "";
+                    break;
+                case HSSFCell.CELL_TYPE_BLANK: // 空值
+                    value = "";
+                    break;
+                case HSSFCell.CELL_TYPE_ERROR: // 故障
+                    value = "非法字符";
+                    break;
+                default:
+                    value = "未知类型";
+                    break;
+            }
+        }
+        return value.trim();
+    }
+}

+ 936 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/HttpUtils.java

@@ -0,0 +1,936 @@
+package org.jeecg.ctop.material.constants;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.http.*;
+import org.apache.http.client.CookieStore;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.CookieSpecs;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.cookie.Cookie;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+
+import javax.net.ssl.SSLContext;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.*;
+
+/**
+ * @author 宋英豪
+ */
+@Slf4j
+public class HttpUtils {
+
+    //发送响应流方法
+    public static void setResponseHeader(HttpServletResponse response, String fileName) {
+        try {
+            fileName = new String(fileName.getBytes(), StandardCharsets.UTF_8);
+            //response.setContentType("application/octet-stream;charset=ISO8859-1");
+            response.setContentType("application/vnd.ms-excel;charset=gb2312");
+
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+            response.addHeader("Pargam", "no-cache");
+            response.addHeader("Cache-Control", "no-cache");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public static JSONObject bytedanceGetRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        httpEntity.setHeader("Access-Token", accessToken);
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    public static JSONObject bytedancePostRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpPost httpEntity = new HttpPost(url);
+        httpEntity.setHeader("Access-Token", accessToken);
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    public static CookieStore COOKIESTORE = new BasicCookieStore();
+    /**
+     * setProxy(new HttpHost("106.125.239.179", 4245))
+     */
+    public static Map<String, Map<String, String>> fontsMap = new HashMap<>();
+    public static String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36";
+
+    public static CloseableHttpClient createSslClientDefault() {
+        try {
+            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
+                //信任所有证书
+                @Override
+                public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+                    return true;
+                }
+            }).build();
+            RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
+            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
+            return HttpClients.custom().setDefaultCookieStore(COOKIESTORE).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
+        } catch (Exception e) {
+            log.error("处理Https证书异常", e);
+        }
+        return HttpClients.createDefault();
+    }
+
+    public static String httpPostFormRequest(String url, Map<String, Object> param, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            if (headers != null) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
+            if (param != null) {
+                for (String key : param.keySet()) {
+                    BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
+                    paramList.add(basicNameValuePair);
+                }
+                // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
+                UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
+                // 第一步:通过setEntity 将我们的entity对象传递过去
+                httppost.setEntity(formEntity);
+            }
+
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostFormRequest(newUrl, param, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String httpPostParamRequest(String url, Map<String, Object> param, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            if (headers != null) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
+            for (String key : param.keySet()) {
+                BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
+                paramList.add(basicNameValuePair);
+            }
+
+            // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
+            // 第一步:通过setEntity 将我们的entity对象传递过去
+            httppost.setEntity(formEntity);
+            httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostParamRequest(newUrl, param, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            httppost.addHeader("Content-Type", "application/json");
+            if (headers != null && headers.size() > 0) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+            if (param != null && param.size() > 0) {
+                httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
+            }
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(300 * 1000).setConnectTimeout(300 * 1000).build();
+            httppost.setConfig(requestConfig);
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostRequest(newUrl, param, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String httpPostNoParamRequest(String url) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            httppost.addHeader("Content-Type", "application/json");
+            HttpEntity respentity;
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostNoParamRequest(newUrl);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+
+    public static String httpPostRequestTest(String url, String body, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            httppost.addHeader("Content-Type", "application/json");
+            if (!Check.isNull(headers)) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+
+            httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostRequestTest(newUrl, body, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+
+    public static String kuaiShouhttpPostRequest(String url, String body, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(120000).setConnectTimeout(120000).build();
+            httppost.setConfig(requestConfig);
+            if (!Check.isNullMap(headers)) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+
+            httppost.setHeader("User-Agent", USER_AGENT);
+            if (!Check.isNull(body)) {
+                httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
+            }
+            HttpEntity respentity;
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+
+    public static String httpPostRequest(String url, JSONObject params, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            httppost.addHeader("Content-Type", "application/json");
+            for (String key : headers.keySet()) {
+                httppost.setHeader(key, headers.get(key));
+            }
+            httppost.setEntity(new StringEntity(params.toJSONString(), Charset.forName("UTF-8")));
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostRequest(newUrl, params, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String postKuaishouVideoUrl(String url, String uid, String photoId) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        String paramBody = "{\"operationName\":\"FeedQuery\",\"variables\":{\"principalId\":\"" + uid + "\",\"photoId\":\"" + photoId + "\"},\"query\":\"query FeedQuery($principalId: String, $photoId: String) {\\n  feedById(principalId: $principalId, photoId: $photoId) {\\n    currentWork {\\n                 timestamp\\n           __typename\\n    }\\n       __typename\\n  }\\n}\\n\"}";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("User-Agent", USER_AGENT);
+            httppost.addHeader("Content-Type", "application/json");
+//            for (String key : headers.keySet()) {
+//                httppost.setHeader(key, headers.get(key));
+//            }
+            httppost.setEntity(new StringEntity(paramBody, Charset.forName("UTF-8")));
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+            return strReturn;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String getKuaishouShareUrl(String url) {
+        HttpClient httpClient = HttpClientBuilder.create().build();
+        HttpResponse response = null;
+        HttpGet httpGet = new HttpGet(url);
+        httpGet.setConfig(RequestConfig.custom().setRedirectsEnabled(false).build());
+        String result = null;
+        try {
+            httpGet.setHeader("User-Agent", USER_AGENT);
+            httpGet.setHeader("Accept-Encoding", "gzip, deflate, br");
+            httpGet.setHeader("Connection", "keep-alive");
+            httpGet.setHeader("Host", "yongzhou.s.gifshow.com");
+            httpGet.setHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3");
+            httpGet.setHeader("Upgrade-Insecure-Requests", "1");
+            httpGet.setHeader("Accept-Language", "zh-CN,zh;q=0.9");
+            response = httpClient.execute(httpGet);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return newUrl;
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    public static String httpGetRequest(String url) {
+        HttpClient httpClient = createSslClientDefault();
+        HttpResponse response = null;
+        HttpGet httpGet = new HttpGet(url);
+        String result = null;
+        try {
+            httpGet.setHeader("User-Agent", USER_AGENT);
+            response = httpClient.execute(httpGet);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpGetRequest(newUrl);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                String line = null;
+                StringBuilder builder = new StringBuilder();
+                while ((line = reader.readLine()) != null) {
+                    builder.append(line);
+                }
+                result = builder.toString();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    public static String httpRequest(String url, String strParams) throws Exception {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+
+            HttpPost httppost = new HttpPost(url);
+            httppost.addHeader("Content-Type", "application/json");
+            httppost.setEntity(new StringEntity(strParams, Charset.forName("UTF-8")));
+            HttpEntity respentity;
+            HttpResponse response = httpClient.execute(httppost);
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static String httpRequest(String url, CookieStore cookies, Map<String, String> parameterMap) throws Exception {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            httppost.setHeader("Content-Type", "application/json");
+            UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(
+                    getParam(parameterMap), "UTF-8");
+            httppost.setEntity(postEntity);
+            HttpEntity respentity;
+            HttpResponse response = httpClient.execute(httppost);
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+    public static List<NameValuePair> getParam(Map parameterMap) {
+        List<NameValuePair> param = new ArrayList<>();
+        Iterator it = parameterMap.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry parmEntry = (Map.Entry) it.next();
+            param.add(new BasicNameValuePair((String) parmEntry.getKey(),
+                    (String) parmEntry.getValue()));
+        }
+        return param;
+    }
+
+    public static HttpClient getHttpclient() {
+        RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(180000).setConnectTimeout(30000)
+                .setConnectionRequestTimeout(30000).setStaleConnectionCheckEnabled(true).build();
+        CloseableHttpClient httpclient = HttpClients.custom().setDefaultRequestConfig(defaultRequestConfig).build();
+        return httpclient;
+    }
+
+    public static String callingGraph(String url, String json) {
+        HttpClient httpClient = createSslClientDefault();
+        HttpResponse response = null;
+        HttpPost httpPost = new HttpPost(url);
+        List<Cookie> list = COOKIESTORE.getCookies();
+        httpPost.setHeader("Content-Type", "application/json");
+        String result = null;
+
+        try {
+            StringEntity entity = new StringEntity(json, "utf-8");
+            httpPost.setHeader("User-Agent", USER_AGENT);
+            httpPost.setEntity(entity);
+            response = httpClient.execute(httpPost);
+            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+            String line = null;
+            StringBuilder builder = new StringBuilder();
+            while ((line = reader.readLine()) != null) {
+                builder.append(line);
+            }
+            result = builder.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    public static Map<String, Integer> KUAISHOUNUMBERMAP;
+
+    public static Integer getKuaishouNumber(String key) {
+        if (KUAISHOUNUMBERMAP == null) {
+            KUAISHOUNUMBERMAP = new HashMap<>();
+//            kuaishouNumberMap.put("32.0#-6.0#526.0#729.0",0);//735
+//            kuaishouNumberMap.put("98.0#13.0#363.0#726.0",1);//713
+//            kuaishouNumberMap.put("32.0#13.0#527.0#732.0",2);//719
+//            kuaishouNumberMap.put("25.0#-6.0#525.0#730.0",3);//736
+//            kuaishouNumberMap.put("26.0#13.0#536.0#731.0",4);//718
+//            kuaishouNumberMap.put("33.0#-5.0#526.0#717.0",5);//722
+//            kuaishouNumberMap.put("39.0#-5.0#530.0#732.0",6);//737
+//            kuaishouNumberMap.put("38.0#13.0#536.0#717.0",7);//704
+//            kuaishouNumberMap.put("33.0#-7.0#525.0#731.0",8);//738
+//            kuaishouNumberMap.put("37.0#-7.0#521.0#730.0",9);//737
+            KUAISHOUNUMBERMAP.put("494.0#735.0", 0);
+            KUAISHOUNUMBERMAP.put("265.0#713.0", 1);
+            KUAISHOUNUMBERMAP.put("495.0#719.0", 2);
+            KUAISHOUNUMBERMAP.put("500.0#736.0", 3);
+            KUAISHOUNUMBERMAP.put("510.0#718.0", 4);
+            KUAISHOUNUMBERMAP.put("493.0#722.0", 5);
+            KUAISHOUNUMBERMAP.put("491.0#737.0", 6);
+            KUAISHOUNUMBERMAP.put("498.0#704.0", 7);
+            KUAISHOUNUMBERMAP.put("492.0#738.0", 8);
+            KUAISHOUNUMBERMAP.put("484.0#737.0", 9);
+        }
+        return KUAISHOUNUMBERMAP.get(key);
+    }
+
+
+
+    public static String mapParamsSortToStringBySeperator(TreeMap<String, Object> treeMap, String seperator) {
+        String result = "";
+        if (null != treeMap && !treeMap.isEmpty()) {
+            for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
+                String key = entry.getKey();
+                String value = entry.getValue().toString();
+                result += (key + "=" + value + seperator);
+            }
+          result = result.substring(0, result.length() - seperator.length());
+        }
+        return result;
+    }
+
+    public static String httpGetRequest(String url, Map<String, String> headers, TreeMap<String, Object> params) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            String uri = url + "?" + mapParamsSortToStringBySeperator(params, "&");
+            HttpGet httpGet = new HttpGet(uri);
+            if (headers != null) {
+                Iterator<String> keyIter = headers.keySet().iterator();
+                while (keyIter.hasNext()) {
+                    String curKey = keyIter.next();
+                    if (curKey != null && headers.get(curKey) != null) {
+                        httpGet.addHeader(curKey, headers.get(curKey));
+                    }
+                }
+            }
+            HttpEntity respentity;
+            HttpResponse response = httpClient.execute(httpGet);
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
+
+
+
+    public static String httpGet(String url, Map<String, Object> paramsMap, Map<String, String> headers) {
+        String result = null;
+        try {
+            //创建参数列表
+            HttpClient httpclient = getHttpclient();
+            StringBuilder postBody = null;
+            if (!Check.isNull(paramsMap)) {
+                postBody = new StringBuilder();
+                for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
+                    if (entry.getValue() == null) {
+                        continue;
+                    }
+                    postBody.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(),
+                            "utf-8")).append("&");
+                }
+                if (!paramsMap.isEmpty()) {
+                    postBody.deleteCharAt(postBody.length() - 1);
+                }
+            }
+            String urlStr;
+            if (!Check.isNull(postBody)) {
+                urlStr = url + "?" + postBody;
+            } else {
+                urlStr = url;
+            }
+            HttpGet httpget = new HttpGet(urlStr);
+//            httpget.setHeader("User-Agent", USER_AGENT);
+            if (!Check.isNullMap(headers)) {
+                for (String key : headers.keySet()) {
+                    httpget.setHeader(key, headers.get(key));
+                }
+            }
+            HttpEntity respEntity;
+            HttpResponse response = httpclient.execute(httpget);
+            respEntity = response.getEntity();
+            Header[] responseHeaders = response.getHeaders("Set-Cookie");
+            if (responseHeaders != null) {
+
+                for (Header header : responseHeaders) {
+                    String[] ckArray = header.getValue().split(";");
+                    BasicClientCookie ck = new BasicClientCookie(ckArray[0].split("=")[0], ckArray[0].split("=")[1]);
+                    ck.setPath(ckArray[1].split("=")[1]);
+                    ck.setDomain(ckArray[2].split("=")[1]);
+                    HttpUtils.COOKIESTORE.addCookie(ck);
+                }
+            }
+            result = EntityUtils.toString(respEntity);
+        } catch (Exception e) {
+            log.error("http get请求异常");
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+
+    public static JSONObject kuaiShouHttpGetRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        httpEntity.setHeader("Access-Token", accessToken);
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+
+    public static String KuaiShouttpGetRequest(String url, Map<String, Object> params, Map<String, String> headers) throws Exception {
+        HttpClient httpclient = getHttpclient();
+        String strReturn = "";
+        try {
+
+
+            StringBuilder postBody = new StringBuilder();
+            for (Map.Entry<String, Object> entry : params.entrySet()) {
+                if (entry.getValue() == null) {
+                    continue;
+                }
+                postBody.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(),
+                        "utf-8")).append("&");
+            }
+            if (!params.isEmpty()) {
+                postBody.deleteCharAt(postBody.length() - 1);
+            }
+
+            HttpGet httpget = new HttpGet(url + "?" + postBody);
+            if (headers != null) {
+                Iterator<String> keyIter = headers.keySet().iterator();
+                while (keyIter.hasNext()) {
+                    String curKey = keyIter.next();
+                    if (curKey != null && headers.get(curKey) != null) {
+                        httpget.addHeader(curKey, headers.get(curKey));
+                    }
+                }
+            }
+            HttpEntity respentity;
+            HttpResponse response = httpclient.execute(httpget);
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return strReturn;
+    }
+
+    public static JSONObject feishuGetRequest(String url, JSONObject params) {
+        return feishuGetRequest(null, url, params);
+    }
+
+    public static JSONObject feishuPostRequest(String url, JSONObject params) {
+        return feishuPostRequest(null, url, params);
+    }
+
+    public static String feishuGetRequestString(String url) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return result.toString();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    public static JSONObject feishuGetRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        if (accessToken != null) {
+            httpEntity.setHeader("Authorization", accessToken);
+        }
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            if (params != null) {
+                httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            }
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+
+    public static JSONObject feishuPostRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpPost httpEntity = new HttpPost(url);
+        if (accessToken != null) {
+            httpEntity.setHeader("Authorization", accessToken);
+        }
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+}

+ 122 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/constants/JsonResourceUtil.java

@@ -0,0 +1,122 @@
+package org.jeecg.ctop.material.constants;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by JQ.bi on 2020.06.03
+ */
+public class JsonResourceUtil {
+
+    private static Logger logger = LoggerFactory.getLogger(JsonResourceUtil.class);
+
+    private JsonResourceUtil() {
+
+    }
+
+    //filename 为文件名字 如 “/json/app_version_info.json”
+    public static JSONObject getJsonObjFromResource(String filename) {
+        JSONObject json = null;
+        if (!filename.contains(".json")) {
+            filename += ".json";
+        }
+        try {
+            ClassPathResource classPathResource = new ClassPathResource(filename);
+            if (classPathResource.exists()) {
+                InputStream inputStream = classPathResource.getInputStream();
+                String content = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+                json = JSON.parseObject(content);
+            } else {
+                logger.info("file not exist!");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.info("readFileToString" + e.getMessage());
+        }
+        return json;
+    }
+
+    //json文件转化为JSONArray
+    public static JSONArray getJsonArrFromResource(String filename) {
+        JSONArray json = null;
+        if (!filename.contains(".json")) {
+            filename += ".json";
+        }
+        try {
+            ClassPathResource classPathResource = new ClassPathResource(filename);
+            if (classPathResource.exists()) {
+                InputStream inputStream = classPathResource.getInputStream();
+                String content = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+                json = JSON.parseArray(content);
+            } else {
+                logger.info("file not exist!");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.info("readFileToString" + e.getMessage());
+        }
+        return json;
+    }
+
+    public static Map<String, Map<String, Object>> jsonToMap(Object jsonObj) {
+        JSONObject jsonObject = JSONObject.parseObject(jsonObj.toString());
+        Map<String, Map<String, Object>> mapMap = new HashMap<>();
+        jsonObject.forEach((key, value) -> mapMap.put(key, JSONObject.parseObject(value.toString())));
+        return mapMap;
+    }
+
+    /**
+     * 拼接字段
+     */
+    public static String joinFiled(Map<String, Map<String,Object>> mapMap,JSONArray array) {
+        StringBuilder sb = new StringBuilder();
+        array.forEach(it -> {
+            String filedName = it.toString();
+            if (null== mapMap.get(filedName)||mapMap.get(filedName).isEmpty()) {
+                sb.append(it).append(",");
+            } else {
+                sb.append(mapMap.get(filedName).get("filed")).append(",");
+            }
+        });
+        return sb.deleteCharAt(sb.length() - 1).toString();
+    }
+
+    /**
+     * 拼接title
+     */
+    public static List<String> joinTitle(Map<String, Map<String,Object>> mapMap,JSONArray array) {
+        List<String> titles = new ArrayList<>(20);
+        array.forEach(it -> {
+            String titleName = it.toString();
+            if (null== mapMap.get(titleName)||mapMap.get(titleName).isEmpty()) {
+                titles.add(it.toString());
+            } else {
+                titles.add(mapMap.get(it.toString()).get("comment").toString());
+            }
+        });
+        return titles;
+    }
+
+    /**
+     * 拼接字段
+     */
+    public static String joinAllFiled(Map<String, Map<String,Object>> mapMap) {
+        StringBuilder sb = new StringBuilder();
+        mapMap.forEach((k, v) -> sb.append(v.get("filed")).append(","));
+        return sb.deleteCharAt(sb.length() - 1).toString();
+    }
+}

+ 3 - 4
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/MaterialReportOverViewV2Controller.java

@@ -1,16 +1,16 @@
 package org.jeecg.ctop.material.controller;
 package org.jeecg.ctop.material.controller;
 
 
-import cn.com.ctop.common.module.utils.CtopAdConstant;
+
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.material.constants.CtopAdConstant;
 import org.jeecg.ctop.material.mapper.MaterialReportOverViewV3Mapper;
 import org.jeecg.ctop.material.mapper.MaterialReportOverViewV3Mapper;
 import org.jeecg.ctop.material.service.IMaterialReportOverViewV2Service;
 import org.jeecg.ctop.material.service.IMaterialReportOverViewV2Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
-import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
 import java.util.HashMap;
@@ -60,9 +60,7 @@ public class MaterialReportOverViewV2Controller {
             result.error500("userId is empty");
             result.error500("userId is empty");
             return result;
             return result;
         }
         }
-        //查询所有包含自己的下级
         List<JSONObject> list = materialReportOverViewService.getDesignTeamList(userId, mediaId);
         List<JSONObject> list = materialReportOverViewService.getDesignTeamList(userId, mediaId);
-        //查询并返回所有关联的项目
         result.setResult(list);
         result.setResult(list);
         result.setSuccess(true);
         result.setSuccess(true);
         return result;
         return result;
@@ -268,6 +266,7 @@ public class MaterialReportOverViewV2Controller {
                 params.getInteger("mediaId"),
                 params.getInteger("mediaId"),
                 params.getString("startDate"),
                 params.getString("startDate"),
                 params.getString("endDate"),
                 params.getString("endDate"),
+                params.getString("userId"),
                 params.getInteger("type"),
                 params.getInteger("type"),
                 params.getInteger("pageNumber"),
                 params.getInteger("pageNumber"),
                 params.getInteger("pageSize"));
                 params.getInteger("pageSize"));

+ 20 - 15
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialReportOverViewV3Mapper.java

@@ -2,6 +2,7 @@ package org.jeecg.ctop.material.mapper;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Lang;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -14,7 +15,7 @@ public interface MaterialReportOverViewV3Mapper {
 
 
     Set<String> recursiveQuerySubordinateByLeader(@Param("leaderId") String leaderId);
     Set<String> recursiveQuerySubordinateByLeader(@Param("leaderId") String leaderId);
 
 
-    List<JSONObject> getDesignTeamList(@Param("mediaId") int mediaId);
+    List<JSONObject> getDesignTeamList(@Param("userId") String userId);
 
 
     Set<String> recursiveQuerySubordinateByLeaders(@Param("leaderIds") Set<String> leaderIds);
     Set<String> recursiveQuerySubordinateByLeaders(@Param("leaderIds") Set<String> leaderIds);
 
 
@@ -35,16 +36,16 @@ public interface MaterialReportOverViewV3Mapper {
     Long queryMaterialCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
     Long queryMaterialCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
 
 
     //查询素材 上新 数据 头条
     //查询素材 上新 数据 头条
-    List<Map<String, String>> queryMaterialCountList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    List<Map<String, String>> queryMaterialCountList(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
     //上新 快手
     //上新 快手
-    List<Map<String, String>> queryMaterialCountListKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    List<Map<String, String>> queryMaterialCountListKs(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
     //查询有消耗的素材 - 头条
     //查询有消耗的素材 - 头条
-    Long queryMaterialCostList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    Long queryMaterialCostList(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
     //查询有消耗的素材 - 快手
     //查询有消耗的素材 - 快手
-    Long queryMaterialCostListKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    Long queryMaterialCostListKs(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
     //查询有效视频-头条
     //查询有效视频-头条
     List<Map<String, String>> selectEffectiveMaterialVideoBytedance(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
     List<Map<String, String>> selectEffectiveMaterialVideoBytedance(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
@@ -106,9 +107,9 @@ public interface MaterialReportOverViewV3Mapper {
     Long queryTopDesignCount(String startDate, String endDate, Set<String> userIds);
     Long queryTopDesignCount(String startDate, String endDate, Set<String> userIds);
 
 
     //设计排行榜新版本
     //设计排行榜新版本
-    List<JSONObject> queryKuaishouTopDesign(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("type") Integer type);
+    List<JSONObject> queryKuaishouTopDesign(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("type") Integer type,@Param("companyId") String companyId);
 
 
-    List<JSONObject> queryBytedanceTopDesign(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("type") Integer type);
+    List<JSONObject> queryBytedanceTopDesign(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("type") Integer type,@Param("companyId") String companyId);
 
 
     //素材详情页
     //素材详情页
     JSONObject queryBytedanceVideoDetail(String md5);
     JSONObject queryBytedanceVideoDetail(String md5);
@@ -173,23 +174,27 @@ public interface MaterialReportOverViewV3Mapper {
 
 
     BigDecimal getKuaishouDesignTeamAvgCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
     BigDecimal getKuaishouDesignTeamAvgCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
-    BigDecimal getBytedanceDesignTeamGroupWork(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("leaderId") String leaderId);
+    BigDecimal getBytedanceDesignTeamGroupWork(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
-    BigDecimal getKuaishouDesignTeamGroupWork(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("leaderId") String leaderId);
+    BigDecimal getKuaishouDesignTeamGroupWork(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
-    int getBytedanceDesignTeaminnovativeVideoCount(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId);
+    int getBytedanceDesignTeaminnovativeVideoCount(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
-    int getKuaishouDesignTeaminnovativeVideoCount(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId);
+    int getKuaishouDesignTeaminnovativeVideoCount(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
     BigDecimal getBytedanceMaterialCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
     BigDecimal getBytedanceMaterialCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
     BigDecimal getKuaishouDesignTeaminnovativeVideoCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
     BigDecimal getKuaishouDesignTeaminnovativeVideoCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("leaderId") String leaderId, @Param("companyId") String companyId);
 
 
-    JSONObject getBytedanceMaterialCountByLable(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    JSONObject getBytedanceMaterialCountByLable(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
-    JSONObject getBytedanceMaterialCountByCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    JSONObject getBytedanceMaterialCountByCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
-    JSONObject getKuaishouMaterialCountByLable(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    JSONObject getKuaishouMaterialCountByLable(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
 
 
-    JSONObject getKuaishouMaterialCountByCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+    JSONObject getKuaishouMaterialCountByCost(@Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("projects") JSONArray projects, @Param("dimension") String dimension, @Param("leaderId") String leaderId, @Param("designerId") String designerId, @Param("companyId") String companyId);
+
+    List<JSONObject> getDesignTeamALLList();
+
+    String getRoleCodeByUserId(String userId);
 }
 }

文件差异内容过多而无法显示
+ 312 - 335
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialReportOverViewV3Mapper.xml


+ 1 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/IMaterialReportOverViewV2Service.java

@@ -47,7 +47,7 @@ public interface IMaterialReportOverViewV2Service {
     void exportKuaishouExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response);
     void exportKuaishouExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response);
 
 
     //查询设计人员排行榜
     //查询设计人员排行榜
-    PageInfo getTopDesignList(Integer mediaId, String startDate, String endDate, Integer type, int pageNUmber, int pageSize);
+    PageInfo getTopDesignList(Integer mediaId, String startDate, String endDate,String userId, Integer type, int pageNUmber, int pageSize);
 
 
     // 视频详情页
     // 视频详情页
     JSONObject getMaterialDetailInfo(int mediaId, String md5);
     JSONObject getMaterialDetailInfo(int mediaId, String md5);

+ 55 - 46
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialReportOverViewV2ServiceImpl.java

@@ -1,9 +1,6 @@
 package org.jeecg.ctop.material.service.impl;
 package org.jeecg.ctop.material.service.impl;
 
 
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.ExportExcelUtils;
-import cn.com.ctop.common.module.utils.HttpUtils;
+
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
@@ -11,16 +8,13 @@ import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.AccountReportConstants;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.common.utils.JsonResourceUtil;
+import org.jeecg.ctop.material.constants.*;
 import org.jeecg.ctop.material.mapper.MaterialReportOverViewV3Mapper;
 import org.jeecg.ctop.material.mapper.MaterialReportOverViewV3Mapper;
 import org.jeecg.ctop.material.service.IMaterialReportOverViewV2Service;
 import org.jeecg.ctop.material.service.IMaterialReportOverViewV2Service;
-import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
@@ -39,8 +33,8 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
     @Autowired
     @Autowired
     private MaterialReportOverViewV3Mapper materialReportOverViewV3Mapper;
     private MaterialReportOverViewV3Mapper materialReportOverViewV3Mapper;
 
 
-    @Autowired
-    private ISysRoleService roleService;
+    /*@Autowired
+    private ISysRoleService roleService;*/
 
 
     @Override
     @Override
     public Set<String> recursiveQuerySubordinate(String userId) {
     public Set<String> recursiveQuerySubordinate(String userId) {
@@ -62,8 +56,15 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
      */
      */
     @Override
     @Override
     public List<JSONObject> getDesignTeamList(String userId, int mediaId) {
     public List<JSONObject> getDesignTeamList(String userId, int mediaId) {
+        String roleCode = materialReportOverViewV3Mapper.getRoleCodeByUserId(userId);
+        List<JSONObject> designTeamList = new ArrayList<>();
+        if ("admin".equals(roleCode)) {
+            //管理员查询全部部门
+            designTeamList = materialReportOverViewV3Mapper.getDesignTeamALLList();
+        } else {
+            designTeamList = materialReportOverViewV3Mapper.getDesignTeamList(userId);
+        }
 
 
-        List<JSONObject> designTeamList = materialReportOverViewV3Mapper.getDesignTeamList(mediaId);
         if (designTeamList != null && !designTeamList.isEmpty()) {
         if (designTeamList != null && !designTeamList.isEmpty()) {
             //判断是否默认选中
             //判断是否默认选中
             for (JSONObject jsonObject : designTeamList) {
             for (JSONObject jsonObject : designTeamList) {
@@ -161,16 +162,19 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         }
         }
         //根据userID查询公司id
         //根据userID查询公司id
         String companyId = materialReportOverViewV3Mapper.getCompanyId(userId);
         String companyId = materialReportOverViewV3Mapper.getCompanyId(userId);
+        startDate = startDate.replace("-", "");
+        endDate = endDate.replace("-", "");
+
 
 
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
             //视频上新
             //视频上新
-            List<Map<String, String>> videoList = materialReportOverViewV3Mapper.queryMaterialCountList(startDate + " 00:00:00", endDate + " 23:59:59", projects, dimension, leaderId, designerId, companyId);
+            List<Map<String, String>> videoList = materialReportOverViewV3Mapper.queryMaterialCountList(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             //总数
             //总数
             long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             result.put("videoList", videoList);
             result.put("videoList", videoList);
             result.put("videoTotal", videoTotal);
             result.put("videoTotal", videoTotal);
             //素材使用率 = 有消耗的素材 / 总数 * 100%
             //素材使用率 = 有消耗的素材 / 总数 * 100%
-            long videoCost = materialReportOverViewV3Mapper.queryMaterialCostList(startDate + " 00:00:00", endDate + " 23:59:59", projects, dimension, leaderId, designerId, companyId);
+            long videoCost = materialReportOverViewV3Mapper.queryMaterialCostList(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             result.put("useCompare", Check.isNull(videoCost) ? 0 : new BigDecimal(videoCost).divide(new BigDecimal(videoTotal), 4, RoundingMode.HALF_UP));
             result.put("useCompare", Check.isNull(videoCost) ? 0 : new BigDecimal(videoCost).divide(new BigDecimal(videoTotal), 4, RoundingMode.HALF_UP));
             //有效视频
             //有效视频
             List<Map<String, String>> effectiveList = materialReportOverViewV3Mapper.selectEffectiveMaterialVideoBytedance(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), projects, dimension, leaderId, designerId, companyId);
             List<Map<String, String>> effectiveList = materialReportOverViewV3Mapper.selectEffectiveMaterialVideoBytedance(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), projects, dimension, leaderId, designerId, companyId);
@@ -184,13 +188,13 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
 
 
             //视频上新
             //视频上新
-            List<Map<String, String>> videoList = materialReportOverViewV3Mapper.queryMaterialCountListKs(startDate + " 00:00:00", endDate + " 23:59:59", projects, dimension, leaderId, designerId, companyId);
+            List<Map<String, String>> videoList = materialReportOverViewV3Mapper.queryMaterialCountListKs(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             //总数
             //总数
             long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             result.put("videoList", videoList);
             result.put("videoList", videoList);
             result.put("videoTotal", videoTotal);
             result.put("videoTotal", videoTotal);
             //素材使用率 = 有消耗的素材 / 总数 * 100%
             //素材使用率 = 有消耗的素材 / 总数 * 100%
-            long videoCost = materialReportOverViewV3Mapper.queryMaterialCostListKs(startDate + " 00:00:00", endDate + " 23:59:59", projects, dimension, leaderId, designerId, companyId);
+            long videoCost = materialReportOverViewV3Mapper.queryMaterialCostListKs(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), projects, dimension, leaderId, designerId, companyId);
             result.put("useCompare", Check.isNull(videoCost) ? 0 : new BigDecimal(videoCost).divide(new BigDecimal(videoTotal), 4, RoundingMode.HALF_UP));
             result.put("useCompare", Check.isNull(videoCost) ? 0 : new BigDecimal(videoCost).divide(new BigDecimal(videoTotal), 4, RoundingMode.HALF_UP));
             //有效视频
             //有效视频
             List<Map<String, String>> effectiveList = materialReportOverViewV3Mapper.selectEffectiveMaterialVideoKs(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), projects, dimension, leaderId, designerId, companyId);
             List<Map<String, String>> effectiveList = materialReportOverViewV3Mapper.selectEffectiveMaterialVideoKs(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), projects, dimension, leaderId, designerId, companyId);
@@ -225,7 +229,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             result.put("hotList", hotList);
             result.put("hotList", hotList);
             result.put("hotTotal", hotTotal);
             result.put("hotTotal", hotTotal);
-            //上阶段
+           /* //上阶段
             List<Map<String, String>> lastHostList = materialReportOverViewV3Mapper.selectHotMaterialVideoBytedance(Long.parseLong(DateUtils.addDayParse(startDate, -DateUtils.dateDiffParse(startDate, endDate) - 1)), Long.parseLong(DateUtils.addDayParse(startDate, -1)), projects, dimension, leaderId, designerId, companyId, type);
             List<Map<String, String>> lastHostList = materialReportOverViewV3Mapper.selectHotMaterialVideoBytedance(Long.parseLong(DateUtils.addDayParse(startDate, -DateUtils.dateDiffParse(startDate, endDate) - 1)), Long.parseLong(DateUtils.addDayParse(startDate, -1)), projects, dimension, leaderId, designerId, companyId, type);
             long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
             //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
@@ -237,7 +241,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             //日环比 (昨日-前日)/前日消耗 X 100%
             //日环比 (昨日-前日)/前日消耗 X 100%
-            result.put("hostCompare", countLink(new BigDecimal(yesterday), new BigDecimal(before)));
+            result.put("hostCompare", countLink(new BigDecimal(yesterday), new BigDecimal(before)));*/
 
 
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
             //爆款视频
             //爆款视频
@@ -246,7 +250,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             result.put("hotList", hotList);
             result.put("hotList", hotList);
             result.put("hotTotal", hotTotal);
             result.put("hotTotal", hotTotal);
-            //上阶段
+         /*   //上阶段
             List<Map<String, String>> lastHostList = materialReportOverViewV3Mapper.selectHotMaterialVideoKs(Long.parseLong(DateUtils.addDayParse(startDate, -DateUtils.dateDiffParse(startDate, endDate) - 1)), Long.parseLong(DateUtils.addDayParse(startDate, -1)), projects, dimension, leaderId, designerId, companyId, type);
             List<Map<String, String>> lastHostList = materialReportOverViewV3Mapper.selectHotMaterialVideoKs(Long.parseLong(DateUtils.addDayParse(startDate, -DateUtils.dateDiffParse(startDate, endDate) - 1)), Long.parseLong(DateUtils.addDayParse(startDate, -1)), projects, dimension, leaderId, designerId, companyId, type);
             long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
             //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
@@ -258,7 +262,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s -> Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
             //日环比 (昨日-前日)/前日消耗 X 100%
             //日环比 (昨日-前日)/前日消耗 X 100%
-            result.put("hostCompare", countLink(new BigDecimal(yesterday), new BigDecimal(before)));
+            result.put("hostCompare", countLink(new BigDecimal(yesterday), new BigDecimal(before)));*/
         }
         }
         return result;
         return result;
     }
     }
@@ -346,7 +350,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
     @Override
     @Override
     public void exportBytedanceExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response) {
     public void exportBytedanceExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response) {
         JSONArray projects = requestBody.getJSONArray("projects");
         JSONArray projects = requestBody.getJSONArray("projects");
-        if (projects.isEmpty()) {
+        if (projects != null && projects.isEmpty()) {
             projects = getProjectsByCurrentUser(requestBody.getInteger("mediaId"));
             projects = getProjectsByCurrentUser(requestBody.getInteger("mediaId"));
         }
         }
         JSONArray columns = requestBody.getJSONArray("columns");
         JSONArray columns = requestBody.getJSONArray("columns");
@@ -354,7 +358,8 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             //默认消耗必查
             //默认消耗必查
             columns.add("cost");
             columns.add("cost");
         }
         }
-        String filed = JsonResourceUtil.joinFiled(AccountReportConstants.getDicMapByVideo(), columns);
+
+        String filed = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapByVideoNew());
         List<String> titles = new ArrayList<>(JsonResourceUtil.joinTitle(AccountReportConstants.getDicMapByVideo(), columns));
         List<String> titles = new ArrayList<>(JsonResourceUtil.joinTitle(AccountReportConstants.getDicMapByVideo(), columns));
 
 
         titles.add(0, "唯一标识");
         titles.add(0, "唯一标识");
@@ -369,7 +374,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         List<JSONObject> excelData = materialReportOverViewV3Mapper.queryBytedanceMaterialReport(filed,
         List<JSONObject> excelData = materialReportOverViewV3Mapper.queryBytedanceMaterialReport(filed,
                 Long.parseLong(requestBody.getString("startDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("startDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("endDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("endDate").replace("-", "")),
-                requestBody.getJSONArray("projects"),
+                projects,
                 requestBody.getString("md5"),
                 requestBody.getString("md5"),
                 requestBody.getString("dimension"),
                 requestBody.getString("dimension"),
                 requestBody.getString("leaderId"),
                 requestBody.getString("leaderId"),
@@ -409,7 +414,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
     @Override
     @Override
     public void exportKuaishouExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response) {
     public void exportKuaishouExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response) {
         JSONArray projects = requestBody.getJSONArray("projects");
         JSONArray projects = requestBody.getJSONArray("projects");
-        if (projects.isEmpty()) {
+        if (projects != null && projects.isEmpty()) {
             projects = getProjectsByCurrentUser(requestBody.getInteger("mediaId"));
             projects = getProjectsByCurrentUser(requestBody.getInteger("mediaId"));
         }
         }
         JSONArray columns2 = new JSONArray();
         JSONArray columns2 = new JSONArray();
@@ -422,12 +427,12 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             columns2.add(columns2.size(), columns.getString(i));
             columns2.add(columns2.size(), columns.getString(i));
         }
         }
         List<String> titles = getfileIds(AccountReportConstants.getKuaishouVideoReportDict(), columns2);
         List<String> titles = getfileIds(AccountReportConstants.getKuaishouVideoReportDict(), columns2);
-        String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getKuaishouVideoReportMap());
+        String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getKuaishouVideoReportMapNew());
         String companyId = materialReportOverViewV3Mapper.getCompanyId(requestBody.getString("userId"));
         String companyId = materialReportOverViewV3Mapper.getCompanyId(requestBody.getString("userId"));
         List<JSONObject> excelData = materialReportOverViewV3Mapper.queryKuaishouMaterialReport(filedAll,
         List<JSONObject> excelData = materialReportOverViewV3Mapper.queryKuaishouMaterialReport(filedAll,
                 Long.parseLong(requestBody.getString("startDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("startDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("endDate").replace("-", "")),
                 Long.parseLong(requestBody.getString("endDate").replace("-", "")),
-                requestBody.getJSONArray("projects"),
+                projects,
                 requestBody.getString("md5"),
                 requestBody.getString("md5"),
                 requestBody.getString("dimension"),
                 requestBody.getString("dimension"),
                 requestBody.getString("leaderId"),
                 requestBody.getString("leaderId"),
@@ -468,26 +473,28 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
     }
     }
 
 
     @Override
     @Override
-    public PageInfo getTopDesignList(Integer mediaId, String startDate, String endDate, Integer type, int pageNumber, int pageSize) {
+    public PageInfo getTopDesignList(Integer mediaId, String startDate, String endDate, String userId, Integer type, int pageNumber, int pageSize) {
 
 
         startDate = startDate.replace("-", "");
         startDate = startDate.replace("-", "");
         endDate = endDate.replace("-", "");
         endDate = endDate.replace("-", "");
         List<JSONObject> result = new ArrayList<>();
         List<JSONObject> result = new ArrayList<>();
-        int total=0;
-        int page=pageNumber;
+        int total = 0;
+        int page = pageNumber;
+        //根据userID查询公司id
+        String companyId = materialReportOverViewV3Mapper.getCompanyId(userId);
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
-            total=materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type).size();
-            PageHelper.startPage(pageNumber, pageSize,false);
-            result = materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
+            total = materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type, companyId).size();
+            PageHelper.startPage(pageNumber, pageSize, false);
+            result = materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type, companyId);
 
 
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
-            total= materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type).size();
-            PageHelper.startPage(pageNumber, pageSize,false);
-            result = materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
+            total = materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type, companyId).size();
+            PageHelper.startPage(pageNumber, pageSize, false);
+            result = materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type, companyId);
         }
         }
-        int number=(page-1)*10+1;
+        int number = (page - 1) * 10 + 1;
         for (JSONObject jsonObject : result) {
         for (JSONObject jsonObject : result) {
-            jsonObject.put("number",number);
+            jsonObject.put("number", number);
             number++;
             number++;
         }
         }
         PageInfo info = new PageInfo(result);
         PageInfo info = new PageInfo(result);
@@ -751,9 +758,9 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             //组内人均消耗
             //组内人均消耗
             BigDecimal sumCost = materialReportOverViewV3Mapper.getBytedanceDesignTeamAvgCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             BigDecimal sumCost = materialReportOverViewV3Mapper.getBytedanceDesignTeamAvgCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //组人效
             //组人效
-            BigDecimal groupWork = materialReportOverViewV3Mapper.getBytedanceDesignTeamGroupWork(startDate, endDate, leaderId);
+            BigDecimal groupWork = materialReportOverViewV3Mapper.getBytedanceDesignTeamGroupWork(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //创新视频数
             //创新视频数
-            int innovativeVideoCount = materialReportOverViewV3Mapper.getBytedanceDesignTeaminnovativeVideoCount(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId);
+            int innovativeVideoCount = materialReportOverViewV3Mapper.getBytedanceDesignTeaminnovativeVideoCount(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //素材平均消耗
             //素材平均消耗
             BigDecimal avgCost = materialReportOverViewV3Mapper.getBytedanceMaterialCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             BigDecimal avgCost = materialReportOverViewV3Mapper.getBytedanceMaterialCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
 
 
@@ -766,9 +773,9 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             //组内人均消耗
             //组内人均消耗
             BigDecimal sumCost = materialReportOverViewV3Mapper.getKuaishouDesignTeamAvgCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             BigDecimal sumCost = materialReportOverViewV3Mapper.getKuaishouDesignTeamAvgCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //组人效
             //组人效
-            BigDecimal groupWork = materialReportOverViewV3Mapper.getKuaishouDesignTeamGroupWork(startDate, endDate, leaderId);
+            BigDecimal groupWork = materialReportOverViewV3Mapper.getKuaishouDesignTeamGroupWork(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //创新视频数
             //创新视频数
-            int innovativeVideoCount = materialReportOverViewV3Mapper.getKuaishouDesignTeaminnovativeVideoCount(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId);
+            int innovativeVideoCount = materialReportOverViewV3Mapper.getKuaishouDesignTeaminnovativeVideoCount(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             //创新视频消耗
             //创新视频消耗
             BigDecimal innovativeVideoCost = materialReportOverViewV3Mapper.getKuaishouDesignTeaminnovativeVideoCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             BigDecimal innovativeVideoCost = materialReportOverViewV3Mapper.getKuaishouDesignTeaminnovativeVideoCost(Long.parseLong(startDate.replace("-", "")), Long.parseLong(endDate.replace("-", "")), leaderId, companyId);
             result.put("avgCost", sumCost);
             result.put("avgCost", sumCost);
@@ -791,17 +798,19 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         if (projects != null && projects.isEmpty()) {
         if (projects != null && projects.isEmpty()) {
             projects = getProjectsByCurrentUser(mediaId);
             projects = getProjectsByCurrentUser(mediaId);
         }
         }
+        startDate = startDate.replace("-", "");
+        endDate = endDate.replace("-", "");
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
             //头条
             //头条
             if (type == 0) {
             if (type == 0) {
                 //素材数
                 //素材数
                 //获取真人 制作 其他 数量
                 //获取真人 制作 其他 数量
-                object = materialReportOverViewV3Mapper.getBytedanceMaterialCountByLable(startDate, endDate, projects, dimension, leaderId, designerId, companyId);
+                object = materialReportOverViewV3Mapper.getBytedanceMaterialCountByLable(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
 
 
             } else if (type == 1) {
             } else if (type == 1) {
                 //消耗
                 //消耗
                 //获取真人 制作 其他 数量
                 //获取真人 制作 其他 数量
-                object = materialReportOverViewV3Mapper.getBytedanceMaterialCountByCost(startDate, endDate, projects, dimension, leaderId, designerId, companyId);
+                object = materialReportOverViewV3Mapper.getBytedanceMaterialCountByCost(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             }
             }
 
 
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
@@ -809,11 +818,11 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
             if (type == 0) {
             if (type == 0) {
                 //素材数
                 //素材数
                 //获取真人 制作 其他 数量
                 //获取真人 制作 其他 数量
-                object = materialReportOverViewV3Mapper.getKuaishouMaterialCountByLable(startDate, endDate, projects, dimension, leaderId, designerId, companyId);
+                object = materialReportOverViewV3Mapper.getKuaishouMaterialCountByLable(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             } else if (type == 1) {
             } else if (type == 1) {
                 //消耗
                 //消耗
                 //获取真人 制作 其他 数量
                 //获取真人 制作 其他 数量
-                object = materialReportOverViewV3Mapper.getKuaishouMaterialCountByCost(startDate, endDate, projects, dimension, leaderId, designerId, companyId);
+                object = materialReportOverViewV3Mapper.getKuaishouMaterialCountByCost(Long.parseLong(startDate), Long.parseLong(endDate), projects, dimension, leaderId, designerId, companyId);
             }
             }
         }
         }
 
 
@@ -830,7 +839,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
     public Result getRole(String userId) {
     public Result getRole(String userId) {
         Map map = new HashMap();
         Map map = new HashMap();
         Result result = new Result<>();
         Result result = new Result<>();
-        String roleCode = roleService.getRoleCodeByUserId(userId);
+        String roleCode = materialReportOverViewV3Mapper.getRoleCodeByUserId(userId);
         map.put("role", roleCode);
         map.put("role", roleCode);
         if ("admin".equals(roleCode) || "designTeamLeader".equals(roleCode)) {
         if ("admin".equals(roleCode) || "designTeamLeader".equals(roleCode)) {
             map.put("permissions", true);
             map.put("permissions", true);
@@ -858,7 +867,7 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         //String currentUser = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
         //String currentUser = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
         String currentUser = "e9ca23d68d884d4ebb19d07889727dae";
         String currentUser = "e9ca23d68d884d4ebb19d07889727dae";
         //TODO 为了解决管理员等角色初始化查全部项目查询效率慢的问题判断角色,待优化
         //TODO 为了解决管理员等角色初始化查全部项目查询效率慢的问题判断角色,待优化
-        String roleCode = roleService.getRoleCodeByUserId(currentUser);
+        String roleCode = materialReportOverViewV3Mapper.getRoleCodeByUserId(currentUser);
         if ("admin".equals(roleCode)) {
         if ("admin".equals(roleCode)) {
             return null;
             return null;
         }
         }

+ 1 - 1
jeecg-boot-material-view/src/main/resources/application-dev.yml

@@ -106,7 +106,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://192.168.0.184:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&serverTimezone=GMT%2B8
+          url: jdbc:mysql://111.206.86.186:3390/application?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&serverTimezone=GMT%2B8
           username: hcst
           username: hcst
           password: hcst@2021
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver

+ 2 - 2
jeecg-boot-material-view/src/main/resources/application-prod.yml

@@ -106,8 +106,8 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://111.206.86.186:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          username: data
+          url: jdbc:mysql://111.206.86.186:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&serverTimezone=GMT%2B8
+          username: hcst
           password: hcst@2021
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   #redis 配置

+ 49 - 146
jeecg-boot-material-view/src/main/resources/application-test.yml

@@ -1,11 +1,15 @@
+server:
+  tomcat:
+    max-swallow-size: -1
+  error:
+    include-exception: true
+    include-stacktrace: ALWAYS
+    include-message: ALWAYS
 
 
-#swagger
-knife4j:
-  production: false
-  basic:
-    enable: false
-    username: jeecg
-    password: jeecg1314
+  compression:
+    enabled: true
+    min-response-size: 1024
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 management:
 management:
   endpoints:
   endpoints:
     web:
     web:
@@ -19,8 +23,8 @@ spring:
         service: jeecg-cloud-material
         service: jeecg-cloud-material
   servlet:
   servlet:
     multipart:
     multipart:
-      max-file-size: -1
-      max-request-size: -1
+      max-file-size: 10MB
+      max-request-size: 10MB
   mail:
   mail:
     host: smtp.163.com
     host: smtp.163.com
     username: jeecgos@163.com
     username: jeecgos@163.com
@@ -32,11 +36,18 @@ spring:
           starttls:
           starttls:
             enable: true
             enable: true
             required: true
             required: true
-  ## quartz定时任务,采用数据库方式
   #json 时间戳统一转换
   #json 时间戳统一转换
   jackson:
   jackson:
     date-format:   yyyy-MM-dd HH:mm:ss
     date-format:   yyyy-MM-dd HH:mm:ss
     time-zone:   GMT+8
     time-zone:   GMT+8
+  jpa:
+    open-in-view: false
+  activiti:
+    check-process-definitions: false
+    #启用作业执行器
+    async-executor-activate: false
+    #启用异步执行器
+    job-executor-activate: false
   aop:
   aop:
     proxy-target-class: true
     proxy-target-class: true
   #配置freemarker
   #配置freemarker
@@ -61,24 +72,18 @@ spring:
   autoconfigure:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
   datasource:
-    url: jdbc:mysql://192.168.0.184:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
-    username: hcst
-    password: hcst@2020
-    driver-class-name: com.mysql.jdbc.Driver
     druid:
     druid:
       stat-view-servlet:
       stat-view-servlet:
-        loginUsername: admin
-        loginPassword: hcst2016
         enabled: true
         enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+        allow:
       web-stat-filter:
       web-stat-filter:
         enabled: true
         enabled: true
-    #      remove-abandoned: false
     dynamic:
     dynamic:
-      druid:
-        # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
         # 连接池的配置信息
         # 连接池的配置信息
         # 初始化大小,最小,最大
         # 初始化大小,最小,最大
-        connection-init-sql: set names utf8mb4
         initial-size: 5
         initial-size: 5
         min-idle: 5
         min-idle: 5
         maxActive: 20
         maxActive: 20
@@ -96,22 +101,25 @@ spring:
         poolPreparedStatements: true
         poolPreparedStatements: true
         maxPoolPreparedStatementPerConnectionSize: 20
         maxPoolPreparedStatementPerConnectionSize: 20
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,slf4j
+        filters: stat,wall,slf4j
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://111.206.86.186:3390/application?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&serverTimezone=GMT%2B8
           username: hcst
           username: hcst
-          password: hcst@2020
+          password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置
+          #multi-datasource1:
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          #username: root
+          #password: root
+          #driver-class-name: com.mysql.cj.jdbc.Driver
   #redis 配置
   #redis 配置
   redis:
   redis:
     database: 0
     database: 0
-    #    host: 172.30.0.17
     host: 127.0.0.1
     host: 127.0.0.1
-    password:
-    port: 6379
     lettuce:
     lettuce:
       pool:
       pool:
         max-active: 8   #最大连接数据库连接数,设 0 为没有限制
         max-active: 8   #最大连接数据库连接数,设 0 为没有限制
@@ -119,135 +127,30 @@ spring:
         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
       shutdown-timeout: 100ms
+    password: ''
+    port: 6379
 #mybatis plus 设置
 #mybatis plus 设置
 mybatis-plus:
 mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
   global-config:
   global-config:
     # 关闭MP3.0自带的banner
     # 关闭MP3.0自带的banner
     banner: false
     banner: false
     db-config:
     db-config:
       #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
       #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-      id-type: 4
+      id-type: ASSIGN_ID
       # 默认数据库表下划线命名
       # 默认数据库表下划线命名
       table-underline: true
       table-underline: true
-#  configuration:
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  configuration:
+    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    # 返回类型为Map,显示null对应的字段
+    call-setters-on-nulls: true
 #jeecg专用配置
 #jeecg专用配置
-jeecg:
+jeecg :
   elasticsearch:
   elasticsearch:
-    address: 127.0.0.1:9200
-    connect-timeout: 1000
-    socket-timeout: 30000
-    connection-request-timeout: 500
-    max-connect-num: 500
-    max-connect-per-route: 100
-    cluster-nodes:
+    cluster-name: jeecg-ES
+    cluster-nodes: 127.0.0.1:9200
     check-enabled: false
     check-enabled: false
-  uploadType:
-  oss:
-    endpoint:
-    accessKey:
-    secretKey:
-    bucketName:
-    staticDomain:
-  sms:
-    accessKeyId:
-    accessKeySecret:
-  minio:
-    minio_url:
-    minio_name:
-    minio_pass:
-    bucketName:
-  ffmpeg:
-    bin: ffmpeg
-  path:
-    #文件上传根目录 设置
-    upload: /mnt/upload
-    #webapp文件路径
-    webapp: /mnt/webapp
-    video-upload: /mnt/upload/video/
-    image-upload: D://data//image//
-    kuaishou-agent-image: D://temp.png
-    kuaishou-account-captcha-image: D://captcha.png
-    chrome-driver: D://chromedriver.exe
-    csv-upload: /mnt/upload/csv/
-    bak-database-file: /mnt/data/bak/
-    report-history: D://mnt//reportKs//
-    report-daily: D://mnt//reportKs//
-kuaishou:
-  api-url: https://ad.e.kuaishou.com
-  auth-url: https://ad.e.kuaishou.com
-  appid: 27
-  third-appid: 328
-  oauth-type: agent
-  secret: QovprB1tNhXptgDc
-  third-secret: 1iFTBiMdohkyEQQs
-  callback-url: http://adsp.c-top.com.cn:8080/jeecg-boot/kuaishou
-  third-callback-url: http://callback.shyouteng.com.cn/kuaishou
-  apk-sava-path: /mnt/file/apk
-  image-sava-path: /mnt/file/image
-  video-sava-path: /mnt/file/video
-  model-video-src-path: /mnt/data/src/
-  model-video-fill-path: /mnt/data/fill/
-  model-video-final-path: /mnt/data/final/
-  group-control:
-    path: http://39.106.184.70
-    port: 4723
-logging:
-  level:
-    root: info
-  config: classpath:logback-prod.xml
-chrome:
-  script:
-    clean: sh /mnt/webapp/cleanProcess.sh
-cas:
-  prefixUrl:
-oss:
-  replace:
-    replace-value: oss-cn-beijing-internal
-    replace-old-value: oss-cn-beijing
-    download: D://mnt//image//
-zip:
-  local:
-    download-path: D://mnt//data//
-bytedance:
-  appId: 1635316529903624
-  secret: 0c51523e90d6166418fc8421a4896808e90e26f4
-  url:
-    auth-prefix: https://ad.oceanengine.com/openapi
-    api-prefix: https://ad.oceanengine.com/open_api
-    callback-url: http://adsp.c-top.com.cn:8080/jeecg-boot/bytedance
-    refresh-token: /oauth2/refresh_token
-    advertiser-info: /2/advertiser/public_info/
-    ad-get: /2/ad/get/
-    ad-create: /2/ad/create/
-    ad-update: /2/ad/update/
-    ad-update-status: /2/ad/update/status/
-    ad-update-bid: /2/ad/update/bid/
-    ad-update-budget: /2/ad/update/budget/
-    ad-update-reject-reason: 2/ad/reject_reason/
-    campaign-get: /2/campaign/get/
-    campaign-create: /2/campaign/create/
-    campaign-update-status: /2/campaign/update/status/
-    campaign-update: /2/campaign/update/
-    dmp-custom-audience-select: /2/dmp/custom_audience/select/
-    file-video-ad: /2/file/video/ad/
-    file-image-ad: /2/file/image/ad/
-    creative-update-status: /2/creative/update/status/
-    creative-material-get: /2/creative/material/read/
-    creative-create-v2: /2/creative/create_v2/
-    creative-get: /2/creative/get/
-    creative-read: /2/creative/read_v2/
-    creative-update: /2/creative/update_v2/
-    creative-reject-reason: /2/creative/reject_reason/
-    advertiser-report-get: /2/report/advertiser/get/
-    campaign-report-get: /2/report/campaign/get/
-    ad-report-get: /2/report/ad/get/
-    ad-creative-get: /2/report/creative/get/
-    advertiser-fund-daily-stat: /2/advertiser/fund/daily_stat/
-ai:
-  callback:
-    callback-unit-url: http://139.186.165.84::31012/ai_callback_add_group
-    callback-creative-url: http://139.186.165.84::31012/ai_callback_add_creative
-xxl-job:
-  requestUrl: http://jiaoyangapi.shyouteng.com.cn
+
+
+

+ 13 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

@@ -580,7 +580,7 @@ public class AccountReportConstants {
             "    \"comment\": \"项目名称\"\n" +
             "    \"comment\": \"项目名称\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"cost\": {\n" +
             "  \"cost\": {\n" +
-            "    \"filed\": \"IFNULL(sum(t1.charge),0) as cost \",\n" +
+            "    \"filed\": \"IFNULL(ROUND(sum(t1.charge),2),0) as cost \",\n" +
             "    \"comment\": \"消耗\"\n" +
             "    \"comment\": \"消耗\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"photoShow\": {\n" +
             "  \"photoShow\": {\n" +
@@ -624,7 +624,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓开始下载数\"\n" +
             "    \"comment\": \"安卓开始下载数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadStartCost\": {\n" +
             "  \"downloadStartCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.charge) / (t1.download_started) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.download_started) end AS downloadStartCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / (t1.download_started) IS NULL THEN 0 ELSE ROUND(sum(t1.charge) / sum(t1.download_started),2) end AS downloadStartCost \",\n" +
             "    \"comment\": \"安卓开始下载单价\"\n" +
             "    \"comment\": \"安卓开始下载单价\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadStartRate\": {\n" +
             "  \"downloadStartRate\": {\n" +
@@ -636,7 +636,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓下载完成数\"\n" +
             "    \"comment\": \"安卓下载完成数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadFinishCost\": {\n" +
             "  \"downloadFinishCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.download_completed) IS NULL THEN 0 ELSE  sum(t1.charge) / sum(t1.download_completed) end AS downloadFinishCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.download_completed) IS NULL THEN 0 ELSE  ROUND(sum(t1.charge) / sum(t1.download_completed),2) end AS downloadFinishCost \",\n" +
             "    \"comment\": \"安卓下载完成单价\"\n" +
             "    \"comment\": \"安卓下载完成单价\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadFinishRate\": {\n" +
             "  \"downloadFinishRate\": {\n" +
@@ -648,7 +648,7 @@ public class AccountReportConstants {
             "    \"comment\": \"激活数\"\n" +
             "    \"comment\": \"激活数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"activeCost\": {\n" +
             "  \"activeCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.activation) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.activation) end AS activeCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.activation) IS NULL THEN 0 ELSE ROUND(sum(t1.charge) / sum(t1.activation),2) end AS activeCost \",\n" +
             "    \"comment\": \"激活单价\"\n" +
             "    \"comment\": \"激活单价\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"firstDayPay\": {\n" +
             "  \"firstDayPay\": {\n" +
@@ -656,15 +656,15 @@ public class AccountReportConstants {
             "    \"comment\": \"首日付费次数\"\n" +
             "    \"comment\": \"首日付费次数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"firstDayPayAmount\": {\n" +
             "  \"firstDayPayAmount\": {\n" +
-            "    \"filed\": \"IFNULL(sum(t1.event_pay_purchase_amount_first_day),0) as firstDayPayAmount  \",\n" +
+            "    \"filed\": \"IFNULL(ROUND(sum(t1.event_pay_purchase_amount_first_day),2),0) as firstDayPayAmount  \",\n" +
             "    \"comment\": \"首日付费金额\"\n" +
             "    \"comment\": \"首日付费金额\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"firstDayPayCost\": {\n" +
             "  \"firstDayPayCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.event_pay_first_day) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.event_pay_first_day) end AS firstDayPayCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.event_pay_first_day) IS NULL THEN 0 ELSE ROUND(sum(t1.charge) / sum(t1.event_pay_first_day),2) end AS firstDayPayCost \",\n" +
             "    \"comment\": \"首日付费成本\"\n" +
             "    \"comment\": \"首日付费成本\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"firstDayPayROI\": {\n" +
             "  \"firstDayPayROI\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge) IS NULL THEN 0 ELSE sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge) end AS firstDayPayROI \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge) IS NULL THEN 0 ELSE ROUND(sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge),2) end AS firstDayPayROI \",\n" +
             "    \"comment\": \"首日ROI\"\n" +
             "    \"comment\": \"首日ROI\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"eventPay\": {\n" +
             "  \"eventPay\": {\n" +
@@ -672,15 +672,15 @@ public class AccountReportConstants {
             "    \"comment\": \"付费次数\"\n" +
             "    \"comment\": \"付费次数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"eventPayPurchaseAmount\": {\n" +
             "  \"eventPayPurchaseAmount\": {\n" +
-            "    \"filed\": \"IFNULL(sum(t1.event_pay_purchase_amount),0) as eventPayPurchaseAmount  \",\n" +
+            "    \"filed\": \"IFNULL(ROUND(sum(t1.event_pay_purchase_amount),2),0) as eventPayPurchaseAmount  \",\n" +
             "    \"comment\": \"付费金额\"\n" +
             "    \"comment\": \"付费金额\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"eventPayCost\": {\n" +
             "  \"eventPayCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.event_pay) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.event_pay) end AS eventPayCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.event_pay) IS NULL THEN 0 ELSE ROUND(sum(t1.charge) / sum(t1.event_pay),2) end AS eventPayCost \",\n" +
             "    \"comment\": \"付费次数成本\"\n" +
             "    \"comment\": \"付费次数成本\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"ROI\": {\n" +
             "  \"ROI\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.event_pay_purchase_amount) / sum(t1.charge) IS NULL THEN 0 ELSE sum(t1.event_pay_purchase_amount) / sum(t1.charge) end AS ROI \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.event_pay_purchase_amount) / sum(t1.charge) IS NULL THEN 0 ELSE ROUND(sum(t1.event_pay_purchase_amount) / sum(t1.charge),2) end AS ROI \",\n" +
             "    \"comment\": \"ROI\"\n" +
             "    \"comment\": \"ROI\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"register\": {\n" +
             "  \"register\": {\n" +
@@ -1174,7 +1174,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓开始下载数\"\n" +
             "    \"comment\": \"安卓开始下载数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadStartCost\": {\n" +
             "  \"downloadStartCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.cost) / (t1.download_start) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.download_start) end AS downloadStartCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / (t1.download_start) IS NULL THEN 0 ELSE ROUND(sum(t1.cost) / sum(t1.download_start),2) end AS downloadStartCost \",\n" +
             "    \"comment\": \"安卓开始下载成本\"\n" +
             "    \"comment\": \"安卓开始下载成本\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadStartRate\": {\n" +
             "  \"downloadStartRate\": {\n" +
@@ -1186,7 +1186,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓下载完成数\"\n" +
             "    \"comment\": \"安卓下载完成数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadFinishCost\": {\n" +
             "  \"downloadFinishCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.download_finish) IS NULL THEN 0 ELSE  sum(t1.cost) / sum(t1.download_finish) end AS downloadFinishCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.download_finish) IS NULL THEN 0 ELSE  ROUND(sum(t1.cost) / sum(t1.download_finish),2) end AS downloadFinishCost \",\n" +
             "    \"comment\": \"安卓下载完成成本\"\n" +
             "    \"comment\": \"安卓下载完成成本\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"downloadFinishRate\": {\n" +
             "  \"downloadFinishRate\": {\n" +
@@ -1198,7 +1198,7 @@ public class AccountReportConstants {
             "    \"comment\": \"激活数\"\n" +
             "    \"comment\": \"激活数\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"activeCost\": {\n" +
             "  \"activeCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.active) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.active) end AS activeCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.active) IS NULL THEN 0 ELSE ROUND(sum(t1.cost) / sum(t1.active),2) end AS activeCost \",\n" +
             "    \"comment\": \"激活成本\"\n" +
             "    \"comment\": \"激活成本\"\n" +
             "  },\n" +
             "  },\n" +
             "  \"activeRate\": {\n" +
             "  \"activeRate\": {\n" +