yumeng 1 settimana fa
parent
commit
589ed59f63
17 ha cambiato i file con 2605 aggiunte e 867 eliminazioni
  1. 84 45
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/KuaiShouMaterialStareController.java
  2. 4 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/ManagerSaleValueController.java
  3. 3 3
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/ReportController.java
  4. 24 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/AccountTrendPojo.java
  5. 48 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/ManagerSaleValue.java
  6. 4 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateAccountVo.java
  7. 360 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateProjectVo.java
  8. 72 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateVo.java
  9. 2 2
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/AdqAdvertiserReportMapper.java
  10. 37 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialStareMapper.java
  11. 36 0
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/AdqAdvertiserReportMapper.xml
  12. 1180 182
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml
  13. 1 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/IAdqAdvertiserReportService.java
  14. 1 1
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/MaterialStareService.java
  15. 33 3
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/AdqAdvertiserReportServiceImpl.java
  16. 706 625
      jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java
  17. 10 1
      pom.xml

+ 84 - 45
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/KuaiShouMaterialStareController.java

@@ -13,11 +13,14 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.HorizontalAlignment;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.ctop.material.constants.Check;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateAccountVo;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo;
 import org.jeecg.ctop.material.mapper.MaterialStareMapper;
+import org.jeecg.ctop.material.service.IAdqAdvertiserReportService;
 import org.jeecg.ctop.material.service.MaterialStareService;
+import org.jeecg.ctop.material.service.support.DashboardLocalCacheService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,8 +32,10 @@ import java.io.BufferedOutputStream;
 import java.io.OutputStream;
 import java.net.URLEncoder;
 import java.text.ParseException;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Supplier;
 
 /**
  * 快手-运营数据盯盘-经理&个人
@@ -41,6 +46,9 @@ import java.util.Map;
 @RequestMapping("/kuaiShouOpreate/kuaiShouMaterialStareController")
 public class KuaiShouMaterialStareController {
 
+    private static final long REALTIME_CACHE_TTL = 30 * 1000L;
+    private static final long HISTORY_CACHE_TTL = 5 * 60 * 1000L;
+
 
     @Autowired
     MaterialStareService materialStareService;
@@ -48,6 +56,12 @@ public class KuaiShouMaterialStareController {
     @Autowired
     private MaterialStareMapper materialStareMapper;
 
+    @Autowired
+    private IAdqAdvertiserReportService adqAdvertiserReportService;
+
+    @Autowired
+    private DashboardLocalCacheService dashboardLocalCacheService;
+
 
     /**
      * @param mediaType 媒体类型 1-头条 2-快手
@@ -65,7 +79,8 @@ public class KuaiShouMaterialStareController {
                                               @RequestParam(name = "startTime") String startTime,
                                               @RequestParam(name = "endTime") String endTime,
                                               @RequestParam(name = "userId") String userId) {
-        return materialStareService.kuaiShousumData(mediaType, type, startTime, endTime, userId);
+        String cacheKey = "dashboard:stare:sumData:" + safe(mediaType) + ":" + safe(type) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId);
+        return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.kuaiShousumData(mediaType, type, startTime, endTime, userId));
     }
 
 
@@ -84,8 +99,8 @@ public class KuaiShouMaterialStareController {
                                                        @RequestParam(name = "startTime") String startTime,
                                                        @RequestParam(name = "endTime") String endTime,
                                                        @RequestParam(name = "userId") String userId) {
-
-        return materialStareService.kuaiShouOperateDateTotal(mediaType, startTime, endTime, userId);
+        String cacheKey = "dashboard:stare:dateTotal:" + safe(mediaType) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId);
+        return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.kuaiShouOperateDateTotal(mediaType, startTime, endTime, userId));
     }
 
 
@@ -139,29 +154,32 @@ public class KuaiShouMaterialStareController {
                                                         @RequestParam(name = "startTime") String startTime,
                                                         @RequestParam(name = "endTime") String endTime,
                                                         @RequestParam(name = "userId") String userId) {
-
-        //查询用户角色
-        String roleCode = materialStareMapper.getRoleCodeByUserId(userId);
-        //判断是否运营相关角色,并获取媒体类型
-        if (!Check.isNull(roleCode)) {
-            if ("touTiaoOperationManager".equals(roleCode)) {
-                mediaType = "1";
-            } else if ("kuaishouOperationManager".equals(roleCode)) {
-                mediaType = "2";
-            } else if (roleCode.toLowerCase().contains("perat")) {
-                String leaderRoleCode = materialStareMapper.getOperatLeaderRole(userId);
-                if (!Check.isNull(leaderRoleCode)) {
-                    if ("touTiaoOperationManager".equals(leaderRoleCode)) {
-                        mediaType = "1";
-                    } else if ("kuaishouOperationManager".equals(leaderRoleCode)) {
-                        mediaType = "2";
+        if (!"16".equals(mediaType)) {
+            //查询用户角色
+            String roleCode = materialStareMapper.getRoleCodeByUserId(userId);
+            //判断是否运营相关角色,并获取媒体类型
+            if (!Check.isNull(roleCode)) {
+                if ("touTiaoOperationManager".equals(roleCode)) {
+                    mediaType = "1";
+                } else if ("kuaishouOperationManager".equals(roleCode)) {
+                    mediaType = "2";
+                } else if (roleCode.toLowerCase().contains("perat")) {
+                    String leaderRoleCode = materialStareMapper.getOperatLeaderRole(userId);
+                    if (!Check.isNull(leaderRoleCode)) {
+                        if ("touTiaoOperationManager".equals(leaderRoleCode)) {
+                            mediaType = "1";
+                        } else if ("kuaishouOperationManager".equals(leaderRoleCode)) {
+                            mediaType = "2";
+                        }
                     }
+                } else {
+                    return Result.successMsg("非运营相关角色,不显示数据", null);
                 }
-            } else {
-                return Result.successMsg("非运营相关角色,不显示数据", null);
             }
         }
-        return materialStareService.getKuaiShouOperateProjectInfo(pageNum, pageSize, mediaType, startTime, endTime, userId);
+        String resolvedMediaType = mediaType;
+        String cacheKey = "dashboard:stare:projectInfo:" + safe(resolvedMediaType) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId) + ":" + safe(pageNum) + ":" + safe(pageSize);
+        return (Result<Object>) (Result<?>) getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.getKuaiShouOperateProjectInfo(pageNum, pageSize, resolvedMediaType, startTime, endTime, userId));
     }
 
 
@@ -197,13 +215,13 @@ public class KuaiShouMaterialStareController {
     @GetMapping("/getKuaiShouOperateAccountInfo")
     public Result<JSONObject> getKuaiShouOperateAccountInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
                                                             @RequestParam(name = "pageSize", defaultValue = "1000") int pageSize,
+                                                            @RequestParam(name = "mediaType", required = false) String mediaType,
                                                             @RequestParam(name = "startTime") String startTime,
                                                             @RequestParam(name = "endTime") String endTime,
                                                             @RequestParam(name = "projectId", required = false) String projectId,
                                                             @RequestParam(name = "userId") String userId) {
-
-
-        return materialStareService.getKuaiShouOperateAccountInfo(pageNum, pageSize, startTime, endTime, projectId, userId);
+        String cacheKey = "dashboard:stare:accountInfo:" + safe(mediaType) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(projectId) + ":" + safe(userId) + ":" + safe(pageNum) + ":" + safe(pageSize);
+        return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.getKuaiShouOperateAccountInfo(pageNum, pageSize, startTime, endTime, projectId, userId, mediaType));
     }
 
 
@@ -292,7 +310,8 @@ public class KuaiShouMaterialStareController {
                                                       @RequestParam(name = "startTime") String startTime,
                                                       @RequestParam(name = "endTime") String endTime,
                                                       @RequestParam(name = "userId") String userId) {
-        return materialStareService.kuaiShousumDataPersonal(mediaType, startTime, endTime, userId);
+        String cacheKey = "dashboard:stare:sumDataPersonal:" + safe(mediaType) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId);
+        return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.kuaiShousumDataPersonal(mediaType, startTime, endTime, userId));
     }
 
 
@@ -311,28 +330,49 @@ public class KuaiShouMaterialStareController {
                                                                @RequestParam(name = "startTime") String startTime,
                                                                @RequestParam(name = "endTime") String endTime,
                                                                @RequestParam(name = "userId") String userId) {
-        //查询用户角色
-        String roleCode = materialStareMapper.getRoleCodeByUserId(userId);
-        //判断是否运营相关角色,并获取媒体类型
-        if (!Check.isNull(roleCode)) {
-            if ("touTiaoOperationManager".equals(roleCode)) {
-                mediaType = "1";
-            } else if ("kuaishouOperationManager".equals(roleCode)) {
-                mediaType = "2";
-            } else if (roleCode.toLowerCase().contains("perat")) {
-                String leaderRoleCode = materialStareMapper.getOperatLeaderRole(userId);
-                if (!Check.isNull(leaderRoleCode)) {
-                    if ("touTiaoOperationManager".equals(leaderRoleCode)) {
-                        mediaType = "1";
-                    } else if ("kuaishouOperationManager".equals(leaderRoleCode)) {
-                        mediaType = "2";
+        if (!"16".equals(mediaType)) {
+            //查询用户角色
+            String roleCode = materialStareMapper.getRoleCodeByUserId(userId);
+            //判断是否运营相关角色,并获取媒体类型
+            if (!Check.isNull(roleCode)) {
+                if ("touTiaoOperationManager".equals(roleCode)) {
+                    mediaType = "1";
+                } else if ("kuaishouOperationManager".equals(roleCode)) {
+                    mediaType = "2";
+                } else if (roleCode.toLowerCase().contains("perat")) {
+                    String leaderRoleCode = materialStareMapper.getOperatLeaderRole(userId);
+                    if (!Check.isNull(leaderRoleCode)) {
+                        if ("touTiaoOperationManager".equals(leaderRoleCode)) {
+                            mediaType = "1";
+                        } else if ("kuaishouOperationManager".equals(leaderRoleCode)) {
+                            mediaType = "2";
+                        }
                     }
+                } else {
+                    return Result.successMsg("非运营相关角色,不显示数据", null);
                 }
-            } else {
-                return Result.successMsg("非运营相关角色,不显示数据", null);
             }
         }
-        return materialStareService.kuaiShouOperateDateTotalPersonal(mediaType, startTime, endTime, userId);
+        String cacheKey = "dashboard:stare:dateTotalPersonal:" + safe(mediaType) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId);
+        final String resolvedMediaType = mediaType;
+        return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> materialStareService.kuaiShouOperateDateTotalPersonal(resolvedMediaType, startTime, endTime, userId));
+    }
+
+    @SuppressWarnings("unchecked")
+    private Result<JSONObject> getCachedResult(String cacheKey, long ttlMillis, Supplier<Result> loader) {
+        return dashboardLocalCacheService.getIfCacheable(cacheKey, ttlMillis, loader, result -> result != null && result.isSuccess());
+    }
+
+    private long resolveCacheTtl(String startTime, String endTime) {
+        String today = DateUtils.formatDate(new Date());
+        if (today.equals(startTime) && today.equals(endTime)) {
+            return REALTIME_CACHE_TTL;
+        }
+        return HISTORY_CACHE_TTL;
+    }
+
+    private String safe(Object value) {
+        return value == null ? "null" : String.valueOf(value);
     }
 
 
@@ -576,7 +616,6 @@ public class KuaiShouMaterialStareController {
             @RequestParam(name = "endTime") String endTime,
             @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
             @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize) {
-
         return materialStareService.getOperationGroupData(userId, mediaType, startTime, endTime, pageNum, pageSize);
     }
 

+ 4 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/ManagerSaleValueController.java

@@ -22,6 +22,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 分公司总经理&销售总监阶段性目标值
@@ -35,6 +37,8 @@ import java.util.List;
 @RestController
 @RequestMapping("/manager/sale")
 public class ManagerSaleValueController {
+    private static final Logger log = LoggerFactory.getLogger(ManagerSaleValueController.class);
+
     @Autowired
     private IManagerSaleValueService managerSaleValueService;
 

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

@@ -160,15 +160,15 @@ public class ReportController {
      * @param mediaId
      */
     @GetMapping("/getProjectReport")
-    public Result<Object> getProjectReport(String mediaId, String category, String sortCode, String order, Long projectId, String startTime, String endTime, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+    public Result<Object> getProjectReport(String mediaId, String category, String sortCode, String order, Long projectId, String startTime, String endTime, String userId, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
-            String cacheKey = "dashboard:summary:getProjectReport:" + safe(mediaId) + ":" + safe(category) + ":" + safe(sortCode) + ":" + safe(order) + ":" + safe(projectId) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(pageNo) + ":" + safe(pageSize);
+            String cacheKey = "dashboard:summary:getProjectReport:" + safe(mediaId) + ":" + safe(category) + ":" + safe(sortCode) + ":" + safe(order) + ":" + safe(projectId) + ":" + safe(startTime) + ":" + safe(endTime) + ":" + safe(userId) + ":" + safe(pageNo) + ":" + safe(pageSize);
             return getCachedResult(cacheKey, resolveCacheTtl(startTime, endTime), () -> {
                 try {
                     if ("1".equals(mediaId)) {
                         return bytedanceReportService.getProjectReport(category, projectId, startTime, endTime, sortCode, order, pageSize, pageNo);
                     } else if ("16".equals(mediaId)) {
-                        return adqAdvertiserReportService.getProjectReport(category, projectId, startTime, endTime, sortCode, order, pageSize, pageNo);
+                        return adqAdvertiserReportService.getProjectReport(category, projectId, startTime, endTime, sortCode, order, pageSize, pageNo, userId);
                     }
                     return kuaishouReportService.getProjectReport(category, projectId, startTime, endTime, sortCode, order, pageSize, pageNo);
                 } catch (Exception e) {

+ 24 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/AccountTrendPojo.java

@@ -15,4 +15,27 @@ public class AccountTrendPojo {
     private String cost;
     private String area;
 
-}
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getCost() {
+        return cost;
+    }
+
+    public void setCost(String cost) {
+        this.cost = cost;
+    }
+
+    public String getArea() {
+        return area;
+    }
+
+    public void setArea(String area) {
+        this.area = area;
+    }
+}

+ 48 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/ManagerSaleValue.java

@@ -52,4 +52,52 @@ public class ManagerSaleValue {
 	@Excel(name = "快手消耗目标值", width = 15)
     @ApiModelProperty(value = "快手消耗目标值")
 	private String monthlyGoalValue;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public Integer getMediaId() {
+        return mediaId;
+    }
+
+    public void setMediaId(Integer mediaId) {
+        this.mediaId = mediaId;
+    }
+
+    public String getWeeklyGoalValue() {
+        return weeklyGoalValue;
+    }
+
+    public void setWeeklyGoalValue(String weeklyGoalValue) {
+        this.weeklyGoalValue = weeklyGoalValue;
+    }
+
+    public String getMonthlyGoalValue() {
+        return monthlyGoalValue;
+    }
+
+    public void setMonthlyGoalValue(String monthlyGoalValue) {
+        this.monthlyGoalValue = monthlyGoalValue;
+    }
 }

+ 4 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateAccountVo.java

@@ -20,6 +20,9 @@ public class KuaiShouOperateAccountVo {
     @ApiModelProperty(value = "总花费")
     private Double totalCost;
 
+    private Double lastTotalCost;
+    private Double equallyTotalCost;
+
     private String projectId;
     private String projectName;
 
@@ -123,4 +126,4 @@ public class KuaiShouOperateAccountVo {
 
 
 
-}
+}

+ 360 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateProjectVo.java

@@ -144,4 +144,363 @@ public class KuaiShouOperateProjectVo {
     private String inventory;
 
 
-}
+    public Integer getAccountNum() {
+        return accountNum;
+    }
+
+    public void setAccountNum(Integer accountNum) {
+        this.accountNum = accountNum;
+    }
+
+    public Double getTotalCost() {
+        return totalCost;
+    }
+
+    public void setTotalCost(Double totalCost) {
+        this.totalCost = totalCost;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public Integer getUserNum() {
+        return userNum;
+    }
+
+    public void setUserNum(Integer userNum) {
+        this.userNum = userNum;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public Integer getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Integer activation) {
+        this.activation = activation;
+    }
+
+    public String getActivationPrice() {
+        return activationPrice;
+    }
+
+    public void setActivationPrice(String activationPrice) {
+        this.activationPrice = activationPrice;
+    }
+
+    public String getLeave() {
+        return leave;
+    }
+
+    public void setLeave(String leave) {
+        this.leave = leave;
+    }
+
+    public Integer getEventPay() {
+        return eventPay;
+    }
+
+    public void setEventPay(Integer eventPay) {
+        this.eventPay = eventPay;
+    }
+
+    public String getEventPayCost() {
+        return eventPayCost;
+    }
+
+    public void setEventPayCost(String eventPayCost) {
+        this.eventPayCost = eventPayCost;
+    }
+
+    public String getEventPayRate() {
+        return eventPayRate;
+    }
+
+    public void setEventPayRate(String eventPayRate) {
+        this.eventPayRate = eventPayRate;
+    }
+
+    public Integer getEventNewUserPay() {
+        return eventNewUserPay;
+    }
+
+    public void setEventNewUserPay(Integer eventNewUserPay) {
+        this.eventNewUserPay = eventNewUserPay;
+    }
+
+    public String getEventNewUserPayCost() {
+        return eventNewUserPayCost;
+    }
+
+    public void setEventNewUserPayCost(String eventNewUserPayCost) {
+        this.eventNewUserPayCost = eventNewUserPayCost;
+    }
+
+    public String getEventNewUserPayRate() {
+        return eventNewUserPayRate;
+    }
+
+    public void setEventNewUserPayRate(String eventNewUserPayRate) {
+        this.eventNewUserPayRate = eventNewUserPayRate;
+    }
+
+    public Integer getEventAppInvoked() {
+        return eventAppInvoked;
+    }
+
+    public void setEventAppInvoked(Integer eventAppInvoked) {
+        this.eventAppInvoked = eventAppInvoked;
+    }
+
+    public String getEventAppInvokedCost() {
+        return eventAppInvokedCost;
+    }
+
+    public void setEventAppInvokedCost(String eventAppInvokedCost) {
+        this.eventAppInvokedCost = eventAppInvokedCost;
+    }
+
+    public Integer getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Integer eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public String getEventRegisterCost() {
+        return eventRegisterCost;
+    }
+
+    public void setEventRegisterCost(String eventRegisterCost) {
+        this.eventRegisterCost = eventRegisterCost;
+    }
+
+    public Integer getKeyAction() {
+        return keyAction;
+    }
+
+    public void setKeyAction(Integer keyAction) {
+        this.keyAction = keyAction;
+    }
+
+    public String getKeyActionCost() {
+        return keyActionCost;
+    }
+
+    public void setKeyActionCost(String keyActionCost) {
+        this.keyActionCost = keyActionCost;
+    }
+
+    public String getKeyActionRate() {
+        return keyActionRate;
+    }
+
+    public void setKeyActionRate(String keyActionRate) {
+        this.keyActionRate = keyActionRate;
+    }
+
+    public String getEventPayPurchaseAmountFirstDay() {
+        return eventPayPurchaseAmountFirstDay;
+    }
+
+    public void setEventPayPurchaseAmountFirstDay(String eventPayPurchaseAmountFirstDay) {
+        this.eventPayPurchaseAmountFirstDay = eventPayPurchaseAmountFirstDay;
+    }
+
+    public String getEventPayFirstDayRoi() {
+        return eventPayFirstDayRoi;
+    }
+
+    public void setEventPayFirstDayRoi(String eventPayFirstDayRoi) {
+        this.eventPayFirstDayRoi = eventPayFirstDayRoi;
+    }
+
+    public Integer getFormCount() {
+        return formCount;
+    }
+
+    public void setFormCount(Integer formCount) {
+        this.formCount = formCount;
+    }
+
+    public String getFormCountPrice() {
+        return formCountPrice;
+    }
+
+    public void setFormCountPrice(String formCountPrice) {
+        this.formCountPrice = formCountPrice;
+    }
+
+    public Integer getNewEffectNum() {
+        return newEffectNum;
+    }
+
+    public void setNewEffectNum(Integer newEffectNum) {
+        this.newEffectNum = newEffectNum;
+    }
+
+    public Integer getNewVideoNum() {
+        return newVideoNum;
+    }
+
+    public void setNewVideoNum(Integer newVideoNum) {
+        this.newVideoNum = newVideoNum;
+    }
+
+    public Integer getNewHotNum() {
+        return newHotNum;
+    }
+
+    public void setNewHotNum(Integer newHotNum) {
+        this.newHotNum = newHotNum;
+    }
+
+    public String getYearOnYear() {
+        return yearOnYear;
+    }
+
+    public void setYearOnYear(String yearOnYear) {
+        this.yearOnYear = yearOnYear;
+    }
+
+    public String getEquallyRate() {
+        return equallyRate;
+    }
+
+    public void setEquallyRate(String equallyRate) {
+        this.equallyRate = equallyRate;
+    }
+
+    public Integer getTrustUnitNum() {
+        return trustUnitNum;
+    }
+
+    public void setTrustUnitNum(Integer trustUnitNum) {
+        this.trustUnitNum = trustUnitNum;
+    }
+
+    public Integer getNewUnitNum() {
+        return newUnitNum;
+    }
+
+    public void setNewUnitNum(Integer newUnitNum) {
+        this.newUnitNum = newUnitNum;
+    }
+
+    public Integer getNewProjectNum() {
+        return newProjectNum;
+    }
+
+    public void setNewProjectNum(Integer newProjectNum) {
+        this.newProjectNum = newProjectNum;
+    }
+
+    public long getAdspNum() {
+        return adspNum;
+    }
+
+    public void setAdspNum(long adspNum) {
+        this.adspNum = adspNum;
+    }
+
+    public long getMediaNum() {
+        return mediaNum;
+    }
+
+    public void setMediaNum(long mediaNum) {
+        this.mediaNum = mediaNum;
+    }
+
+    public List<JSONObject> getAdSceneDate() {
+        return adSceneDate;
+    }
+
+    public void setAdSceneDate(List<JSONObject> adSceneDate) {
+        this.adSceneDate = adSceneDate;
+    }
+
+    public String getAdSceneDateStr() {
+        return adSceneDateStr;
+    }
+
+    public void setAdSceneDateStr(String adSceneDateStr) {
+        this.adSceneDateStr = adSceneDateStr;
+    }
+
+    public String getJiLishiPin() {
+        return jiLishiPin;
+    }
+
+    public void setJiLishiPin(String jiLishiPin) {
+        this.jiLishiPin = jiLishiPin;
+    }
+
+    public String getKaiPing() {
+        return kaiPing;
+    }
+
+    public void setKaiPing(String kaiPing) {
+        this.kaiPing = kaiPing;
+    }
+
+    public String getSouSuo() {
+        return souSuo;
+    }
+
+    public void setSouSuo(String souSuo) {
+        this.souSuo = souSuo;
+    }
+
+    public String getShangXiaHua() {
+        return shangXiaHua;
+    }
+
+    public void setShangXiaHua(String shangXiaHua) {
+        this.shangXiaHua = shangXiaHua;
+    }
+
+    public String getLianMeng() {
+        return lianMeng;
+    }
+
+    public void setLianMeng(String lianMeng) {
+        this.lianMeng = lianMeng;
+    }
+
+    public String getXinxiLiu() {
+        return xinxiLiu;
+    }
+
+    public void setXinxiLiu(String xinxiLiu) {
+        this.xinxiLiu = xinxiLiu;
+    }
+
+    public String getInventory() {
+        return inventory;
+    }
+
+    public void setInventory(String inventory) {
+        this.inventory = inventory;
+    }
+}

+ 72 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateVo.java

@@ -50,4 +50,75 @@ public class KuaiShouOperateVo implements Serializable {
 
 
 
-}
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getAccountNum() {
+        return accountNum;
+    }
+
+    public void setAccountNum(Integer accountNum) {
+        this.accountNum = accountNum;
+    }
+
+    public Integer getProjectNum() {
+        return projectNum;
+    }
+
+    public void setProjectNum(Integer projectNum) {
+        this.projectNum = projectNum;
+    }
+
+    public Double getTotalCost() {
+        return totalCost;
+    }
+
+    public void setTotalCost(Double totalCost) {
+        this.totalCost = totalCost;
+    }
+
+    public String getRate() {
+        return rate;
+    }
+
+    public void setRate(String rate) {
+        this.rate = rate;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public Integer getNewCampaignNum() {
+        return newCampaignNum;
+    }
+
+    public void setNewCampaignNum(Integer newCampaignNum) {
+        this.newCampaignNum = newCampaignNum;
+    }
+
+    public Integer getNewUnitNum() {
+        return newUnitNum;
+    }
+
+    public void setNewUnitNum(Integer newUnitNum) {
+        this.newUnitNum = newUnitNum;
+    }
+
+    public Integer getNewProjectNum() {
+        return newProjectNum;
+    }
+
+    public void setNewProjectNum(Integer newProjectNum) {
+        this.newProjectNum = newProjectNum;
+    }
+}

+ 2 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/AdqAdvertiserReportMapper.java

@@ -33,9 +33,9 @@ public interface AdqAdvertiserReportMapper {
 
     List<JSONObject> getProjectAccountOperatorCountByDayAndIds(@Param("statDate") Integer statDate, @Param("projectIds") List<Long> projectIds);
 
-    List<JSONObject> getProjectToDayReport(@Param("category") String category, @Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("hour") Integer hour, @Param("sortCode") String sortCode, @Param("order") String order);
+    List<JSONObject> getProjectToDayReport(@Param("category") String category, @Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("hour") Integer hour, @Param("sortCode") String sortCode, @Param("order") String order, @Param("userIds") List<String> userIds);
 
-    List<JSONObject> getProjectMoreDaysReport(@Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("endTime") Integer endTime, @Param("lastStart") Integer lastStart, @Param("lastEnd") Integer lastEnd, @Param("sortCode") String sortCode, @Param("order") String order);
+    List<JSONObject> getProjectMoreDaysReport(@Param("projectId") Long projectId, @Param("startTime") Integer startTime, @Param("endTime") Integer endTime, @Param("lastStart") Integer lastStart, @Param("lastEnd") Integer lastEnd, @Param("sortCode") String sortCode, @Param("order") String order, @Param("userIds") List<String> userIds);
 
     List<JSONObject> getProjectNoByDays(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);
 

File diff suppressed because it is too large
+ 37 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialStareMapper.java


+ 36 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/AdqAdvertiserReportMapper.xml

@@ -189,6 +189,12 @@
                    SUM(t1.valid_click_count) AS bclick
             FROM application.adq_advertiser_report_hourly t1
             WHERE t1.stat_date = #{startTime}
+            <if test='userIds!=null and userIds.size()>0'>
+                AND t1.user_id IN
+                <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
             <if test="projectId != null and projectId != ''">
                 AND t1.project_id = #{projectId}
             </if>
@@ -235,6 +241,12 @@
                               INNER JOIN active_projects active ON active.projectId = report.project_id
                      WHERE report.stat_date = DATE_FORMAT(DATE_SUB(#{startTime}, INTERVAL 1 DAY), '%Y%m%d')
                        AND report.stat_hour &lt;= #{hour}
+                     <if test='userIds!=null and userIds.size()>0'>
+                         AND report.user_id IN
+                         <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                             #{item}
+                         </foreach>
+                     </if>
                      GROUP BY report.project_id
                  ) t7 ON ap.projectId = t7.project_id
                           LEFT JOIN (
@@ -246,6 +258,12 @@
                      WHERE report.stat_date = #{startTime}
                        AND report.stat_hour &lt;= #{hour}
                        AND report.cost > 0
+                     <if test='userIds!=null and userIds.size()>0'>
+                         AND report.user_id IN
+                         <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                             #{item}
+                         </foreach>
+                     </if>
                      GROUP BY report.project_id
                  ) t9 ON ap.projectId = t9.project_id
              ) t
@@ -265,6 +283,12 @@
             FROM application.adq_advertiser_report_daily t1
             WHERE t1.stat_date >= #{startTime}
               AND t1.stat_date &lt;= #{endTime}
+            <if test='userIds!=null and userIds.size()>0'>
+                AND t1.user_id IN
+                <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
             <if test="projectId != null and projectId != ''">
                 AND t1.project_id = #{projectId}
             </if>
@@ -311,6 +335,12 @@
                               INNER JOIN active_projects active ON active.projectId = daily.project_id
                      WHERE daily.stat_date >= #{lastStart}
                        AND daily.stat_date &lt;= #{lastEnd}
+                     <if test='userIds!=null and userIds.size()>0'>
+                         AND daily.user_id IN
+                         <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                             #{item}
+                         </foreach>
+                     </if>
                      GROUP BY daily.project_id
                  ) t7 ON ap.projectId = t7.project_id
                           LEFT JOIN (
@@ -321,6 +351,12 @@
                               INNER JOIN active_projects active ON active.projectId = daily.project_id
                      WHERE daily.stat_date >= #{startTime}
                        AND daily.stat_date &lt;= #{endTime}
+                     <if test='userIds!=null and userIds.size()>0'>
+                         AND daily.user_id IN
+                         <foreach collection="userIds" item="item" separator="," open="(" close=")">
+                             #{item}
+                         </foreach>
+                     </if>
                      GROUP BY daily.project_id
                      HAVING SUM(daily.cost) > 0
                  ) t9 ON ap.projectId = t9.project_id

File diff suppressed because it is too large
+ 1180 - 182
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml


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

@@ -11,7 +11,7 @@ public interface IAdqAdvertiserReportService {
 
     JSONObject getTrendCharge(String type, Long projectId, String startTime, String endTime);
 
-    Result<Object> getProjectReport(String category, Long projectId, String startTime, String endTime, String sortCode, String order, Integer pageSize, Integer pageNo) throws Exception;
+    Result<Object> getProjectReport(String category, Long projectId, String startTime, String endTime, String sortCode, String order, Integer pageSize, Integer pageNo, String userId) throws Exception;
 
     Result<Object> getOperateInfo(String startTime, String endTime);
 

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

@@ -32,7 +32,7 @@ public interface MaterialStareService {
 
     List<KuaiShouOperateProjectVo> exportKuaiShouOperateProjectInfo(String mediaType, String startTime, String endTime, String userId);
 
-    Result getKuaiShouOperateAccountInfo(Integer pageNum, int pageSize, String startTime, String endTime, String projectId, String userId);
+    Result getKuaiShouOperateAccountInfo(Integer pageNum, int pageSize, String startTime, String endTime, String projectId, String userId, String mediaType);
 
     List<KuaiShouOperateAccountVo> exportKuaiShouOperateAccountInfo(String startTime, String endTime, String projectId, String userId);
 

+ 33 - 3
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/AdqAdvertiserReportServiceImpl.java

@@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.ctop.material.constants.Check;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateGroupVo;
 import org.jeecg.ctop.material.mapper.AdqAdvertiserReportMapper;
+import org.jeecg.ctop.material.mapper.MaterialStareMapper;
 import org.jeecg.ctop.material.service.IAdqAdvertiserReportService;
 import org.jeecg.ctop.material.service.support.DashboardQuerySupport;
 import org.springframework.stereotype.Service;
@@ -35,6 +37,9 @@ public class AdqAdvertiserReportServiceImpl implements IAdqAdvertiserReportServi
     @Resource
     private DashboardQuerySupport dashboardQuerySupport;
 
+    @Resource
+    private MaterialStareMapper materialStareMapper;
+
     @Override
     public JSONObject getTotalCharge(Map<String, Object> paramsMap) {
         CompletableFuture<JSONObject> hourlyFuture = CompletableFuture.supplyAsync(
@@ -123,7 +128,7 @@ public class AdqAdvertiserReportServiceImpl implements IAdqAdvertiserReportServi
     }
 
     @Override
-    public Result<Object> getProjectReport(String category, Long projectId, String startTime, String endTime, String sortCode, String order, Integer pageSize, Integer pageNo) throws Exception {
+    public Result<Object> getProjectReport(String category, Long projectId, String startTime, String endTime, String sortCode, String order, Integer pageSize, Integer pageNo, String userId) throws Exception {
         if (Check.isNull(order)) {
             order = "DESC";
         }
@@ -136,15 +141,16 @@ public class AdqAdvertiserReportServiceImpl implements IAdqAdvertiserReportServi
         String today = DateUtils.formatDate(new Date());
 
         List<JSONObject> data;
+        List<String> userIds = resolveTencentUserIds(userId);
         if (startTime.equals(endTime) && today.equals(startTime)) {
             PageHelper.startPage(pageNo, pageSize, false);
-            data = adqAdvertiserReportMapper.getProjectToDayReport(category, projectId, startTimeInt, nowHour, sortCode, order);
+            data = adqAdvertiserReportMapper.getProjectToDayReport(category, projectId, startTimeInt, nowHour, sortCode, order, userIds);
         } else {
             int days = DateUtils.dateDiff(startTime, endTime) + 1;
             Integer lastStart = DateUtils.getDateInteger(DateUtils.getLastDay(startTime, days));
             Integer lastEnd = DateUtils.getDateInteger(DateUtils.getLastDay(endTime, days));
             PageHelper.startPage(pageNo, pageSize, false);
-            data = adqAdvertiserReportMapper.getProjectMoreDaysReport(projectId, startTimeInt, endTimeInt, lastStart, lastEnd, sortCode, order);
+            data = adqAdvertiserReportMapper.getProjectMoreDaysReport(projectId, startTimeInt, endTimeInt, lastStart, lastEnd, sortCode, order, userIds);
         }
         PageInfo<JSONObject> page = new PageInfo<>(data);
         return Result.OK(page);
@@ -284,4 +290,28 @@ public class AdqAdvertiserReportServiceImpl implements IAdqAdvertiserReportServi
     private String getString(JSONObject row, String key) {
         return row == null ? null : row.getString(key);
     }
+
+    private List<String> resolveTencentUserIds(String userId) {
+        if (StringUtils.isBlank(userId)) {
+            return dashboardQuerySupport.getAllOperationUserIds("16");
+        }
+        return new ArrayList<>(getAffiliateId(userId));
+    }
+
+    private Set<String> getAffiliateId(String userId) {
+        String roleCode = materialStareMapper.getRoleCodeByUserId(userId);
+        Set<String> result;
+        Set<String> subordinate = materialStareMapper.getAffiliateId(userId, null);
+        if (subordinate.isEmpty()) {
+            if ("admin".equals(roleCode)) {
+                return materialStareMapper.getCompanyAllUserId(null);
+            }
+            subordinate.add(userId);
+            return subordinate;
+        } else {
+            result = materialStareMapper.getSaleDirctorItsTeamMember(userId);
+            result.add(userId);
+        }
+        return result;
+    }
 }

File diff suppressed because it is too large
+ 706 - 625
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java


+ 10 - 1
pom.xml

@@ -45,6 +45,7 @@
 		<justauth-spring-boot-starter.version>1.3.4</justauth-spring-boot-starter.version>
 		<dom4j.version>1.6.1</dom4j.version>
 		<qiniu-java-sdk.version>7.4.0</qiniu-java-sdk.version>
+		<lombok.version>1.18.36</lombok.version>
 	</properties>
 
 	<modules>
@@ -100,6 +101,7 @@
 		<dependency>
 			<groupId>org.projectlombok</groupId>
 			<artifactId>lombok</artifactId>
+			<version>${lombok.version}</version>
 		</dependency>
 		<!-- json -->
 		<dependency>
@@ -271,6 +273,13 @@
                     <source>1.8</source>
                     <target>1.8</target>
                     <encoding>UTF-8</encoding>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                            <version>${lombok.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
                 </configuration>
             </plugin>
             <!-- 打包跳过测试 -->
@@ -313,4 +322,4 @@
 			</resource>
 		</resources>
 	</build>
-</project>
+</project>