Forráskód Böngészése

直播数据报表 导入功能

zhaoxian 3 éve
szülő
commit
0396ccc2d0
62 módosított fájl, 5209 hozzáadás és 0 törlés
  1. 1 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 6 0
      jeecg-boot-module-system/pom.xml
  3. 46 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java
  4. 179 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAccountsController.java
  5. 119 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAdController.java
  6. 135 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAgeController.java
  7. 116 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataGenderController.java
  8. 77 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataImportRecordController.java
  9. 121 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataMaterialController.java
  10. 116 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataPriceController.java
  11. 117 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataProvinceController.java
  12. 251 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataTouchController.java
  13. 88 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAccounts.java
  14. 165 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAd.java
  15. 177 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAge.java
  16. 174 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataGender.java
  17. 69 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataImportRecord.java
  18. 232 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataMaterial.java
  19. 177 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataPrice.java
  20. 173 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataProvince.java
  21. 142 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataTouch.java
  22. 78 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/AdEnum.java
  23. 86 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/MaterialEnum.java
  24. 77 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/ProvinceEnum.java
  25. 73 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/TouchEnum.java
  26. 185 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/liveDataUtil.java
  27. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAccountsMapper.java
  28. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAdMapper.java
  29. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAgeMapper.java
  30. 20 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataGenderMapper.java
  31. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataImportRecordMapper.java
  32. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataMaterialMapper.java
  33. 20 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataPriceMapper.java
  34. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataProvinceMapper.java
  35. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataTouchMapper.java
  36. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAccountsMapper.xml
  37. 55 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAdMapper.xml
  38. 57 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAgeMapper.xml
  39. 57 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataGenderMapper.xml
  40. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataImportRecordMapper.xml
  41. 139 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataMaterialMapper.xml
  42. 57 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataPriceMapper.xml
  43. 57 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataProvinceMapper.xml
  44. 45 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataTouchMapper.xml
  45. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAccountsService.java
  46. 17 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAdService.java
  47. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAgeService.java
  48. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataGenderService.java
  49. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataImportRecordService.java
  50. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataMaterialService.java
  51. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataPriceService.java
  52. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataProvinceService.java
  53. 18 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataTouchService.java
  54. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAccountsServiceImpl.java
  55. 165 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAdServiceImpl.java
  56. 160 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAgeServiceImpl.java
  57. 161 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataGenderServiceImpl.java
  58. 33 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataImportRecordServiceImpl.java
  59. 204 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataMaterialServiceImpl.java
  60. 160 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataPriceServiceImpl.java
  61. 159 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataProvinceServiceImpl.java
  62. 163 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataTouchServiceImpl.java

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -145,6 +145,7 @@ public class DateUtils extends PropertyEditorSupport {
     public final static String COLON_TIME_FORMAT = "HH:mm:ss";
     public final static String CHINESEDT_FORMAT = "yyyy年MM月dd日";
     public final static String NEW_FORMAT = "yyyy-MM-dd HH:mm:ss";
+    public final static String NEW_FORMAT2 = "yyyy-MM-dd HH:mm";
     public final static String WEB_FORMAT_ALL = "yyyy MM dd HH mm ss";
     public final static String SECOND_FORMAT = "yyyy-MM-dd HH";
     public final static String GREGORIAN_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";

+ 6 - 0
jeecg-boot-module-system/pom.xml

@@ -176,6 +176,12 @@
 			<artifactId>elasticsearch</artifactId>
 			<version>7.1.0</version>
 		</dependency>
+			<!--		Csv 解析包-->
+		<dependency>
+			<groupId>com.opencsv</groupId>
+			<artifactId>opencsv</artifactId>
+			<version>4.6</version>
+		</dependency>
 
 	</dependencies>
 

+ 46 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java

@@ -16,6 +16,7 @@ import org.apache.poi.xssf.usermodel.XSSFRichTextString;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.util.DateUtils;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.UnsupportedEncodingException;
@@ -340,6 +341,51 @@ public class ExportExcelUtils {
         return value.trim();
     }
 
+    public String getCellValue2(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) {
+                            if (date.getHours() > 0 || date.getMinutes() > 0) {
+                                value = new SimpleDateFormat(DateUtils.NEW_FORMAT2).format(date);
+                            } else {
+                                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();
+    }
+
     public void putHeaders(XSSFWorkbook workbook, int sheetNum, String sheetTitle, String[] headers) {
         // 生成一个表格
         XSSFSheet sheet = workbook.createSheet();

+ 179 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAccountsController.java

@@ -0,0 +1,179 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAccounts;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAccountsService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-01
+ */
+@Slf4j
+@Api(tags = "直播数据——操作记录表")
+@RestController
+@RequestMapping("/liveData/accounts")
+public class LiveDataAccountsController {
+    @Autowired
+    private ILiveDataAccountsService liveDataAccountsService;
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataAccounts>> queryPageList(LiveDataAccounts liveDataAccounts,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<LiveDataAccounts>> result = new Result<>();
+        QueryWrapper<LiveDataAccounts> queryWrapper = QueryGenerator.initQueryWrapper(liveDataAccounts, req.getParameterMap());
+        Page<LiveDataAccounts> page = new Page<LiveDataAccounts>(pageNo, pageSize);
+        if (!Check.isNull(liveDataAccounts.getLiveAccountId())) {
+            queryWrapper.like("live_account_id", liveDataAccounts.getLiveAccountId());
+        }
+        if (!Check.isNull(liveDataAccounts.getLiveAccountName())) {
+            queryWrapper.like("live_account_name", liveDataAccounts.getLiveAccountName());
+        }
+        if (!Check.isNull(liveDataAccounts.getLiveAccountType())) {
+            queryWrapper.eq("live_account_type", liveDataAccounts.getLiveAccountType());
+        }
+        if (!Check.isNull(liveDataAccounts.getProductName())) {
+            queryWrapper.like("product_name", liveDataAccounts.getProductName());
+        }
+        if (!Check.isNull(liveDataAccounts.getProductId())) {
+            queryWrapper.like("product_id", liveDataAccounts.getProductId());
+        }
+        if (Check.isNull(liveDataAccounts.getState())) {
+            queryWrapper.eq("state", 1);
+        } else {
+            queryWrapper.eq("state", liveDataAccounts.getState());
+        }
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataAccounts> pageList = liveDataAccountsService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加直播账户
+     */
+    @PostMapping(value = "/add")
+    public Result<Object> add(@RequestBody LiveDataAccounts liveDataAccounts) {
+        try {
+            if (Check.isNull(liveDataAccounts.getLiveAccountId())) {
+                return Result.ok("缺少数据,请输入账户ID");
+            } else if (Check.isNull(liveDataAccounts.getLiveAccountName())) {
+                return Result.ok("缺少数据,请输入账户名称");
+            }
+            LiveDataAccounts accounts = liveDataAccountsService.getById(liveDataAccounts.getLiveAccountId());
+            if (!Check.isNull(accounts)) {
+                return Result.ok("该账户ID已注册,账户名:" + accounts.getLiveAccountName());
+            }
+            QueryWrapper<LiveDataAccounts> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("live_account_name", liveDataAccounts.getLiveAccountName());
+            queryWrapper.eq("state", "1").last("limit 1");
+            LiveDataAccounts one = liveDataAccountsService.getOne(queryWrapper);
+            if (!Check.isNull(one)) {
+                return Result.ok("该账户名称已存在,请重新命名");
+            }
+            liveDataAccounts.setStatDate(DateUtils.date2Str());
+            liveDataAccountsService.save(liveDataAccounts);
+            recordService.addImportRecord(liveDataAccounts.getLiveAccountId(), 101, liveDataAccounts.getUserId());
+            return Result.ok("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            return Result.error("操作失败");
+        }
+    }
+
+    /**
+     * 修改直播账户
+     */
+    @PostMapping(value = "/edit")
+    public Result<Object> edit(@RequestBody LiveDataAccounts liveDataAccounts) {
+        if (Check.isNull(liveDataAccounts.getLiveAccountId())) {
+            return Result.ok("缺少数据,请输入账户ID");
+        }
+        LiveDataAccounts accounts = liveDataAccountsService.getById(liveDataAccounts.getLiveAccountId());
+        if (Check.isNull(accounts)) {
+            return Result.ok("修改失败,未找到该账户");
+        }
+        if (!Check.isNull(liveDataAccounts.getLiveAccountName())) {
+            QueryWrapper<LiveDataAccounts> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("live_account_name", liveDataAccounts.getLiveAccountName());
+            queryWrapper.eq("state", 1).last("limit 1");
+            LiveDataAccounts one = liveDataAccountsService.getOne(queryWrapper);
+            if (!Check.isNull(one) && one.getLiveAccountId() != liveDataAccounts.getLiveAccountId()) {
+                return Result.ok("修改失败,该账户名称已存在,请重新命名");
+            }
+        }
+        liveDataAccountsService.updateById(liveDataAccounts);
+        recordService.addImportRecord(liveDataAccounts.getLiveAccountId(), 103, liveDataAccounts.getUserId());
+        return Result.ok("修改成功!");
+    }
+
+    /**
+     * 通过id删除
+     */
+    @GetMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "liveAccountId") String liveAccountId, String userId) {
+        try {
+            LiveDataAccounts accounts = liveDataAccountsService.getById(liveAccountId);
+            if (!Check.isNull(accounts)) {
+                accounts.setState("0");
+                liveDataAccountsService.updateById(accounts);
+                //TODO 其他7个表 修改状态,页面不可查看
+                recordService.addImportRecord(accounts.getLiveAccountId(), 102, userId);
+            }
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "直播数据——操作记录表-通过id查询", notes = "直播数据——操作记录表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataAccounts> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataAccounts> result = new Result<>();
+        LiveDataAccounts liveDataAccounts = liveDataAccountsService.getById(id);
+        if (liveDataAccounts == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataAccounts);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+}

+ 119 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAdController.java

@@ -0,0 +1,119 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAd;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAdService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 直播数据——广告人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Slf4j
+@Api(tags = "直播数据——广告人群报表")
+@RestController
+@RequestMapping("/liveData/ad")
+public class LiveDataAdController {
+    @Autowired
+    private ILiveDataAdService liveDataAdService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataAd>> queryPageList(LiveDataAd liveDataAd,
+                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                   HttpServletRequest req) {
+        Result<IPage<LiveDataAd>> result = new Result<>();
+        QueryWrapper<LiveDataAd> queryWrapper = QueryGenerator.initQueryWrapper(liveDataAd, req.getParameterMap());
+        Page<LiveDataAd> page = new Page<LiveDataAd>(pageNo, pageSize);
+        if (!Check.isNull(liveDataAd.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataAd.getAccountId());
+        }
+        if (!Check.isNull(liveDataAd.getLiveStartTime())) {
+            queryWrapper.gt("live_start_time", liveDataAd.getLiveStartTime());
+        }
+
+        if (!Check.isNull(liveDataAd.getLiveEndTime())) {
+            queryWrapper.lt("live_end_time", liveDataAd.getLiveEndTime());
+        }
+
+        if (!Check.isNull(liveDataAd.getLiveId())) {
+            queryWrapper.eq("live_id", liveDataAd.getLiveId());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataAd> pageList = liveDataAdService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, String statMonth, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId) || Check.isNull(statMonth)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataAdService.importExcel(accountId, statMonth, file);
+            recordService.addImportRecord(accountId, 7, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 通过id查询
+     */
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataAd> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataAd> result = new Result<>();
+        LiveDataAd liveDataAd = liveDataAdService.getById(id);
+        if (liveDataAd == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataAd);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+}

+ 135 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataAgeController.java

@@ -0,0 +1,135 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAge;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAgeService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播数据——各年龄段人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Slf4j
+@Api(tags = "直播数据——各年龄段人群报表")
+@RestController
+@RequestMapping("/liveData/age")
+public class LiveDataAgeController {
+    @Autowired
+    private ILiveDataAgeService liveDataAgeService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataAge>> queryPageList(LiveDataAge liveDataAge,
+                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                    HttpServletRequest req) {
+        Result<IPage<LiveDataAge>> result = new Result<>();
+        QueryWrapper<LiveDataAge> queryWrapper = QueryGenerator.initQueryWrapper(liveDataAge, req.getParameterMap());
+        Page<LiveDataAge> page = new Page<LiveDataAge>(pageNo, pageSize);
+        if (!Check.isNull(liveDataAge.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataAge.getAccountId());
+        }
+        if (!Check.isNull(liveDataAge.getStatMonth())) {
+            queryWrapper.eq("stat_month", liveDataAge.getStatMonth());
+        }
+        if (!Check.isNull(liveDataAge.getAge())) {
+            queryWrapper.eq("age", liveDataAge.getAge());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataAge> pageList = liveDataAgeService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, String statMonth, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId) || Check.isNull(statMonth)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataAgeService.importExcel(accountId, statMonth, file);
+            recordService.addImportRecord(accountId, 4, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 通过id查询
+     */
+    @ApiOperation(value = "直播数据——各年龄段人群报表-通过id查询", notes = "直播数据——各年龄段人群报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataAge> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataAge> result = new Result<>();
+        LiveDataAge liveDataAge = liveDataAgeService.getById(id);
+        if (liveDataAge == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataAge);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 116 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataGenderController.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataGender;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataGenderService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 直播数据——性别人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Slf4j
+@Api(tags = "直播数据——性别人群报表")
+@RestController
+@RequestMapping("/liveData/gender")
+public class LiveDataGenderController {
+    @Autowired
+    private ILiveDataGenderService liveDataGenderService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataGender>> queryPageList(LiveDataGender liveDataGender,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<LiveDataGender>> result = new Result<>();
+        QueryWrapper<LiveDataGender> queryWrapper = QueryGenerator.initQueryWrapper(liveDataGender, req.getParameterMap());
+        Page<LiveDataGender> page = new Page<LiveDataGender>(pageNo, pageSize);
+        if (!Check.isNull(liveDataGender.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataGender.getAccountId());
+        }
+        if (!Check.isNull(liveDataGender.getStatMonth())) {
+            queryWrapper.eq("stat_month", liveDataGender.getStatMonth());
+        }
+        if (!Check.isNull(liveDataGender.getGender())) {
+            queryWrapper.eq("gender", liveDataGender.getGender());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataGender> pageList = liveDataGenderService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, String statMonth, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId) || Check.isNull(statMonth)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataGenderService.importExcel(accountId, statMonth, file);
+            recordService.addImportRecord(accountId, 5, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 通过id查询
+     */
+    @ApiOperation(value = "直播数据——性别人群报表-通过id查询", notes = "直播数据——性别人群报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataGender> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataGender> result = new Result<>();
+        LiveDataGender liveDataGender = liveDataGenderService.getById(id);
+        if (liveDataGender == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataGender);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+}

+ 77 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataImportRecordController.java

@@ -0,0 +1,77 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataImportRecord;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 直播数据——操作记录表
+ */
+@Slf4j
+@Api(tags = "直播数据——操作记录表")
+@RestController
+@RequestMapping("/liveData/importRecord")
+public class LiveDataImportRecordController {
+    @Autowired
+    private ILiveDataImportRecordService liveDataImportRecordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataImportRecord>> queryPageList(LiveDataImportRecord liveDataImportRecord,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+        Result<IPage<LiveDataImportRecord>> result = new Result<>();
+        QueryWrapper<LiveDataImportRecord> queryWrapper = QueryGenerator.initQueryWrapper(liveDataImportRecord, req.getParameterMap());
+        Page<LiveDataImportRecord> page = new Page<LiveDataImportRecord>(pageNo, pageSize);
+        if (!Check.isNull(liveDataImportRecord.getAccountId())) {
+                queryWrapper.eq("account_id", liveDataImportRecord.getAccountId());
+        }
+        if (!Check.isNull(liveDataImportRecord.getStatDate())) {
+            queryWrapper.eq("stat_date", liveDataImportRecord.getStatDate());
+        }
+        if (!Check.isNull(liveDataImportRecord.getType())) {
+            queryWrapper.eq("type", liveDataImportRecord.getType());
+        }
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataImportRecord> pageList = liveDataImportRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     */
+    @PostMapping(value = "/add")
+    public Result<LiveDataImportRecord> add(@RequestBody LiveDataImportRecord liveDataImportRecord) {
+        Result<LiveDataImportRecord> result = new Result<>();
+        try {
+            liveDataImportRecordService.save(liveDataImportRecord);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+}

+ 121 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataMaterialController.java

@@ -0,0 +1,121 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataMaterial;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataMaterialService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 直播数据——素材报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-03-30
+ */
+@Slf4j
+@Api(tags = "直播数据——素材报表")
+@RestController
+@RequestMapping("/liveData/material")
+public class LiveDataMaterialController {
+    @Autowired
+    private ILiveDataMaterialService liveDataMaterialService;
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataMaterial>> queryPageList(LiveDataMaterial liveDataMaterial,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<LiveDataMaterial>> result = new Result<>();
+        QueryWrapper<LiveDataMaterial> queryWrapper = QueryGenerator.initQueryWrapper(liveDataMaterial, req.getParameterMap());
+        if (!Check.isNull(liveDataMaterial.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataMaterial.getAccountId());
+        }
+        if (!Check.isNull(liveDataMaterial.getStartTime())) {
+            queryWrapper.gt("stat_date", liveDataMaterial.getStartTime());
+        }
+
+        if (!Check.isNull(liveDataMaterial.getEndTime())) {
+            queryWrapper.lt("stat_date", liveDataMaterial.getEndTime());
+        }
+
+        if (!Check.isNull(liveDataMaterial.getVideoId())) {
+            queryWrapper.like("video_id", liveDataMaterial.getVideoId());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        Page<LiveDataMaterial> page = new Page<LiveDataMaterial>(pageNo, pageSize);
+        IPage<LiveDataMaterial> pageList = liveDataMaterialService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importItemExcel(HttpServletResponse response, String userId, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataMaterialService.importItemExcel(accountId, file);
+            recordService.addImportRecord(accountId, 1, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "直播数据——素材报表-通过id查询", notes = "直播数据——素材报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataMaterial> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataMaterial> result = new Result<>();
+        LiveDataMaterial liveDataMaterial = liveDataMaterialService.getById(id);
+        if (liveDataMaterial == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataMaterial);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 116 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataPriceController.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataPrice;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataPriceService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 直播数据——设备价格人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Slf4j
+@Api(tags = "直播数据——设备价格人群报表")
+@RestController
+@RequestMapping("/liveData/price")
+public class LiveDataPriceController {
+    @Autowired
+    private ILiveDataPriceService liveDataPriceService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataPrice>> queryPageList(LiveDataPrice liveDataPrice,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<LiveDataPrice>> result = new Result<>();
+        QueryWrapper<LiveDataPrice> queryWrapper = QueryGenerator.initQueryWrapper(liveDataPrice, req.getParameterMap());
+        Page<LiveDataPrice> page = new Page<LiveDataPrice>(pageNo, pageSize);
+        if (!Check.isNull(liveDataPrice.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataPrice.getAccountId());
+        }
+        if (!Check.isNull(liveDataPrice.getStatMonth())) {
+            queryWrapper.eq("stat_month", liveDataPrice.getStatMonth());
+        }
+        if (!Check.isNull(liveDataPrice.getPrice())) {
+            queryWrapper.eq("price", liveDataPrice.getPrice());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataPrice> pageList = liveDataPriceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, String statMonth, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId) || Check.isNull(statMonth)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataPriceService.importExcel(accountId, statMonth, file);
+            recordService.addImportRecord(accountId, 6, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+    /**
+     * 通过id查询
+     */
+    @ApiOperation(value = "直播数据——设备价格人群报表-通过id查询", notes = "直播数据——设备价格人群报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataPrice> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataPrice> result = new Result<>();
+        LiveDataPrice liveDataPrice = liveDataPriceService.getById(id);
+        if (liveDataPrice == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataPrice);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+}

+ 117 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataProvinceController.java

@@ -0,0 +1,117 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataProvince;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataProvinceService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 直播数据——省份人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Slf4j
+@Api(tags = "直播数据——省份人群报表")
+@RestController
+@RequestMapping("/liveData/province")
+public class LiveDataProvinceController {
+    @Autowired
+    private ILiveDataProvinceService liveDataProvinceService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataProvince>> queryPageList(LiveDataProvince liveDataProvince,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<LiveDataProvince>> result = new Result<>();
+        QueryWrapper<LiveDataProvince> queryWrapper = QueryGenerator.initQueryWrapper(liveDataProvince, req.getParameterMap());
+        if (!Check.isNull(liveDataProvince.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataProvince.getAccountId());
+        }
+        if (!Check.isNull(liveDataProvince.getStatMonth())) {
+            queryWrapper.eq("stat_month", liveDataProvince.getStatMonth());
+        }
+        if (!Check.isNull(liveDataProvince.getProvince())) {
+            queryWrapper.eq("province", liveDataProvince.getProvince());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        Page<LiveDataProvince> page = new Page<LiveDataProvince>(pageNo, pageSize);
+        IPage<LiveDataProvince> pageList = liveDataProvinceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, String statMonth, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId) || Check.isNull(statMonth)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataProvinceService.importExcel(accountId, statMonth, file);
+            recordService.addImportRecord(accountId, 3, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+    /**
+     * 通过id查询
+     */
+    @ApiOperation(value = "直播数据——省份人群报表-通过id查询", notes = "直播数据——省份人群报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataProvince> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataProvince> result = new Result<>();
+        LiveDataProvince liveDataProvince = liveDataProvinceService.getById(id);
+        if (liveDataProvince == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataProvince);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+
+}

+ 251 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/controller/LiveDataTouchController.java

@@ -0,0 +1,251 @@
+package cn.com.ctop.kuaishou.modules.live.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataTouch;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataTouchService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 直播数据——触达人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-02
+ */
+@Slf4j
+@Api(tags = "直播数据——触达人群报表")
+@RestController
+@RequestMapping("/liveData/touch")
+public class LiveDataTouchController {
+    @Autowired
+    private ILiveDataTouchService liveDataTouchService;
+
+    @Autowired
+    private ILiveDataImportRecordService recordService;
+
+    /**
+     * 分页列表查询
+     */
+    @GetMapping(value = "/list")
+    public Result<IPage<LiveDataTouch>> queryPageList(LiveDataTouch liveDataTouch,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<LiveDataTouch>> result = new Result<>();
+        QueryWrapper<LiveDataTouch> queryWrapper = QueryGenerator.initQueryWrapper(liveDataTouch, req.getParameterMap());
+        Page<LiveDataTouch> page = new Page<LiveDataTouch>(pageNo, pageSize);
+        if (!Check.isNull(liveDataTouch.getAccountId())) {
+            queryWrapper.eq("account_id", liveDataTouch.getAccountId());
+        }
+        if (!Check.isNull(liveDataTouch.getStartTime())) {
+            queryWrapper.gt("stat_date", liveDataTouch.getStartTime());
+        }
+
+        if (!Check.isNull(liveDataTouch.getEndTime())) {
+            queryWrapper.lt("stat_date", liveDataTouch.getEndTime());
+        }
+
+        if (!Check.isNull(liveDataTouch.getFanStrat())) {
+            queryWrapper.like("fan_strat", liveDataTouch.getFanStrat());
+        }
+
+        if (!Check.isNull(liveDataTouch.getCustomerStrat())) {
+            queryWrapper.like("cstomer_strat", liveDataTouch.getCustomerStrat());
+        }
+        queryWrapper.eq("state", 1);
+        queryWrapper.orderByDesc("create_time");
+        IPage<LiveDataTouch> pageList = liveDataTouchService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 导入EXCEL批量创建
+     */
+    @PostMapping(value = "/importExcel")
+    @ResponseBody
+    public Result<Object> importExcel(HttpServletResponse response, String userId, Long accountId, @RequestParam("file") MultipartFile file) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        try {
+            if (Check.isNull(file)) {
+                return Result.error("执行失败,请上传应用Excel文件");
+            }
+            if (Check.isNull(accountId) || Check.isNull(userId)) {
+                return Result.error("缺少参数");
+            }
+            Result<Object> result = liveDataTouchService.importExcel(accountId, file);
+            recordService.addImportRecord(accountId, 2, userId);
+            return result;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("导入EXCEL失败," + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param liveDataTouch
+     * @return
+     */
+    @PostMapping(value = "/add")
+    public Result<LiveDataTouch> add(@RequestBody LiveDataTouch liveDataTouch) {
+        Result<LiveDataTouch> result = new Result<>();
+        try {
+            liveDataTouchService.save(liveDataTouch);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param liveDataTouch
+     * @return
+     */
+    @ApiOperation(value = "直播数据——触达人群报表-编辑", notes = "直播数据——触达人群报表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<LiveDataTouch> edit(@RequestBody LiveDataTouch liveDataTouch) {
+        Result<LiveDataTouch> result = new Result<LiveDataTouch>();
+        LiveDataTouch liveDataTouchEntity = liveDataTouchService.getById(liveDataTouch.getId());
+        if (liveDataTouchEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = liveDataTouchService.updateById(liveDataTouch);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "直播数据——触达人群报表-通过id删除", notes = "直播数据——触达人群报表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            liveDataTouchService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "直播数据——触达人群报表-批量删除", notes = "直播数据——触达人群报表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<LiveDataTouch> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<LiveDataTouch> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.liveDataTouchService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "直播数据——触达人群报表-通过id查询", notes = "直播数据——触达人群报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<LiveDataTouch> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<LiveDataTouch> result = new Result<>();
+        LiveDataTouch liveDataTouch = liveDataTouchService.getById(id);
+        if (liveDataTouch == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(liveDataTouch);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<LiveDataTouch> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                LiveDataTouch liveDataTouch = JSON.parseObject(deString, LiveDataTouch.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(liveDataTouch, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<LiveDataTouch> pageList = liveDataTouchService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "直播数据——触达人群报表列表");
+        mv.addObject(NormalExcelConstants.CLASS, LiveDataTouch.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("直播数据——触达人群报表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+}

+ 88 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAccounts.java

@@ -0,0 +1,88 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-01
+ */
+@Data
+@TableName("ctop_live_data_accounts")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_accounts对象", description = "直播数据——操作记录表")
+public class LiveDataAccounts {
+
+    /**
+     * 直播账户id
+     */
+    @TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "直播账户id")
+    private Long liveAccountId;
+    /**
+     * 直播账户名称
+     */
+    @Excel(name = "直播账户名称", width = 15)
+    @ApiModelProperty(value = "直播账户名称")
+    private String liveAccountName;
+    /**
+     * 直播账户类型
+     */
+    @Excel(name = "直播账户类型", width = 15)
+    @ApiModelProperty(value = "直播账户类型")
+    private String liveAccountType;
+
+    /**
+     * 直播账户类型
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private String state;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 产品id
+     */
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "产品id")
+    private Long productId;
+    /**
+     * 产品名
+     */
+    @Excel(name = "产品名", width = 15)
+    @ApiModelProperty(value = "产品名")
+    private String productName;
+
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String userId;
+
+}

+ 165 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAd.java

@@ -0,0 +1,165 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——广告人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Data
+@TableName("ctop_live_data_ad")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_ad对象", description = "直播数据——广告人群报表")
+public class LiveDataAd {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 直播Id
+     */
+    @Excel(name = "直播Id", width = 15)
+    @ApiModelProperty(value = "直播Id")
+    private String liveId;
+    /**
+     * 快手号
+     */
+    @Excel(name = "快手号", width = 15)
+    @ApiModelProperty(value = "快手号")
+    private String kuaishouName;
+    /**
+     * 直播开始时间
+     */
+    @Excel(name = "直播开始时间", width = 15)
+    @ApiModelProperty(value = "直播开始时间")
+    private String liveStartTime;
+    /**
+     * 直播结束时间
+     */
+    @Excel(name = "直播结束时间", width = 15)
+    @ApiModelProperty(value = "直播结束时间")
+    private String liveEndTime;
+    /**
+     * 直播持续时间(分钟)
+     */
+    @Excel(name = "直播持续时间(分钟)", width = 15)
+    @ApiModelProperty(value = "直播持续时间(分钟)")
+    private Long liveDuration;
+    /**
+     * 主播id
+     */
+    @Excel(name = "主播id", width = 15)
+    @ApiModelProperty(value = "主播id")
+    private String anchorId;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private String charge;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 直播平均观看时长
+     */
+    @Excel(name = " 直播平均观看时长", width = 15)
+    @ApiModelProperty(value = " 直播平均观看时长")
+    private String liveWatchAverageTime;
+    /**
+     * 直播间评论数
+     */
+    @Excel(name = "直播间评论数", width = 15)
+    @ApiModelProperty(value = "直播间评论数")
+    private Long liveComments;
+    /**
+     * 直播间分享数
+     */
+    @Excel(name = "直播间分享数", width = 15)
+    @ApiModelProperty(value = "直播间分享数")
+    private Long liveShares;
+    /**
+     * 直播间送礼数
+     */
+    @Excel(name = "直播间送礼数", width = 15)
+    @ApiModelProperty(value = "直播间送礼数")
+    private Long liveGifts;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 涨粉成本
+     */
+    @Excel(name = "涨粉成本", width = 15)
+    @ApiModelProperty(value = "涨粉成本")
+    private String liveFansCost;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直接订单数
+     */
+    @Excel(name = " 直接订单数", width = 15)
+    @ApiModelProperty(value = " 直接订单数")
+    private Long liveOrderCount;
+    /**
+     * 直接GMV
+     */
+    @Excel(name = "直接GMV", width = 15)
+    @ApiModelProperty(value = "直接GMV")
+    private String liveGmv;
+    /**
+     * 直接ROI
+     */
+    @Excel(name = "直接ROI", width = 15)
+    @ApiModelProperty(value = "直接ROI")
+    private String liveRoi;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 177 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataAge.java

@@ -0,0 +1,177 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 直播数据——各年龄段人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Data
+@TableName("ctop_live_data_age")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_age对象", description = "直播数据——各年龄段人群报表")
+public class LiveDataAge {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 月份
+     */
+    @Excel(name = "月份", width = 15)
+    @ApiModelProperty(value = "月份")
+    private String statMonth;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 年龄段
+     */
+    @Excel(name = "年龄段", width = 15)
+    @ApiModelProperty(value = "年龄段")
+    private String age;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private String charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long shows;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private String actionRatio;
+    /**
+     * 直播间商品点击数
+     */
+    @Excel(name = "直播间商品点击数", width = 15)
+    @ApiModelProperty(value = "直播间商品点击数")
+    private Long productClick;
+    /**
+     * 作品点赞数
+     */
+    @Excel(name = "作品点赞数", width = 15)
+    @ApiModelProperty(value = "作品点赞数")
+    private Long likes;
+    /**
+     * 作品分享数
+     */
+    @Excel(name = "作品分享数", width = 15)
+    @ApiModelProperty(value = "作品分享数")
+    private Long shares;
+    /**
+     * 作品评论数
+     */
+    @Excel(name = "作品评论数", width = 15)
+    @ApiModelProperty(value = "作品评论数")
+    private Long comments;
+    /**
+     * 作品3秒播放数
+     */
+    @Excel(name = "作品3秒播放数", width = 15)
+    @ApiModelProperty(value = "作品3秒播放数")
+	@TableField(value = "play_3s_count")
+    private Long play3sCount;
+    /**
+     * 预约成功数
+     */
+    @Excel(name = "预约成功数", width = 15)
+    @ApiModelProperty(value = "预约成功数")
+    private Long eventAppointSuccess;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直播观看成本
+     */
+    @Excel(name = " 直播观看成本", width = 15)
+    @ApiModelProperty(value = " 直播观看成本")
+    private String liveWatchCost;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 涨粉成本
+     */
+    @Excel(name = "涨粉成本", width = 15)
+    @ApiModelProperty(value = "涨粉成本")
+    private String liveFansCost;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 174 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataGender.java

@@ -0,0 +1,174 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——性别人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Data
+@TableName("ctop_live_data_gender")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_gender对象", description = "直播数据——性别人群报表")
+public class LiveDataGender {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 月份
+     */
+    @Excel(name = "月份", width = 15)
+    @ApiModelProperty(value = "月份")
+    private String statMonth;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", width = 15)
+    @ApiModelProperty(value = "性别")
+    private String gender;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private String charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long shows;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private String actionRatio;
+    /**
+     * 直播间商品点击数
+     */
+    @Excel(name = "直播间商品点击数", width = 15)
+    @ApiModelProperty(value = "直播间商品点击数")
+    private Long productClick;
+    /**
+     * 作品点赞数
+     */
+    @Excel(name = "作品点赞数", width = 15)
+    @ApiModelProperty(value = "作品点赞数")
+    private Long likes;
+    /**
+     * 作品分享数
+     */
+    @Excel(name = "作品分享数", width = 15)
+    @ApiModelProperty(value = "作品分享数")
+    private Long shares;
+    /**
+     * 作品评论数
+     */
+    @Excel(name = "作品评论数", width = 15)
+    @ApiModelProperty(value = "作品评论数")
+    private Long comments;
+    /**
+     * 作品3秒播放数
+     */
+    @Excel(name = "作品3秒播放数", width = 15)
+    @ApiModelProperty(value = "作品3秒播放数")
+    @TableField(value = "play_3s_count")
+    private Long play3sCount;
+    /**
+     * 预约成功数
+     */
+    @Excel(name = "预约成功数", width = 15)
+    @ApiModelProperty(value = "预约成功数")
+    private Long eventAppointSuccess;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直播观看成本
+     */
+    @Excel(name = " 直播观看成本", width = 15)
+    @ApiModelProperty(value = " 直播观看成本")
+    private String liveWatchCost;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 涨粉成本
+     */
+    @Excel(name = "涨粉成本", width = 15)
+    @ApiModelProperty(value = "涨粉成本")
+    private String liveFansCost;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 69 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataImportRecord.java

@@ -0,0 +1,69 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-01
+ */
+@Data
+@TableName("ctop_live_data_import_record")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_import_record对象", description = "直播数据——操作记录表")
+public class LiveDataImportRecord {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 操作人id
+     */
+    @Excel(name = "操作人id", width = 15)
+    @ApiModelProperty(value = "操作人id")
+    private String userId;
+    /**
+     * 操作类型 1素材、2触达人群、3省份人群、4年龄段人群、5性别人群、6设备价格、7广告,101新增账户,102删除账户,103修改账户
+     */
+    @Excel(name = "操作类型 1素材、2触达人群、3省份人群、4年龄段人群、5性别人群、6设备价格、7广告,101新增账户,102删除账户,103修改账户", width = 15)
+    @ApiModelProperty(value = "操作类型 1素材、2触达人群、3省份人群、4年龄段人群、5性别人群、6设备价格、7广告,101新增账户,102删除账户,103修改账户")
+    private Integer type;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 232 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataMaterial.java

@@ -0,0 +1,232 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——素材报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-03-30
+ */
+@Data
+@TableName("ctop_live_data_material")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_material对象", description = "直播数据——素材报表")
+public class LiveDataMaterial {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 广告主id
+     */
+    @Excel(name = "广告主id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    private Long accountId;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 视频ID
+     */
+    @Excel(name = "视频ID", width = 15)
+    @ApiModelProperty(value = "视频ID")
+    private String videoId;
+    /**
+     * 视频ID
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private String state;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private String charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long shows;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private String actionRatio;
+    /**
+     * 作品点赞数
+     */
+    @Excel(name = "作品点赞数", width = 15)
+    @ApiModelProperty(value = "作品点赞数")
+    private Long likes;
+    /**
+     * 作品分享数
+     */
+    @Excel(name = "作品分享数", width = 15)
+    @ApiModelProperty(value = "作品分享数")
+    private Long shares;
+    /**
+     * 作品评论数
+     */
+    @Excel(name = "作品评论数", width = 15)
+    @ApiModelProperty(value = "作品评论数")
+    private Long comments;
+    /**
+     * COS视频URL
+     */
+    @Excel(name = "photoUrl", width = 15)
+    @ApiModelProperty(value = "photoUrl")
+    private String photoUrl;
+    /**
+     * 原始视频URL
+     */
+    @Excel(name = "videoUrl", width = 15)
+    @ApiModelProperty(value = "videoUrl")
+    private String videoUrl;
+    /**
+     * 作品3秒播放数
+     */
+    @Excel(name = "作品3秒播放数", width = 15)
+    @ApiModelProperty(value = "作品3秒播放数")
+    @TableField(value = "play_3s_count")
+    private Long play3sCount;
+    /**
+     * 预约成功数
+     */
+    @Excel(name = "预约成功数", width = 15)
+    @ApiModelProperty(value = "预约成功数")
+    private Long eventAppointSuccess;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直接订单数
+     */
+    @Excel(name = " 直接订单数", width = 15)
+    @ApiModelProperty(value = " 直接订单数")
+    private Long liveOrderCount;
+    /**
+     * 直接GMV
+     */
+    @Excel(name = "直接GMV", width = 15)
+    @ApiModelProperty(value = "直接GMV")
+    private String liveGmv;
+    /**
+     * 直接ROI
+     */
+    @Excel(name = "直接ROI", width = 15)
+    @ApiModelProperty(value = "直接ROI")
+    private String liveRoi;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 次日涨粉留存数
+     */
+    @Excel(name = "次日涨粉留存数", width = 15)
+    @ApiModelProperty(value = "次日涨粉留存数")
+    private Long liveNextDayFans;
+    /**
+     * 次日涨粉留存率
+     */
+    @Excel(name = "次日涨粉留存率", width = 15)
+    @ApiModelProperty(value = "次日涨粉留存率")
+    private String liveNextDayFansRoi;
+    /**
+     * 7日涨粉留存数
+     */
+    @Excel(name = "7日涨粉留存数", width = 15)
+    @ApiModelProperty(value = "7日涨粉留存数")
+    @TableField(value = "live_fans_7d")
+    private Long liveFans7d;
+    /**
+     * 7日涨粉留存率
+     */
+    @Excel(name = "7日涨粉留存率", width = 15)
+    @ApiModelProperty(value = "7日涨粉留存率")
+    @TableField(value = "live_fans_7d_roi")
+    private String liveFans7dRoi;
+    /**
+     * 15日涨粉留存数
+     */
+    @Excel(name = "15日涨粉留存数", width = 15)
+    @ApiModelProperty(value = "15日涨粉留存数")
+    @TableField(value = "live_fans_15d")
+    private Long liveFans15d;
+    /**
+     * 15日涨粉留存率
+     */
+    @Excel(name = "15日涨粉留存率", width = 15)
+    @ApiModelProperty(value = "15日涨粉留存率")
+    @TableField(value = "live_fans_15d_roi")
+    private String liveFans15dRoi;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String endTime;
+
+    @TableField(exist = false)
+    private String startTime;
+
+}

+ 177 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataPrice.java

@@ -0,0 +1,177 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 直播数据——设备价格人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Data
+@TableName("ctop_live_data_price")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_price对象", description = "直播数据——设备价格人群报表")
+public class LiveDataPrice {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 月份
+     */
+    @Excel(name = "月份", width = 15)
+    @ApiModelProperty(value = "月份")
+    private String statMonth;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 设备价格
+     */
+    @Excel(name = "设备价格", width = 15)
+    @ApiModelProperty(value = "设备价格")
+    private String price;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private String charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long shows;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private String actionRatio;
+    /**
+     * 直播间商品点击数
+     */
+    @Excel(name = "直播间商品点击数", width = 15)
+    @ApiModelProperty(value = "直播间商品点击数")
+    private Long productClick;
+    /**
+     * 作品点赞数
+     */
+    @Excel(name = "作品点赞数", width = 15)
+    @ApiModelProperty(value = "作品点赞数")
+    private Long likes;
+    /**
+     * 作品分享数
+     */
+    @Excel(name = "作品分享数", width = 15)
+    @ApiModelProperty(value = "作品分享数")
+    private Long shares;
+    /**
+     * 作品评论数
+     */
+    @Excel(name = "作品评论数", width = 15)
+    @ApiModelProperty(value = "作品评论数")
+    private Long comments;
+    /**
+     * 作品3秒播放数
+     */
+    @Excel(name = "作品3秒播放数", width = 15)
+    @ApiModelProperty(value = "作品3秒播放数")
+    @TableField(value = "play_3s_count")
+    private Long play3sCount;
+    /**
+     * 预约成功数
+     */
+    @Excel(name = "预约成功数", width = 15)
+    @ApiModelProperty(value = "预约成功数")
+    private Long eventAppointSuccess;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直播观看成本
+     */
+    @Excel(name = " 直播观看成本", width = 15)
+    @ApiModelProperty(value = " 直播观看成本")
+    private String liveWatchCost;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 涨粉成本
+     */
+    @Excel(name = "涨粉成本", width = 15)
+    @ApiModelProperty(value = "涨粉成本")
+    private String liveFansCost;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 173 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataProvince.java

@@ -0,0 +1,173 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——省份人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-06
+ */
+@Data
+@TableName("ctop_live_data_province")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_province对象", description = "直播数据——省份人群报表")
+public class LiveDataProvince {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 月份
+     */
+    @Excel(name = "月份", width = 15)
+    @ApiModelProperty(value = "月份")
+    private String statMonth;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 省份
+     */
+    @Excel(name = "省份", width = 15)
+    @ApiModelProperty(value = "省份")
+    private String province;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private String charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long shows;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private String photoClickRatio;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private String actionRatio;
+    /**
+     * 直播间商品点击数
+     */
+    @Excel(name = "直播间商品点击数", width = 15)
+    @ApiModelProperty(value = "直播间商品点击数")
+    private Long productClick;
+    /**
+     * 作品点赞数
+     */
+    @Excel(name = "作品点赞数", width = 15)
+    @ApiModelProperty(value = "作品点赞数")
+    private Long likes;
+    /**
+     * 作品分享数
+     */
+    @Excel(name = "作品分享数", width = 15)
+    @ApiModelProperty(value = "作品分享数")
+    private Long shares;
+    /**
+     * 作品评论数
+     */
+    @Excel(name = "作品评论数", width = 15)
+    @ApiModelProperty(value = "作品评论数")
+    private Long comments;
+    /**
+     * 作品3秒播放数
+     */
+    @Excel(name = "作品3秒播放数", width = 15)
+    @ApiModelProperty(value = "作品3秒播放数")
+    @TableField(value = "play_3s_count")
+    private Long play3sCount;
+    /**
+     * 预约成功数
+     */
+    @Excel(name = "预约成功数", width = 15)
+    @ApiModelProperty(value = "预约成功数")
+    private Long eventAppointSuccess;
+    /**
+     * 直播观看数
+     */
+    @Excel(name = " 直播观看数", width = 15)
+    @ApiModelProperty(value = " 直播观看数")
+    private Long liveWatchCount;
+    /**
+     * 直播观看成本
+     */
+    @Excel(name = " 直播观看成本", width = 15)
+    @ApiModelProperty(value = " 直播观看成本")
+    private String liveWatchCost;
+    /**
+     * 涨粉数
+     */
+    @Excel(name = "涨粉数", width = 15)
+    @ApiModelProperty(value = "涨粉数")
+    private Long liveFans;
+    /**
+     * 涨粉成本
+     */
+    @Excel(name = "涨粉成本", width = 15)
+    @ApiModelProperty(value = "涨粉成本")
+    private String liveFansCost;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 142 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/entity/LiveDataTouch.java

@@ -0,0 +1,142 @@
+package cn.com.ctop.kuaishou.modules.live.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 直播数据——触达人群报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-04-02
+ */
+@Data
+@TableName("ctop_live_data_touch")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_live_data_touch对象", description = "直播数据——触达人群报表")
+public class LiveDataTouch {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private String statDate;
+    /**
+     * 状态,0无效,1有效
+     */
+    @Excel(name = "状态,0无效,1有效", width = 15)
+    @ApiModelProperty(value = "状态,0无效,1有效")
+    private Integer state;
+    /**
+     * 粉丝分层
+     */
+    @Excel(name = "粉丝分层", width = 15)
+    @ApiModelProperty(value = "粉丝分层")
+    private String fanStrat;
+    /**
+     * 客群分层
+     */
+    @Excel(name = "客群分层", width = 15)
+    @ApiModelProperty(value = "客群分层")
+    private String customerStrat;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private String charge;
+    /**
+     * 当日累计GMV
+     */
+    @Excel(name = "当日累计GMV", width = 15)
+    @ApiModelProperty(value = "当日累计GMV")
+    private String todayCumulativeGmv;
+    /**
+     * 当日累计ROI
+     */
+    @Excel(name = "当日累计ROI", width = 15)
+    @ApiModelProperty(value = "当日累计ROI")
+    private String todayCumulativeRoi;
+    /**
+     * 当日累计订单数
+     */
+    @Excel(name = " 当日累计订单数", width = 15)
+    @ApiModelProperty(value = " 当日累计订单数")
+    private Long todayCumulativeOrderCount;
+    /**
+     * 曝光用户数
+     */
+    @Excel(name = "曝光用户数", width = 15)
+    @ApiModelProperty(value = "曝光用户数")
+    private Long showUsers;
+    /**
+     * 购买用户数
+     */
+    @Excel(name = "购买用户数", width = 15)
+    @ApiModelProperty(value = "购买用户数")
+    private Long buyUsers;
+    /**
+     * 购买转化率
+     */
+    @Excel(name = "购买转化率", width = 15)
+    @ApiModelProperty(value = "购买转化率")
+    private String buyRatio;
+    /**
+     * ARPU
+     */
+    @Excel(name = "ARPU", width = 15)
+    @ApiModelProperty(value = "ARPU")
+    private String arpu;
+    /**
+     * UV价值
+     */
+    @Excel(name = "UV价值", width = 15)
+    @ApiModelProperty(value = "UV价值")
+    private String uv;
+    /**
+     * 单均价
+     */
+    @Excel(name = "单均价", width = 15)
+    @ApiModelProperty(value = "单均价")
+    private String averagePrice;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String endTime;
+
+    @TableField(exist = false)
+    private String startTime;
+}

+ 78 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/AdEnum.java

@@ -0,0 +1,78 @@
+package cn.com.ctop.kuaishou.modules.live.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 直播数据——广告报表 字段枚举,
+ * 用于锁定EXCEL顺序不同时的字段与数据的对应关系
+ */
+public enum AdEnum {
+    PARAMETER0("liveId", "直播id"),
+    PARAMETER1("kuaishouName", "快手号"),
+    PARAMETER2("liveStartTime", "直播开始时间"),
+    PARAMETER3("liveEndTime", "直播结束时间"),
+    PARAMETER4("liveDuration", "直播持续时间(分钟)"),
+    PARAMETER5("anchorId", "主播id"),
+    PARAMETER6("charge", "花费"),
+    PARAMETER8("bclick", "行为数"),
+    PARAMETER7("liveWatchAverageTime", "直播平均观看时长"),
+    PARAMETER9("liveComments", "直播间评论数"),
+    PARAMETER10("liveShares", "直播间分享数"),
+    PARAMETER11("liveGifts", "直播间送礼数"),
+    PARAMETER12("liveFans", "涨粉数"),
+    PARAMETER13("liveFansCost", "涨粉成本"),
+    PARAMETER14("liveWatchCount", "直播观看数"),
+    PARAMETER15("liveOrderCount", "直接订单数"),
+    PARAMETER16("liveGmv", "直接GMV"),
+    PARAMETER17("liveRoi", "直接ROI");
+
+    private String code;
+    private String name;
+
+    AdEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getCodeByName(String name) {
+        for (AdEnum material : AdEnum.values()) {
+            if (material.getName().equals(name)) {
+                return material.getCode();
+            }
+        }
+        return "";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "code='" + code + '\'' +
+                ", name=" + name +
+                '}';
+    }
+
+    public static Map<String, String> getMap() {
+        Map<String, String> map = new HashMap<>();
+        for (AdEnum material : AdEnum.values()) {
+            map.put(material.getName(), material.getCode());
+        }
+        return map;
+    }
+}

+ 86 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/MaterialEnum.java

@@ -0,0 +1,86 @@
+package cn.com.ctop.kuaishou.modules.live.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 直播数据——素材报表 字段枚举,
+ * 用于锁定EXCEL顺序不同时的字段与数据的对应关系
+ */
+public enum MaterialEnum {
+    PARAMETER0("statDate", "时间"),
+    PARAMETER1("videoUrl", "视频链接"),
+    PARAMETER2("videoId", "视频ID"),
+    PARAMETER3("charge", "花费(元)"),
+    PARAMETER4("shows", "曝光数"),
+    PARAMETER5("photoShow", "封面曝光数"),
+    PARAMETER6("photoClickRatio", "封面点击率"),
+    PARAMETER7("aclick", "素材曝光数"),
+    PARAMETER8("bclick", "行为数"),
+    PARAMETER9("actionRatio", "行为率"),
+    PARAMETER10("likes", "作品点赞数"),
+    PARAMETER11("shares", "作品分享数"),
+    PARAMETER12("comments", "作品评论数"),
+    PARAMETER13("play3sCount", "作品3秒播放数"),
+    PARAMETER14("eventAppointSuccess", "预约成功数"),
+    PARAMETER15("liveWatchCount", "直播观看数"),
+    PARAMETER16("liveOrderCount", "直接订单数"),
+    PARAMETER17("liveGmv", "直接GMV"),
+    PARAMETER18("liveRoi", "直接ROI"),
+    PARAMETER19("liveFans", "涨粉数"),
+    PARAMETER20("liveNextDayFans", "次日涨粉留存数"),
+    PARAMETER21("liveNextDayFansRoi", "次日涨粉留存率"),
+    PARAMETER22("liveFans7d", "7日涨粉留存数"),
+    PARAMETER23("liveFans7dRoi", "7日涨粉留存率"),
+    PARAMETER24("liveFans15d", "15日涨粉留存数"),
+    PARAMETER25("liveFans15dRoi", "15日涨粉留存率");
+
+    private String code;
+    private String name;
+
+    MaterialEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getCodeByName(String name) {
+        for (MaterialEnum material : MaterialEnum.values()) {
+            if (material.getName().equals(name)) {
+                return material.getCode();
+            }
+        }
+        return "";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "code='" + code + '\'' +
+                ", name=" + name +
+                '}';
+    }
+
+    public static Map<String, String> getMap() {
+        Map<String, String> map = new HashMap<>();
+        for (MaterialEnum material : MaterialEnum.values()) {
+            map.put(material.getName(), material.getCode());
+        }
+        return map;
+    }
+}

+ 77 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/ProvinceEnum.java

@@ -0,0 +1,77 @@
+package cn.com.ctop.kuaishou.modules.live.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 直播数据——省份/年龄、价格、性别报表 字段枚举,
+ * 用于锁定EXCEL顺序不同时的字段与数据的对应关系
+ */
+public enum ProvinceEnum {
+    PARAMETER2("charge", "花费"),
+    PARAMETER3("shows", "曝光数"),
+    PARAMETER4("photoShow", "封面曝光数"),
+    PARAMETER5("photoClickRatio", "封面点击率"),
+    PARAMETER6("aclick", "素材曝光数"),
+    PARAMETER7("bclick", "行为数"),
+    PARAMETER8("actionRatio", "行为率"),
+    PARAMETER9("liveFans", "涨粉数"),
+    PARAMETER10("liveFansCost", "涨粉成本"),
+    PARAMETER11("productClick", "直播间商品点击数"),
+    PARAMETER12("liveWatchCount", "直播观看数"),
+    PARAMETER13("liveWatchCost", "直播观看成本"),
+    PARAMETER14("likes", "作品点赞数"),
+    PARAMETER15("shares", "作品分享数"),
+    PARAMETER16("comments", "作品评论数"),
+    PARAMETER17("play3sCount", "作品3秒播放数"),
+    PARAMETER18("eventAppointSuccess", "预约成功数");
+
+    private String code;
+    private String name;
+
+    ProvinceEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getCodeByName(String name) {
+        for (ProvinceEnum material : ProvinceEnum.values()) {
+            if (material.getName().equals(name)) {
+                return material.getCode();
+            }
+        }
+        return "";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "code='" + code + '\'' +
+                ", name=" + name +
+                '}';
+    }
+
+    public static Map<String, String> getMap() {
+        Map<String, String> map = new HashMap<>();
+        for (ProvinceEnum material : ProvinceEnum.values()) {
+            map.put(material.getName(), material.getCode());
+        }
+        return map;
+    }
+}

+ 73 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/TouchEnum.java

@@ -0,0 +1,73 @@
+package cn.com.ctop.kuaishou.modules.live.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 直播数据——触达报表 字段枚举,
+ * 用于锁定EXCEL顺序不同时的字段与数据的对应关系
+ */
+public enum TouchEnum {
+    PARAMETER0("statDate", "时间"),
+    PARAMETER1("fanStrat", "粉丝分层"),
+    PARAMETER2("customerStrat", "客群分层"),
+    PARAMETER3("charge", "花费(元)"),
+    PARAMETER4("todayCumulativeGmv", "当日累计GMV"),
+    PARAMETER5("todayCumulativeRoi", "当日累计ROI"),
+    PARAMETER6("todayCumulativeOrderCount", "当日累计订单数"),
+    PARAMETER7("showUsers", "曝光用户数"),
+    PARAMETER8("buyUsers", "购买用户数"),
+    PARAMETER9("buyRatio", "购买转化率"),
+    PARAMETER10("arpu", "ARPU"),
+    PARAMETER11("uv", "UV价值"),
+    PARAMETER12("averagePrice", "单均价");
+
+    private String code;
+    private String name;
+
+    TouchEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getCodeByName(String name) {
+        for (TouchEnum material : TouchEnum.values()) {
+            if (material.getName().equals(name)) {
+                return material.getCode();
+            }
+        }
+        return "";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "code='" + code + '\'' +
+                ", name=" + name +
+                '}';
+    }
+
+    public static Map<String, String> getMap() {
+        Map<String, String> map = new HashMap<>();
+        for (TouchEnum material : TouchEnum.values()) {
+            map.put(material.getName(), material.getCode());
+        }
+        return map;
+    }
+}

+ 185 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/enums/liveDataUtil.java

@@ -0,0 +1,185 @@
+package cn.com.ctop.kuaishou.modules.live.enums;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.poi.ss.usermodel.Row;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+public class liveDataUtil {
+
+    /**
+     * 数组集转LIST 同时去除多余双引号
+     */
+    public static List<List<String>> getCsvList(List<String[]> records) {
+        List<List<String>> list = new ArrayList<>();
+        for (String[] record : records) {
+            List<String> asList = Arrays.asList(record);
+            asList.replaceAll(t -> t.replace("\"", ""));
+            list.add(asList);
+        }
+        return list;
+    }
+
+    /**
+     * ----------------------------------------获取CSV格式标题和字段对应关系-----------------------------------------------
+     */
+
+    // 素材
+    public static JSONObject getCsvMaterialTitle(List<String> titles) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        Map<String, String> map = MaterialEnum.getMap();
+        for (int i = 0; i < titles.size(); i++) {
+            String code = map.get(titles.get(i));
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titles.get(i) + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 触达
+    public static JSONObject getCsvTouchTitle(List<String> titles) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        Map<String, String> map = TouchEnum.getMap();
+        for (int i = 0; i < titles.size(); i++) {
+            String code = map.get(titles.get(i));
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titles.get(i) + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 广告
+    public static JSONObject getCsvAdTitle(List<String> titles) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        Map<String, String> map = AdEnum.getMap();
+        for (int i = 0; i < titles.size(); i++) {
+            String code = map.get(titles.get(i));
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titles.get(i) + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 省份
+    public static JSONObject getCsvProvinceTitle(List<String> titles, String type) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        Map<String, String> map = ProvinceEnum.getMap();
+        if ("province".equals(type)) {
+            map.put("省份", type);
+        } else if ("price".equals(type)) {
+            map.put("设备价格", type);
+        } else if ("age".equals(type)) {
+            map.put("年龄分段", type);
+        } else if ("gender".equals(type)) {
+            map.put("性别", type);
+        }
+        for (int i = 0; i < titles.size(); i++) {
+            String code = map.get(titles.get(i));
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titles.get(i) + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    /**
+     * ========================================获取XLSX、XLS标题和字段对应关系===============================================
+     */
+
+    //素材
+    public static JSONObject getMaterialTitle(ExportExcelUtils eeu, Row titleRow, int lastCellNum) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        for (int i = 0; i < lastCellNum; i++) {
+            String titleName = eeu.getCellValue(titleRow.getCell(i));
+            String code = MaterialEnum.getCodeByName(titleName);
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titleName + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 触达
+    public static JSONObject getTouchTitle(ExportExcelUtils eeu, Row titleRow, int lastCellNum) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        for (int i = 0; i < lastCellNum; i++) {
+            String titleName = eeu.getCellValue(titleRow.getCell(i));
+            String code = TouchEnum.getCodeByName(titleName);
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titleName + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 广告
+    public static JSONObject getAdTitle(ExportExcelUtils eeu, Row titleRow, int lastCellNum) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        for (int i = 0; i < lastCellNum; i++) {
+            String titleName = eeu.getCellValue(titleRow.getCell(i));
+            String code = AdEnum.getCodeByName(titleName);
+            if (Check.isNull(code)) {
+                //记录目前不支持导入的数据
+                sign += titleName + "、";
+            }
+            obj.put(String.valueOf(i), code);
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+    // 省份
+    public static JSONObject getProvinceTitle(ExportExcelUtils eeu, Row titleRow, int lastCellNum, String type, String name) {
+        JSONObject obj = new JSONObject();
+        String sign = "";
+        for (int i = 0; i < lastCellNum; i++) {
+            String titleName = eeu.getCellValue(titleRow.getCell(i));
+            if (name.equals(titleName)) {
+                obj.put(String.valueOf(i), type);
+            } else {
+                String code = ProvinceEnum.getCodeByName(titleName);
+                if (Check.isNull(code)) {
+                    //记录目前不支持导入的数据
+                    sign += titleName + "、";
+                }
+                obj.put(String.valueOf(i), code);
+            }
+        }
+        obj.put("sign", sign);
+        return obj;
+    }
+
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAccountsMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAccounts;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+public interface LiveDataAccountsMapper extends BaseMapper<LiveDataAccounts> {
+
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAdMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAd;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 直播数据——广告人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface LiveDataAdMapper extends BaseMapper<LiveDataAd> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+}

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataAgeMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAge;
+import com.alibaba.fastjson.JSONArray;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 直播数据——各年龄段人群报表
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface LiveDataAgeMapper extends BaseMapper<LiveDataAge> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+
+}

+ 20 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataGenderMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataGender;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 直播数据——性别人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface LiveDataGenderMapper extends BaseMapper<LiveDataGender> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataImportRecordMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataImportRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+public interface LiveDataImportRecordMapper extends BaseMapper<LiveDataImportRecord> {
+
+}

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataMaterialMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataMaterial;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 直播数据——素材报表
+ *
+ * @author jeecg-boot
+ * 2022-03-30
+ * @version V1.0
+ */
+public interface LiveDataMaterialMapper extends BaseMapper<LiveDataMaterial> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+
+    void replaceEntity(@Param("material") JSONObject entityObj);
+}

+ 20 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataPriceMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataPrice;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 直播数据——设备价格人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface LiveDataPriceMapper extends BaseMapper<LiveDataPrice> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataProvinceMapper.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataProvince;
+import com.alibaba.fastjson.JSONArray;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 直播数据——省份人群报表
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface LiveDataProvinceMapper extends BaseMapper<LiveDataProvince> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/LiveDataTouchMapper.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.live.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataTouch;
+import com.alibaba.fastjson.JSONArray;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 直播数据——触达人群报表
+ * @author jeecg-boot
+ * 2022-04-02
+ * @version V1.0
+ */
+public interface LiveDataTouchMapper extends BaseMapper<LiveDataTouch> {
+
+    void replaceBatch(@Param("list") JSONArray array);
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAccountsMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAccountsMapper">
+
+</mapper>

+ 55 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAdMapper.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAdMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_ad(
+        id,
+        account_id,
+        live_id,
+        kuaishou_name,
+        live_start_time,
+        live_end_time,
+        live_duration,
+        anchor_id,
+        charge,
+        bclick,
+        live_watch_average_time,
+        live_comments,
+        live_shares,
+        live_gifts,
+        live_fans,
+        live_fans_cost,
+        live_watch_count,
+        live_order_count,
+        live_gmv,
+        live_roi
+        )
+        values
+        <foreach collection="list" item="ad" separator=",">
+            (
+            #{ad.id},
+            #{ad.accountId},
+            #{ad.liveId},
+            #{ad.kuaishouName},
+            #{ad.liveStartTime},
+            #{ad.liveEndTime},
+            #{ad.liveDuration},
+            #{ad.anchorId},
+            #{ad.charge},
+            #{ad.bclick},
+            #{ad.liveWatchAverageTime},
+            #{ad.liveComments},
+            #{ad.liveShares},
+            #{ad.liveGifts},
+            #{ad.liveFans},
+            #{ad.liveFansCost},
+            #{ad.liveWatchCount},
+            #{ad.liveOrderCount},
+            #{ad.liveGmv},
+            #{ad.liveRoi}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 57 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataAgeMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAgeMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_age(
+        id,
+        account_id,
+        stat_month,
+        age,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        product_click,
+        likes,
+        shares,
+        comments,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_watch_cost,
+        live_fans,
+        live_fans_cost
+        )
+        values
+        <foreach collection="list" item="pro" separator=",">
+            (
+            #{pro.id},
+            #{pro.accountId},
+            #{pro.statMonth},
+            #{pro.age},
+            #{pro.charge},
+            #{pro.shows},
+            #{pro.photoShow},
+            #{pro.photoClickRatio},
+            #{pro.aclick},
+            #{pro.bclick},
+            #{pro.actionRatio},
+            #{pro.productClick},
+            #{pro.likes},
+            #{pro.shares},
+            #{pro.comments},
+            #{pro.play3sCount},
+            #{pro.eventAppointSuccess},
+            #{pro.liveWatchCount},
+            #{pro.liveWatchCost},
+            #{pro.liveFans},
+            #{pro.liveFansCost}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 57 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataGenderMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataGenderMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_gender(
+        id,
+        account_id,
+        stat_month,
+        gender,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        product_click,
+        likes,
+        shares,
+        comments,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_watch_cost,
+        live_fans,
+        live_fans_cost
+        )
+        values
+        <foreach collection="list" item="pro" separator=",">
+            (
+            #{pro.id},
+            #{pro.accountId},
+            #{pro.statMonth},
+            #{pro.gender},
+            #{pro.charge},
+            #{pro.shows},
+            #{pro.photoShow},
+            #{pro.photoClickRatio},
+            #{pro.aclick},
+            #{pro.bclick},
+            #{pro.actionRatio},
+            #{pro.productClick},
+            #{pro.likes},
+            #{pro.shares},
+            #{pro.comments},
+            #{pro.play3sCount},
+            #{pro.eventAppointSuccess},
+            #{pro.liveWatchCount},
+            #{pro.liveWatchCost},
+            #{pro.liveFans},
+            #{pro.liveFansCost}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataImportRecordMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataImportRecordMapper">
+
+</mapper>

+ 139 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataMaterialMapper.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataMaterialMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_material(
+        id,
+        account_id,
+        stat_date,
+        video_id,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        likes,
+        shares,
+        comments,
+        photo_url,
+        video_url,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_order_count,
+        live_gmv,
+        live_roi,
+        live_fans,
+        live_next_day_fans,
+        live_next_day_fans_roi,
+        live_fans_7d,
+        live_fans_7d_roi,
+        live_fans_15d,
+        live_fans_15d_roi
+        )
+        values
+        <foreach collection="list" item="material" separator=",">
+            (
+            #{material.id},
+            #{material.accountId},
+            #{material.statDate},
+            #{material.videoId},
+            #{material.charge},
+            #{material.shows},
+            #{material.photoShow},
+            #{material.photoClickRatio},
+            #{material.aclick},
+            #{material.bclick},
+            #{material.actionRatio},
+            #{material.likes},
+            #{material.shares},
+            #{material.comments},
+            #{material.photoUrl},
+            #{material.videoUrl},
+            #{material.play3sCount},
+            #{material.eventAppointSuccess},
+            #{material.liveWatchCount},
+            #{material.liveOrderCount},
+            #{material.liveGmv},
+            #{material.liveRoi},
+            #{material.liveFans},
+            #{material.liveNextDayFans},
+            #{material.liveNextDayFansRoi},
+            #{material.liveFans7d},
+            #{material.liveFans7dRoi},
+            #{material.liveFans15d},
+            #{material.liveFans15dRoi}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="replaceEntity">
+        replace into ctop_live_data_material(
+        id,
+        account_id,
+        stat_date,
+        video_id,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        likes,
+        shares,
+        comments,
+        photo_url,
+        video_url,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_order_count,
+        live_gmv,
+        live_roi,
+        live_fans,
+        live_next_day_fans,
+        live_next_day_fans_roi,
+        live_fans_7d,
+        live_fans_7d_roi,
+        live_fans_15d,
+        live_fans_15d_roi
+        )
+        values
+            (
+            #{material.id},
+            #{material.accountId},
+            #{material.statDate},
+            #{material.videoId},
+            #{material.charge},
+            #{material.shows},
+            #{material.photoShow},
+            #{material.photoClickRatio},
+            #{material.aclick},
+            #{material.bclick},
+            #{material.actionRatio},
+            #{material.likes},
+            #{material.shares},
+            #{material.comments},
+            #{material.photoUrl},
+            #{material.videoUrl},
+            #{material.play3sCount},
+            #{material.eventAppointSuccess},
+            #{material.liveWatchCount},
+            #{material.liveOrderCount},
+            #{material.liveGmv},
+            #{material.liveRoi},
+            #{material.liveFans},
+            #{material.liveNextDayFans},
+            #{material.liveNextDayFansRoi},
+            #{material.liveFans7d},
+            #{material.liveFans7dRoi},
+            #{material.liveFans15d},
+            #{material.liveFans15dRoi}
+            )
+    </insert>
+
+</mapper>

+ 57 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataPriceMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataPriceMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_price(
+        id,
+        account_id,
+        stat_month,
+        price,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        product_click,
+        likes,
+        shares,
+        comments,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_watch_cost,
+        live_fans,
+        live_fans_cost
+        )
+        values
+        <foreach collection="list" item="pro" separator=",">
+            (
+            #{pro.id},
+            #{pro.accountId},
+            #{pro.statMonth},
+            #{pro.price},
+            #{pro.charge},
+            #{pro.shows},
+            #{pro.photoShow},
+            #{pro.photoClickRatio},
+            #{pro.aclick},
+            #{pro.bclick},
+            #{pro.actionRatio},
+            #{pro.productClick},
+            #{pro.likes},
+            #{pro.shares},
+            #{pro.comments},
+            #{pro.play3sCount},
+            #{pro.eventAppointSuccess},
+            #{pro.liveWatchCount},
+            #{pro.liveWatchCost},
+            #{pro.liveFans},
+            #{pro.liveFansCost}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 57 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataProvinceMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataProvinceMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_province(
+        id,
+        account_id,
+        stat_month,
+        province,
+        charge,
+        shows,
+        photo_show,
+        photo_click_ratio,
+        aclick,
+        bclick,
+        action_ratio,
+        product_click,
+        likes,
+        shares,
+        comments,
+        play_3s_count,
+        event_appoint_success,
+        live_watch_count,
+        live_watch_cost,
+        live_fans,
+        live_fans_cost
+        )
+        values
+        <foreach collection="list" item="pro" separator=",">
+            (
+            #{pro.id},
+            #{pro.accountId},
+            #{pro.statMonth},
+            #{pro.province},
+            #{pro.charge},
+            #{pro.shows},
+            #{pro.photoShow},
+            #{pro.photoClickRatio},
+            #{pro.aclick},
+            #{pro.bclick},
+            #{pro.actionRatio},
+            #{pro.productClick},
+            #{pro.likes},
+            #{pro.shares},
+            #{pro.comments},
+            #{pro.play3sCount},
+            #{pro.eventAppointSuccess},
+            #{pro.liveWatchCount},
+            #{pro.liveWatchCost},
+            #{pro.liveFans},
+            #{pro.liveFansCost}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 45 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/mapper/xml/LiveDataTouchMapper.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.live.mapper.LiveDataTouchMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_live_data_touch(
+        id,
+        account_id,
+        stat_date,
+        fan_strat,
+        customer_strat,
+        charge,
+        today_cumulative_gmv,
+        today_cumulative_roi,
+        today_cumulative_order_count,
+        show_users,
+        buy_users,
+        buy_ratio,
+        arpu,
+        uv,
+        average_price
+        )
+        values
+        <foreach collection="list" item="touch" separator=",">
+            (
+            #{touch.id},
+            #{touch.accountId},
+            #{touch.statDate},
+            #{touch.fanStrat},
+            #{touch.customerStrat},
+            #{touch.charge},
+            #{touch.todayCumulativeGmv},
+            #{touch.todayCumulativeRoi},
+            #{touch.todayCumulativeOrderCount},
+            #{touch.showUsers},
+            #{touch.buyUsers},
+            #{touch.buyRatio},
+            #{touch.arpu},
+            #{touch.uv},
+            #{touch.averagePrice}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAccountsService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAccounts;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+public interface ILiveDataAccountsService extends IService<LiveDataAccounts> {
+
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAdService.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAd;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——广告人群报表
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface ILiveDataAdService extends IService<LiveDataAd> {
+
+    Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception;
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataAgeService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAge;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——各年龄段人群报表
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface ILiveDataAgeService extends IService<LiveDataAge> {
+
+    Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception;
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataGenderService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataGender;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——性别人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface ILiveDataGenderService extends IService<LiveDataGender> {
+
+    Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception;
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataImportRecordService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataImportRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 直播数据——操作记录表
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+public interface ILiveDataImportRecordService extends IService<LiveDataImportRecord> {
+
+    /**
+     * @param type 操作类型 1素材、2触达人群、3省份人群、4年龄段人群、5性别人群、6设备价格、7广告,101新增账户,102删除账户,103修改账户
+     */
+    void addImportRecord(Long accountId, Integer type, String userId);
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataMaterialService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataMaterial;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——素材报表
+ *
+ * @author jeecg-boot
+ * 2022-03-30
+ * @version V1.0
+ */
+public interface ILiveDataMaterialService extends IService<LiveDataMaterial> {
+
+    Result<Object> importItemExcel(Long accountId,MultipartFile file) throws Exception;
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataPriceService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataPrice;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——设备价格人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface ILiveDataPriceService extends IService<LiveDataPrice> {
+
+    Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception;
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataProvinceService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataProvince;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——省份人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+public interface ILiveDataProvinceService extends IService<LiveDataProvince> {
+
+    Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception;
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/ILiveDataTouchService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.live.service;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataTouch;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 直播数据——触达人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-02
+ * @version V1.0
+ */
+public interface ILiveDataTouchService extends IService<LiveDataTouch> {
+
+    Result<Object> importExcel(Long accountId, MultipartFile file) throws Exception;
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAccountsServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAccounts;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAccountsMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAccountsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+@Service
+public class LiveDataAccountsServiceImpl extends ServiceImpl<LiveDataAccountsMapper, LiveDataAccounts> implements ILiveDataAccountsService {
+
+}

+ 165 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAdServiceImpl.java

@@ -0,0 +1,165 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAd;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAdMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAdService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——广告人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+@Service
+public class LiveDataAdServiceImpl extends ServiceImpl<LiveDataAdMapper, LiveDataAd> implements ILiveDataAdService {
+
+    @Override
+    public Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception {
+
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getAdTitle(eeu, titleRow, lastCellNum);
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    //URL 和 日期 为空时,添加不成功!
+                    if (Check.isNull(value)) {
+                        if ("liveId".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【直播ID】为必填项,请补充完善后导入");
+                        } else if ("kuaishouName".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【快手号】为必填项,请补充完善后导入");
+                        } else if ("liveStartTime".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【直播开始时间】为必填项,请补充完善后导入");
+                        }
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        //去除多余双引号
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvAdTitle(list.get(0));
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                if (Check.isNull(value)) {
+                    if ("liveId".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【直播ID】为必填项,请补充完善后导入");
+                    } else if ("kuaishouName".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【快手号】为必填项,请补充完善后导入");
+                    } else if ("liveStartTime".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【直播开始时间】为必填项,请补充完善后导入");
+                    }
+                }
+                if ("liveStartTime".equals(code) || "liveEndTime".equals(code)) {
+                    value = DateUtils.formatDate(value.replace("/", "-"), DateUtils.NEW_FORMAT2);
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+}

+ 160 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataAgeServiceImpl.java

@@ -0,0 +1,160 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataAge;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataAgeMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataAgeService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——各年龄段人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+@Service
+public class LiveDataAgeServiceImpl extends ServiceImpl<LiveDataAgeMapper, LiveDataAge> implements ILiveDataAgeService {
+
+    final static String TYPE = "age";
+
+    @Override
+    public Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, statMonth, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getProvinceTitle(eeu, titleRow, lastCellNum, TYPE, "年龄分段");
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【年龄分段】字段");
+        }
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    // 省份为空时,添加不成功!
+                    if (Check.isNull(value) && TYPE.equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【年龄分段】为必填项,请补充完善后导入");
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("statMonth", statMonth);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvProvinceTitle(list.get(0), TYPE);
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【年龄分段】字段");
+        }
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                // 省份为空时,添加不成功!
+                if (Check.isNull(value) && TYPE.equals(code)) {
+                    return Result.error("数据缺失,文档中第" + (i + 1) + "行,【年龄分段】为必填项,请补充完善后导入");
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("statMonth", statMonth);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+}

+ 161 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataGenderServiceImpl.java

@@ -0,0 +1,161 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataGender;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataGenderMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataGenderService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——性别人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+@Service
+public class LiveDataGenderServiceImpl extends ServiceImpl<LiveDataGenderMapper, LiveDataGender> implements ILiveDataGenderService {
+
+    final static String TYPE = "gender";
+
+    @Override
+    public Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, statMonth, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getProvinceTitle(eeu, titleRow, lastCellNum, TYPE, "性別");
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【性别】字段");
+        }
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    // 省份为空时,添加不成功!
+                    if (Check.isNull(value) && TYPE.equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【性别】为必填项,请补充完善后导入");
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("statMonth", statMonth);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvProvinceTitle(list.get(0), TYPE);
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【性别】字段");
+        }
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                // 省份为空时,添加不成功!
+                if (Check.isNull(value) && TYPE.equals(code)) {
+                    return Result.error("数据缺失,文档中第" + (i + 1) + "行,【性别】为必填项,请补充完善后导入");
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("statMonth", statMonth);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+}

+ 33 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataImportRecordServiceImpl.java

@@ -0,0 +1,33 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataImportRecord;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataImportRecordMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataImportRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.UUID;
+
+/**
+ * 直播数据——操作记录表
+ *
+ * @author jeecg-boot
+ * 2022-04-01
+ * @version V1.0
+ */
+@Service
+public class LiveDataImportRecordServiceImpl extends ServiceImpl<LiveDataImportRecordMapper, LiveDataImportRecord> implements ILiveDataImportRecordService {
+
+    @Override
+    public void addImportRecord(Long accountId, Integer type, String userId) {
+        LiveDataImportRecord record = new LiveDataImportRecord();
+        record.setAccountId(accountId);
+        record.setId(accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+        record.setType(type);
+        record.setUserId(userId);
+        record.setStatDate(DateUtils.date2Str());
+        this.save(record);
+    }
+
+}

+ 204 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataMaterialServiceImpl.java

@@ -0,0 +1,204 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.CosUtils;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.LoadFileUtil;
+import cn.com.ctop.common.module.vo.ResFileDTO;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataMaterial;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataMaterialMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataMaterialService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 直播数据——素材报表
+ *
+ * @author jeecg-boot
+ * 2022-03-30
+ * @version V1.0
+ */
+@Service
+public class LiveDataMaterialServiceImpl extends ServiceImpl<LiveDataMaterialMapper, LiveDataMaterial> implements ILiveDataMaterialService {
+
+    @Value("${oss.replace.download}")
+    private String downloadUrl;
+    private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
+
+    @Override
+    public Result<Object> importItemExcel(Long accountId, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getMaterialTitle(eeu, titleRow, lastCellNum);
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    //URL 和 日期 为空时,添加不成功!
+                    if (Check.isNull(value)) {
+                        if ("videoId".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【视频ID】为必填项,请补充完善后导入");
+                        } else if ("statDate".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【时间】为必填项,请补充完善后导入");
+                        } else if ("videoUrl".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【视频链接】为必填项,请补充完善后导入");
+                        }
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            //异步处理,上传到COS服务,并获取链接(photoUrl)
+            array.forEach(o -> uploadExecutorService.submit(() -> {
+                JSONObject entityObj = JSONObject.parseObject(o.toString());
+                entityObj.put("photoUrl", getCosUrl(entityObj.getString("videoUrl")));
+                baseMapper.replaceEntity(entityObj);
+            }));
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据异步导入中... 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据异步导入中... ");
+    }
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvMaterialTitle(list.get(0));
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                if (Check.isNull(value)) {
+                    if ("videoId".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【视频ID】为必填项,请补充完善后导入");
+                    } else if ("statDate".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【时间】为必填项,请补充完善后导入");
+                    } else if ("videoUrl".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【视频链接】为必填项,请补充完善后导入");
+                    }
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+        if (!Check.isNull(array)) {
+            //异步处理,上传到COS服务,并获取链接(photoUrl)
+            array.forEach(o -> uploadExecutorService.submit(() -> {
+                JSONObject entityObj = JSONObject.parseObject(o.toString());
+                entityObj.put("photoUrl", getCosUrl(entityObj.getString("videoUrl")));
+                baseMapper.replaceEntity(entityObj);
+            }));
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据异步导入中... 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据异步导入中... ");
+    }
+
+    /**
+     * 根据原始视频链接,下载到cos上
+     */
+    private String getCosUrl(String url) {
+        try {
+            if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
+            }
+            InputStream imageStream = LoadFileUtil.getFileStream(url);
+            if (!Check.isNull(imageStream)) {
+                String path = "live-videos/" + DateUtils.formatDate(new Date(), DateUtils.SHORT_FORMAT) + "/";
+                String videoName = UUID.randomUUID().toString().replace("-", "") + ".mp4";
+                ResFileDTO file = CosUtils.uploadDetailInputStreamV2(imageStream, videoName, "mp4", 0L, path);
+                return file.getFileUrl();
+            }
+        } catch (Exception e) {
+            log.error("上传COS异常", e);
+            return "上传COS失败";
+        }
+        return null;
+    }
+
+
+}

+ 160 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataPriceServiceImpl.java

@@ -0,0 +1,160 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataPrice;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataPriceMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataPriceService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——设备价格人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+@Service
+public class LiveDataPriceServiceImpl extends ServiceImpl<LiveDataPriceMapper, LiveDataPrice> implements ILiveDataPriceService {
+
+    final static String TYPE = "price";
+
+    @Override
+    public Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, statMonth, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getProvinceTitle(eeu, titleRow, lastCellNum, TYPE, "设备价格");
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【设备价格】字段");
+        }
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    // 省份为空时,添加不成功!
+                    if (Check.isNull(value) && TYPE.equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【设备价格】为必填项,请补充完善后导入");
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("statMonth", statMonth);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvProvinceTitle(list.get(0), TYPE);
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【设备价格】字段");
+        }
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                // 省份为空时,添加不成功!
+                if (Check.isNull(value) && TYPE.equals(code)) {
+                    return Result.error("数据缺失,文档中第" + (i + 1) + "行,【设备价格】为必填项,请补充完善后导入");
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("statMonth", statMonth);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+}

+ 159 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataProvinceServiceImpl.java

@@ -0,0 +1,159 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataProvince;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataProvinceMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataProvinceService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——省份人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-06
+ * @version V1.0
+ */
+@Service
+public class LiveDataProvinceServiceImpl extends ServiceImpl<LiveDataProvinceMapper, LiveDataProvince> implements ILiveDataProvinceService {
+
+    final static String TYPE = "province";
+
+    @Override
+    public Result<Object> importExcel(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, statMonth, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getProvinceTitle(eeu, titleRow, lastCellNum, TYPE, "省份");
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【省份】字段");
+        }
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    // 省份为空时,添加不成功!
+                    if (Check.isNull(value) && TYPE.equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【省份】为必填项,请补充完善后导入");
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("statMonth", statMonth);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, String statMonth, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvProvinceTitle(list.get(0), TYPE);
+        if (!titleObj.containsValue(TYPE)) {
+            return Result.error("导入失败,文档中不包含【省份】字段");
+        }
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                // 省份为空时,添加不成功!
+                if (Check.isNull(value) && TYPE.equals(code)) {
+                    return Result.error("数据缺失,文档中第" + (i + 1) + "行,【省份】为必填项,请补充完善后导入");
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("statMonth", statMonth);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+}

+ 163 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/live/service/impl/LiveDataTouchServiceImpl.java

@@ -0,0 +1,163 @@
+package cn.com.ctop.kuaishou.modules.live.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.kuaishou.modules.live.entity.LiveDataTouch;
+import cn.com.ctop.kuaishou.modules.live.enums.liveDataUtil;
+import cn.com.ctop.kuaishou.modules.live.mapper.LiveDataTouchMapper;
+import cn.com.ctop.kuaishou.modules.live.service.ILiveDataTouchService;
+import cn.hutool.core.util.CharsetUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 直播数据——触达人群报表
+ *
+ * @author jeecg-boot
+ * 2022-04-02
+ * @version V1.0
+ */
+@Service
+public class LiveDataTouchServiceImpl extends ServiceImpl<LiveDataTouchMapper, LiveDataTouch> implements ILiveDataTouchService {
+
+    @Override
+    public Result<Object> importExcel(Long accountId, MultipartFile file) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Workbook workbook = null;
+        String fileName = file.getOriginalFilename();
+        String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
+        if ("XLS".equals(substring)) {
+            workbook = new HSSFWorkbook(file.getInputStream());
+        } else if ("XLSX".equals(substring)) {
+            workbook = new XSSFWorkbook(file.getInputStream());
+        } else if ("CSV".equals(substring)) {
+            return analysisCsvFile(accountId, file);
+        } else {
+            throw new Exception("文件不是Excel文件");
+        }
+        Sheet sheet = workbook.getSheetAt(0);
+        if (Check.isNull(sheet)) {
+            throw new Exception("Sheet标题不是默认的Sheet1");
+        }
+        int rows = sheet.getLastRowNum();//行数,一共有多少行+
+        if (rows == 0) {
+            throw new Exception("请填写数据");
+        }
+        ExportExcelUtils eeu = new ExportExcelUtils();
+        //标题行
+        Row titleRow = sheet.getRow(0);
+        //最后一列
+        int lastCellNum = titleRow.getLastCellNum();
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getTouchTitle(eeu, titleRow, lastCellNum);
+
+        JSONArray array = new JSONArray();
+        for (int i = 1; i <= rows + 1; i++) {
+            Row row = sheet.getRow(i);
+            if (row != null) {
+                JSONObject entityObj = new JSONObject();
+                for (int j = 0; j < lastCellNum; j++) {
+                    String value = eeu.getCellValue2(row.getCell(j));
+                    String code = titleObj.getString(String.valueOf(j));
+                    //URL 和 日期 为空时,添加不成功!
+                    if (Check.isNull(value)) {
+                        if ("fanStrat".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【粉丝分层】为必填项,请补充完善后导入");
+                        } else if ("customerStrat".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【客群分层】为必填项,请补充完善后导入");
+                        } else if ("statDate".equals(code)) {
+                            return Result.error("数据缺失,文档中第" + (i + 1) + "行,【时间】为必填项,请补充完善后导入");
+                        }
+                    }
+                    entityObj.put(code, value);
+                }
+                entityObj.put("accountId", accountId);
+                entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+                array.add(entityObj);
+            }
+        }
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+    /**
+     * 解析 CSV 格式文件
+     */
+    private Result<Object> analysisCsvFile(Long accountId, MultipartFile file) throws Exception {
+        List<String[]> records = new ArrayList<String[]>();
+        String record;
+        BufferedReader files = new BufferedReader(new InputStreamReader(file.getInputStream(), CharsetUtil.CHARSET_GBK));
+        // file.readLine(); //跳过表头所在的行
+
+        // 遍历数据行并存储在名为records的ArrayList中,每一行records中存储的对象为一个String数组
+        while ((record = files.readLine()) != null) {
+            String fields[] = record.split(",");
+            records.add(fields);
+        }
+        // 关闭文件
+        files.close();
+        List<List<String>> list = liveDataUtil.getCsvList(records);
+        //获取映射关系
+        JSONObject titleObj = liveDataUtil.getCsvTouchTitle(list.get(0));
+        JSONArray array = new JSONArray();
+        for (int i = 1; i < list.size(); i++) {
+            List<String> values = list.get(i);
+            JSONObject entityObj = new JSONObject();
+            for (int j = 0; j < values.size(); j++) {
+                String value = values.get(j);
+                String code = titleObj.getString(String.valueOf(j));
+                if (Check.isNull(value)) {
+                    if ("fanStrat".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【粉丝分层】为必填项,请补充完善后导入");
+                    } else if ("customerStrat".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【客群分层】为必填项,请补充完善后导入");
+                    } else if ("statDate".equals(code)) {
+                        return Result.error("数据缺失,文档中第" + (i + 1) + "行,【时间】为必填项,请补充完善后导入");
+                    }
+                }
+                if ("statDate".equals(code)) {
+                    value = DateUtils.formatDate(value.replace("/","-"), DateUtils.WEB_FORMAT);
+                }
+                entityObj.put(code, value);
+            }
+            entityObj.put("accountId", accountId);
+            entityObj.put("id", accountId + "_" + DateUtils.formatDate("yyyyMMdd") + "_" + UUID.randomUUID().toString().replace("-", "").substring(0, 9));
+            array.add(entityObj);
+        }
+
+        if (!Check.isNull(array)) {
+            baseMapper.replaceBatch(array);
+        }
+        //记录枚举中不存在活不匹配的字段
+        String sign = titleObj.getString("sign");
+        if (!Check.isNull(sign)) {
+            return Result.ok("数据导入成功, 其中(" + sign.substring(0, sign.length() - 1) + ")字段暂时不支持导入,如需要添加请联系研发人员");
+        }
+        return Result.ok("数据导入成功 ");
+    }
+
+
+}