浏览代码

短剧修

yumeng 8 月之前
父节点
当前提交
e7c0f056aa

+ 5 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/DuanJUReportController.java

@@ -4,16 +4,15 @@ import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.report.service.IDuanJUReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
 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.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.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -96,7 +95,7 @@ public class DuanJUReportController {
     }
 
     @GetMapping("/getViodeoList")
-    public Result<Object> getViodeoList(String startDate, String endDate, String videoName) {
+    public Result<Object> getViodeoList(String startDate, String endDate, String videoName, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
             Long start = DateUtils.dateToLong(startDate);
             Long end = DateUtils.dateToLong(endDate);
@@ -106,8 +105,7 @@ public class DuanJUReportController {
             if (!Check.isNull(videoName)) {
                 requestMap.put("videoName", videoName);
             }
-            List<JSONObject> data = duanJUReportService.getViodeoList(requestMap);
-            return Result.OK(data);
+            return duanJUReportService.getViodeoListByPage(requestMap, pageNo, pageSize);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 0 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/DuanJUReportMapper.xml

@@ -96,7 +96,6 @@
         round(SUM(t.charge) / SUM(t.event_pay), 2) AS pay_cost,
         SUM(round(t.event_new_user_pay)) AS event_new_user_pay,
         round(SUM(t.charge) / SUM(t.event_new_user_pay), 2) AS new_pay_cost,
-        round(SUM(t.charge) / SUM(t.event_new_user_pay), 2) AS new_pay_cost,
         concat(round(SUM(t.play_3s_count) / SUM(t.aclick) * 100, 2), '%') AS play_3s_rate,
         concat(round(SUM(t.play_5s_count) / SUM(t.aclick) * 100, 2), '%') AS play_5s_rate,
         concat(round(SUM(t.play_end_count) / SUM(t.aclick) * 100, 2), '%') AS play_end_rate

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IDuanJUReportService.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.kuaishou.modules.report.service;
 
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
 import java.util.Map;
@@ -19,4 +20,6 @@ public interface IDuanJUReportService {
     void replaceDatas(List<JSONObject> adds);
 
     List<JSONObject> stopList(Map<String, Object> requestMap);
+
+    Result<Object> getViodeoListByPage(Map<String, Object> requestMap, Integer pageNo, Integer pageSize);
 }

+ 10 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/DuanJUReportServiceImpl.java

@@ -3,6 +3,9 @@ package cn.com.ctop.kuaishou.modules.report.service.impl;
 import cn.com.ctop.kuaishou.modules.report.mapper.DuanJUReportMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IDuanJUReportService;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -48,4 +51,11 @@ public class DuanJUReportServiceImpl implements IDuanJUReportService {
     public List<JSONObject> stopList(Map<String, Object> requestMap) {
         return duanJUReportMapper.stopList(requestMap);
     }
+
+    @Override
+    public Result<Object> getViodeoListByPage(Map<String, Object> requestMap, Integer pageNo, Integer pageSize) {
+        PageHelper.startPage(pageNo, pageSize);
+        List<JSONObject> data = duanJUReportMapper.getViodeoList(requestMap);
+        return Result.ok(new PageInfo<>(data));
+    }
 }