소스 검색

Merge remote-tracking branch 'origin/test' into test

zhouzeyu@c-top.com.cn 3 년 전
부모
커밋
3acf6b56e1
47개의 변경된 파일943개의 추가작업 그리고 270개의 파일을 삭제
  1. 4 2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 21 24
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/controller/AgentManagementController.java
  3. 1 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/CtopAccountTransactionDayMapper.java
  4. 4 4
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/AgentManagementService.java
  5. 35 35
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/impl/AgentManagementServiceImpl.java
  6. 7 5
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java
  7. 4 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportBytedanceVo.java
  8. 3 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportKuaiShouVo.java
  9. 35 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml
  10. 4 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java
  11. 7 6
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/SettlementInfoServiceImpl.java
  12. 1 1
      jeecg-boot-finance/src/main/resources/application-prod.yml
  13. 19 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/RuleDataTargetKuaishou.java
  14. 3 18
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/RuleDateUnitKuaishou.java
  15. 0 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  16. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  17. 3 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java
  18. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java
  19. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  20. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroupTemplate.java
  21. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  22. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java
  23. 7 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  24. 8 6
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java
  25. 7 6
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewPlanReportCtrl.java
  26. 36 23
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java
  27. 246 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyExploreController.java
  28. 141 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyExplore.java
  29. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyExploreMapper.java
  30. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyExploreMapper.xml
  31. 5 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouGroupExploreService.java
  32. 14 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyExploreService.java
  33. 58 41
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouGroupExploreServiceImpl.java
  34. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyExploreServiceImpl.java
  35. 4 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/RuleKuaiShouPlanServiceImpl.java
  36. 6 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceNewPlanReportCtrl.java
  37. 0 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java
  38. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  39. 3 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  40. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  41. 10 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java
  42. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/MaterialUsrController.java
  43. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/mapper/MaterialUsrServiceMapper.java
  44. 65 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/mapper/xml/MaterialUseMapper.xml
  45. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/service/IMaterialUsrService.java
  46. 69 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/service/impl/MaterialUsrServiceImpl.java
  47. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

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

@@ -212,12 +212,14 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/dimension/kuaiShouDimensionAccount/*", "anon");
         filterChainDefinitionMap.put("/ai/projectCreate/*", "anon");
         filterChainDefinitionMap.put("/cwjsPolicyInfo/**", "anon");
+        filterChainDefinitionMap.put("/explores/**", "anon");
 
 
         filterChainDefinitionMap.put("/exportReportController/**", "anon");
         //filterChainDefinitionMap.put("/settLementController/**", "anon");
-        //filterChainDefinitionMap.put("/settLementFileController/**", "anon");
-        //filterChainDefinitionMap.put("/ctop/projectMember/**", "anon");
+        filterChainDefinitionMap.put("/settLementFileController/**", "anon");
+        filterChainDefinitionMap.put("/ctop/projectMember/**", "anon");
+        filterChainDefinitionMap.put("/agent/**", "anon");
 
 
         // 添加自己的过滤器并且取名为jwt

+ 21 - 24
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/controller/AgentManagementController.java

@@ -10,9 +10,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
 
 @RestController
 @RequestMapping("/agent")
@@ -22,9 +19,10 @@ public class AgentManagementController {
     @Autowired
     AgentManagementService agentManagementService;
 
+
     @RequestMapping("/queryAccountTransactionDetails")
-    public void getList(@Param("starDate")String startDate,@Param("endDate")String endDate) {
-        Result recharge = agentManagementService.synchronousAccountTransactionDetails(startDate,endDate);
+    public void getList(@Param("starDate") String startDate, @Param("endDate") String endDate) {
+        Result recharge = agentManagementService.synchronousAccountTransactionDetails(startDate, endDate);
 
     }
 
@@ -35,36 +33,35 @@ public class AgentManagementController {
 
 
     @RequestMapping("/synchronousAccountTransactionDay")
-    public void synchronousAccountTransactionDay(@Param("starDate")String startDate,@Param("endDate")String endDate) {
-        Result recharge = agentManagementService.synchronousAccountTransactionDay(startDate,endDate);
+    public void synchronousAccountTransactionDay(@Param("starDate") String startDate, @Param("endDate") String endDate) {
+        Result recharge = agentManagementService.synchronousAccountTransactionDay(startDate, endDate);
     }
 
 
     @RequestMapping("/synchronous")
     public void synchronous() throws ParseException {
-        String date1="2021-05-01";
-        String date2="2021-05-31";
-        String date3="2021-06-01";
-        String date4="2021-06-30";
-        String date5="2021-07-01";
-        String date6="2021-07-31";
-        String date7="2021-08-01";
-        String date8="2021-08-31";
+        String date1 = "2021-05-01";
+        String date2 = "2021-05-31";
+        String date3 = "2021-06-01";
+        String date4 = "2021-06-30";
+        String date5 = "2021-07-01";
+        String date6 = "2021-07-31";
+        String date7 = "2021-08-01";
+        String date8 = "2021-08-31";
         agentManagementService.synchronousAccount();
         //5月份
-         agentManagementService.synchronousAccountTransactionDetails(date1,date2);
-         agentManagementService.synchronousAccountTransactionDay(date1,date2);
+        agentManagementService.synchronousAccountTransactionDetails(date1, date2);
+        agentManagementService.synchronousAccountTransactionDay(date1, date2);
         //6月份
-         agentManagementService.synchronousAccountTransactionDetails(date3,date4);
-         agentManagementService.synchronousAccountTransactionDay(date3,date4);
+        agentManagementService.synchronousAccountTransactionDetails(date3, date4);
+        agentManagementService.synchronousAccountTransactionDay(date3, date4);
         //7月份
-         agentManagementService.synchronousAccountTransactionDetails(date5,date6);
-         agentManagementService.synchronousAccountTransactionDay(date5,date6);
+        agentManagementService.synchronousAccountTransactionDetails(date5, date6);
+        agentManagementService.synchronousAccountTransactionDay(date5, date6);
         //8月份
-          agentManagementService.synchronousAccountTransactionDetails(date7,date8);
-          agentManagementService.synchronousAccountTransactionDay(date7,date8);
+        agentManagementService.synchronousAccountTransactionDetails(date7, date8);
+        agentManagementService.synchronousAccountTransactionDay(date7, date8);
     }
 
 
-
 }

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/CtopAccountTransactionDayMapper.java

@@ -9,7 +9,7 @@ import java.util.List;
 @Mapper
 public interface CtopAccountTransactionDayMapper {
 
-    List<String> getAdvertiserIdByDate(@Param("date") String date,@Param("advertiserId") String advertiserId);
+    List<String> getAdvertiserIdByDate(@Param("date") String date, @Param("advertiserId") String advertiserId);
 
     void saveAccountTransactionDay(@Param("list") List<TransactionDay> list, @Param("date") String date);
 

+ 4 - 4
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/AgentManagementService.java

@@ -12,17 +12,17 @@ public interface AgentManagementService {
 
 
     //查询账号流水
-    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize,String startDate,String endDate);
+    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate, String endDate);
 
     //查询账号流水
-    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize,String startDate,String endDate);
+    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize, String startDate, String endDate);
 
     //同步代理商账户入库
     public Result synchronousAccount();
 
     //同步账户交易流水
-    public Result synchronousAccountTransactionDetails(String startDate,String endDate);
+    public Result synchronousAccountTransactionDetails(String startDate, String endDate);
 
     //同步账户日流水
-    public Result synchronousAccountTransactionDay(String startDate,String endDate);
+    public Result synchronousAccountTransactionDay(String startDate, String endDate);
 }

+ 35 - 35
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/impl/AgentManagementServiceImpl.java

@@ -124,7 +124,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-15
      */
     @Override
-    public Result synchronousAccountTransactionDetails(String startDate,String endDate) {
+    public Result synchronousAccountTransactionDetails(String startDate, String endDate) {
         log.info("开始同步账号交易流水");
         Result result = new Result();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
@@ -136,9 +136,9 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                 accountIdList.stream().forEach(str -> {
                     if (!str.isEmpty()) {
                         //查询账号下充值的交易流水
-                        JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000, startDate,endDate);
+                        JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000, startDate, endDate);
                         int code = (int) jsonObject.get("code");
-                        if(code!=0){
+                        if (code != 0) {
                             result.setMessage((String) jsonObject.get("message"));
                             log.info((String) jsonObject.get("message"));
                             return;
@@ -162,7 +162,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (total_page > 1) {
                                     for (int i = 2; i <= total_page; i++) {
-                                        JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000, startDate,endDate);
+                                        JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000, startDate, endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(transactionDetails -> {
@@ -178,10 +178,10 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                         }
 
                         //查询账号下转账的交易流水
-                        JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000, startDate,endDate);
+                        JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000, startDate, endDate);
                         JSONObject transferData = (JSONObject) transferJsonObject.get("data");
                         int code1 = (int) jsonObject.get("code");
-                        if(code1!=0){
+                        if (code1 != 0) {
                             result.setMessage((String) jsonObject.get("message"));
                             log.info((String) jsonObject.get("message"));
                             return;
@@ -203,7 +203,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (transferTotalPage > 1) {
                                     for (int i = 2; i <= transferTotalPage; i++) {
-                                        JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000, startDate,endDate);
+                                        JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000, startDate, endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(transactionDetails -> {
@@ -246,7 +246,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-15
      */
     @Override
-    public Result synchronousAccountTransactionDay(String startDate,String endDate) {
+    public Result synchronousAccountTransactionDay(String startDate, String endDate) {
         log.info("开始同步账号日流水");
         Result result = new Result();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
@@ -260,18 +260,18 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                 accountIdList.stream().forEach(str -> {
                     if (!str.isEmpty()) {
                         //查询账号下充值的交易流水
-                        JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000, startDate,endDate);
-                        JSONObject data=null;
-                        int code=1;
-                        if(jsonObject!=null){
-                             data = (JSONObject) jsonObject.get("data");
-                             code = (int) jsonObject.get("code");
-                        }else {
+                        JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000, startDate, endDate);
+                        JSONObject data = null;
+                        int code = 1;
+                        if (jsonObject != null) {
+                            data = (JSONObject) jsonObject.get("data");
+                            code = (int) jsonObject.get("code");
+                        } else {
                             log.info("返回数据jsonObject为null:");
                         }
-                        if(code!=0){
+                        if (code != 0) {
                             result.setMessage((String) jsonObject.get("message"));
-                            log.info("返回数据:"+jsonObject.toJSONString()+":"+str);
+                            log.info("返回数据:" + jsonObject.toJSONString() + ":" + str);
                         }
                         if (data != null) {
                             List<Object> dataList = (List<Object>) data.get("list");
@@ -280,9 +280,9 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //保存第一页数据
                                 dataList.stream().forEach(ob -> {
                                     TransactionDay transactionDay = JSONObject.toJavaObject((JSON) ob, TransactionDay.class);
-                                    List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
+                                    List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(), transactionDay.getAdvertiserId());
                                     //订单号不存在
-                                    if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
+                                    if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
                                         transactionDetailsList.add(transactionDay);
                                     }
 
@@ -292,15 +292,15 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (total_page > 1) {
                                     for (int i = 2; i <= total_page; i++) {
-                                        JSONObject jo = queryAccountTransactionDay(str, i, 1000, startDate,endDate);
+                                        JSONObject jo = queryAccountTransactionDay(str, i, 1000, startDate, endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(obj -> {
                                             TransactionDay transactionDay = JSONObject.toJavaObject((JSON) obj, TransactionDay.class);
-                                            List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
+                                            List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(), transactionDay.getAdvertiserId());
 
                                             //订单号不存在
-                                            if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
+                                            if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
                                                 transactionDetailsList.add(transactionDay);
                                             }
                                         });
@@ -338,7 +338,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-14
      */
     @Override
-    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate,String endDate) {
+    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate, String endDate) {
         // 请求参数
         Map data = new HashMap() {
             {
@@ -362,22 +362,22 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-14
      */
     @Override
-    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize,String startDate,String endDate) {
+    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize, String startDate, String endDate) {
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
         Calendar ca = Calendar.getInstance();
         ca.setTime(new Date());
         ca.add(Calendar.DATE, -1);
-            // 请求参数
-            Map data = new HashMap() {
-                {
-                    put("advertiser_id", AccountId);
-                    put("start_date", startDate);
-                    put("end_date", endDate);
-                    put("page", pageNum);
-                    put("page_size", pageSize);
-                }
-            };
-            return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
+        // 请求参数
+        Map data = new HashMap() {
+            {
+                put("advertiser_id", AccountId);
+                put("start_date", startDate);
+                put("end_date", endDate);
+                put("page", pageNum);
+                put("page_size", pageSize);
+            }
+        };
+        return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
 
 
     }

+ 7 - 5
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java

@@ -36,6 +36,7 @@ import lombok.extern.slf4j.Slf4j;
 
 import org.jeecg.ctop.finance.policy.utils.Check;
 import org.jeecg.ctop.finance.policy.utils.ListPageUtil;
+import org.jeecg.ctop.finance.settlement.service.serviceImpl.ReportSettlementServiceImpl;
 import org.jeecg.modules.ctop.service.IMaterialReportOverViewService;
 import org.jeecg.modules.system.service.ISysRoleService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -89,6 +90,11 @@ public class CwjsPolicyInfoController {
      @Autowired
      private ISysUserService sysUserService;
 
+
+     @Resource
+     private ReportSettlementServiceImpl reportSettlementService;
+
+
 	 @GetMapping(value = "/queryApprovalRejectReason")
 	 public Result<CwjsPolicyApprovalLog> queryApprovalRejectReason(@RequestParam(name="id",required=true) Integer id){
 		 CwjsPolicyApprovalLog policyApprovalLog = policyApprovalLogService.getOneByPolicyId(id);
@@ -154,11 +160,7 @@ public class CwjsPolicyInfoController {
 				  * 终审通过后 添加 起始时间
 				  */
 
-
-
-
-
-
+				 reportSettlementService.cwjsPRofit(cwjsPolicyInfoEntity);
 
 
 			}else{	//不是终审

+ 4 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportBytedanceVo.java

@@ -44,6 +44,10 @@ public class ProfitReportBytedanceVo implements Serializable {
     @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
+    @Excel(name = "政策起止时间",width = 30)
+    private String time;
+
+
 
 
 }

+ 3 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/ProfitReportKuaiShouVo.java

@@ -49,6 +49,9 @@ public class ProfitReportKuaiShouVo implements Serializable {
     @Excel(name = "运营所属区域",width = 12)
     private String operateArea;
 
+    @Excel(name = "政策起止时间",width = 30)
+    private String time;
+
 
 
 }

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

@@ -278,6 +278,7 @@
 
     <!-- 查询 头条利润表  返点类型和比列-->
     <select id="getProfitBytedance" resultType="java.util.LinkedHashMap">
+<!--
 
         SELECT
         pp.create_user_id,
@@ -306,6 +307,40 @@
         <if test="endTime !=null and endTime != ''">
             AND (cp.policy_end_date &gt;= #{startTime} or cp.policy_end_date &lt;= #{endTime})
         </if>
+
+-->
+
+        SELECT t.* from (
+        SELECT
+        cp.rebate_type AS rebateType,
+        cp.rebate_rate AS rebateRate,
+        cp.approved_status AS approvedStatus,
+        min(r.policy_date )as policyStartDate,
+        max(r.policy_date ) as policyEndDate,
+        cp.create_time as createTime
+        FROM
+        ctop_cwjs_policy_info cp
+        RIGHT JOIN ctop_cwjs_slettement_report r on r.policy_id = cp.id and r.advertiser_name = cp.advertiser_name
+        WHERE
+        cp.del_flag = 0
+        and cp.approved_status = 3
+        <if test="mediaType !=null and mediaType != ''">
+            AND cp.media_type = #{mediaType}
+        </if>
+        <if test="productName !=null and productName != ''">
+            AND r.product_name = #{productName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            AND  r.policy_date &gt;= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            AND r.policy_date &lt;= #{endTime}
+        </if>
+        GROUP BY r.policy_id
+        ) t
+
+
+
     </select>
 
 

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

@@ -549,6 +549,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
                     vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
                     BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
+                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
                     resultList.add(vo);
                     policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
                 }
@@ -575,6 +576,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
                     vo.setRewardCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("rewardCost","")+"");//赠款消耗
                     BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
+                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
                     resultList.add(vo);
                 }
             }
@@ -685,13 +687,13 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                         vo.setRebateType("");
                     }
 
-
                     // 时间段内 账户流水 信息
                     List<Map<String,Object>> listAccount = reportSettlementMapper.getProfitKuaiShouCost(map.get("accountId")+"",stringMap.get("startDate"),stringMap.get("endDate"));
                     listAccount.removeAll(Collections.singleton(null));
                     vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
                     vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
                     BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
+                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
                     resultList.add(vo);
                     policyDaysList.addAll(SettlementUtil.getAllDatesOfTwoTimes(stringMap.get("startDate"),stringMap.get("endDate")));
                 }
@@ -717,6 +719,7 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
                     vo.setCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cost","")+"");//总消耗
                     vo.setCashCost(Check.isNull(listAccount) ? "0" : listAccount.get(0).getOrDefault("cashCost","")+"");//现金消耗
                     BeanUtils.copyProperties(voSource,vo,SettlementUtil.getNullPropertyNames(voSource));
+                    vo.setTime(stringMap.get("startDate")+"----"+stringMap.get("endDate"));
                     resultList.add(vo);
                 }
 

+ 7 - 6
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/SettlementInfoServiceImpl.java

@@ -205,11 +205,17 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
                 if (importResult.getList().size() < 1){
                     return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入");
                 }
-
                 for (AccountImportVo importVo : importResult.getList()) {
                     if (Check.isNull(importVo.getAccountId())){
                         continue;
                     }
+                    //查询 账户 状态
+                    UserAllocation userAllocation = userAllocationService.getByAccountId(new Long(importVo.getAccountId()));
+                    if (Check.isNull(userAllocation)){
+                        settlementInfo.setStatus(0);
+                    }else {
+                        settlementInfo.setStatus(userAllocation.getAccountStatus());
+                    }
                     BeanUtils.copyProperties(importVo,settlementInfo);
                     //根据账户id 查看
                     CtopCwjsSettlementInfo cwjs = settlementInfoMapper.getSettlementByAccountId(importVo.getAccountId());
@@ -220,12 +226,7 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
                         settlementInfo.setId(cwjs.getId());
                         settlementInfoMapper.updateById(settlementInfo);
                     }
-
                 }
-
-
-
-
             }catch (Exception e){
                 e.printStackTrace();
                 return Result.error("账户数据上传失败,请使用正确的模板导入!");

+ 1 - 1
jeecg-boot-finance/src/main/resources/application-prod.yml

@@ -125,7 +125,7 @@ spring:
     port: 6379
 #mybatis plus 设置
 mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
+  mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
   global-config:
     # 关闭MP3.0自带的banner
     banner: false

+ 19 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/RuleDataTargetKuaishou.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * 快手预警指标数据
  */
@@ -59,5 +61,21 @@ public class RuleDataTargetKuaishou {
 	private Integer network;
 
 	private java.util.Date createTime;
-
+	/**
+	 * 出价
+	 */
+	private BigDecimal cpaBid;
+	/**
+	 * 深度转化目标出价
+	 */
+	private BigDecimal deepConversionBid;
+	/**
+	 * 深度转化目标 3: 付费,7: 次日留存,10: 完件, 11: 授信 ,0:无
+	 */
+	private Integer deepConversionType;
+	/**
+	 * 优化目标
+	 * 2:行为数;180:激活数;53:表单数;190: 付费;191:首日ROI;324:唤起应用;348:有效线索;383: 授信;384: 完件;394:订单提交;;396:注册
+	 */
+	private Integer ocpxActionType;
 }

+ 3 - 18
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/RuleDateUnitKuaishou.java

@@ -69,32 +69,17 @@ public class RuleDateUnitKuaishou {
      * 付费
      */
     private Long eventPay;
-    /**
-     * 深度转化目标出价
-     */
-    private BigDecimal deepConversionBid;
-    /**
-     * 深度转化目标 3: 付费,7: 次日留存,10: 完件, 11: 授信 ,0:无
-     */
-    private Integer deepConversionType;
+
     /**
      * 安卓版本  3:不限, 4: 4.x+, 5: 5.x+, 6: 6.x+, 7: 7.x+;
      */
     private Integer androidOsv;
-    /**
-     * 优化目标
-     * 2:行为数;180:激活数;53:表单数;190: 付费;191:首日ROI;324:唤起应用;348:有效线索;383: 授信;384: 完件;394:订单提交;;396:注册
-     */
-    private Integer ocpxActionType;
+
     /**
      * 付费单价
      */
     private BigDecimal payCost;
-    /**
-     * 出价
-     */
-    private BigDecimal cpaBid;
-
+    
     private Integer status;
 
     private java.util.Date createTime;

+ 0 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -69,8 +69,6 @@ public interface IUserAllocationService extends IService<UserAllocation> {
 
     List<Long> queryAutomaticAccounts(Long projectId);
 
-
-
     Result<UserAllocation> editUserAlloCation(UserAllocation userAllocation);
 
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -90,7 +90,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
 
         } catch (Exception e) {
             log.error("头条上传视频文件失败,accountId:{}", accountId);
-            log.error(e.getMessage(), e);
+            e.printStackTrace();
         }
     }
 

+ 3 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java

@@ -52,7 +52,6 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
                 }
                 if (!"1".equals(depart.getOrgType())) {
                     depId = depart.getParentId();
-                    continue;
                 } else {
                     UserCompany userCompany = new UserCompany();
                     userCompany.setUserId(user.getId());
@@ -62,7 +61,7 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
                     String departName = depart.getDepartName();
                     if(!Check.isNull(departName)){
                         if(departName.trim().contains("北京汇创思拓数字科技有限公司")){
-                            userCompany.setNickName("华北,石家庄");
+                            userCompany.setNickName("华北");
                         }
                         if(departName.trim().contains("上海汇创思拓数字科技有限公司")){
                             userCompany.setNickName("华东");
@@ -74,7 +73,7 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
                             userCompany.setNickName("华南");
                         }
                         if(departName.trim().contains("北京次元像素")){
-                            userCompany.setNickName("华北,石家庄");
+                            userCompany.setNickName("石家庄");
                         }
                         if(departName.trim().contains("杭州妙构思数字科技有限公司")){
                             userCompany.setNickName("杭州");
@@ -109,7 +108,7 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
     /**
      * 删除公司信息
      *
-     * @param
+     * @param userId 用户id
      */
     @Override
     public void removeByUserId(String userId) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java

@@ -318,7 +318,7 @@ public class AiKuaishouAdvertiserStrategy {
     /**
      * 安卓下载中间页ID
      */
-    private Integer siteId;
+    private String siteId;
     /**
      * 第三方点击检测链接
      */

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -749,7 +749,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         programJson.put("cover_image_tokens", coverImageTokens);
 
         if (!Check.isNull(strategy.getSiteId())) {
-            if (strategy.getSiteId() != -1) {
+            if (!strategy.getSiteId().equals("-1") ) {
                 programJson.put("site_id", strategy.getSiteId());
             }
 
@@ -1455,7 +1455,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         }
         // 安卓下载中间页ID
         if (!Check.isNull(strategy.getSiteId())) {
-            if (strategy.getSiteId() != -1) {
+            if (!strategy.getSiteId().equals("-1") ) {
                 creativeParams.put("site_id", strategy.getSiteId());
             }
         }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroupTemplate.java

@@ -210,7 +210,7 @@ public class KuaiShouGroupTemplate {
     private String creativeName;
     private String actionBarText;
     private String description;
-    private Long siteId;
+    private String siteId;
     private Integer createCreativeCount;
     private Integer creativeStatus;
     private String creativeReviewDetail;

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -915,7 +915,7 @@
 	    sum(t1.form_count) AS 'formCount',
 	    round(
 		sum(
-			t1.play_3s_ratio * t1.photo_show
+			t1.play_3s_ratio * t1.aclick
 		)
 	    ) AS play3sCount
         FROM

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java

@@ -117,7 +117,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
         String creative_name = requestJson.getString("creativeName");
         String action_bar_text = requestJson.getString("actionBarText");
         String description = requestJson.getString("description");
-        Long site_id = requestJson.getLong("siteId");
+        String site_id = requestJson.getString("siteId");
         String schema_uri = requestJson.getString("schemaUri");
         Integer startNumber = 0;
         if (unitName.contains("{{序号}}")) {

+ 7 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1890,13 +1890,13 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     JSONObject dataJson = resultJson.getJSONObject("data");
                     if (!Check.isNullMap(dataJson)) {
                         JSONObject returnJson = new JSONObject();
-                        returnJson.put("isAdWatch5times",dataJson.getInteger("is_ad_watch_5_times"));
-                        returnJson.put("isAdWatch20times",dataJson.getInteger("is_ad_watch_20_times"));
-                        returnJson.put("isAdWatch10Times",dataJson.getInteger("is_ad_watch_10_times"));
-                        returnJson.put("isSevenDayRoi",dataJson.getInteger("is_seven_day_roi"));
-                        returnJson.put("isAppointJumpClick",dataJson.getInteger("is_appoint_jump_click"));
-                        returnJson.put("isEventWeekPayTimes",dataJson.getInteger("is_event_week_pay_times"));
-                        returnJson.put("isAppointForm",dataJson.getInteger("is_appoint_form"));
+                        returnJson.put("isAdWatch5times", dataJson.getInteger("is_ad_watch_5_times"));
+                        returnJson.put("isAdWatch20times", dataJson.getInteger("is_ad_watch_20_times"));
+                        returnJson.put("isAdWatch10Times", dataJson.getInteger("is_ad_watch_10_times"));
+                        returnJson.put("isSevenDayRoi", dataJson.getInteger("is_seven_day_roi"));
+                        returnJson.put("isAppointJumpClick", dataJson.getInteger("is_appoint_jump_click"));
+                        returnJson.put("isEventWeekPayTimes", dataJson.getInteger("is_event_week_pay_times"));
+                        returnJson.put("isAppointForm", dataJson.getInteger("is_appoint_form"));
                         returnJson.put("isActivate", dataJson.getInteger("is_activate"));
                         returnJson.put("isFormSubmit", dataJson.getInteger("is_form_submit"));
                         returnJson.put("isCreditGrant", dataJson.getInteger("is_credit_grant"));

+ 8 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java

@@ -71,12 +71,12 @@ public class KsNewGroupReportCtrl {
         String target = requestBody.getString("target");
         String order = requestBody.getString("order");
         try {
-            //JSONObject sumData = newGroupReportService.getSumNewGroupBy(accountIds, startDate, endDate);
+            JSONObject sumData = newGroupReportService.getSumNewGroupBy(accountIds, startDate, endDate);
+            List<JSONObject> chartData = newGroupReportService.getKsNewGroupGroupByStatDate(accountIds, startDate, endDate);
+            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
+           /* List<JSONObject> chartData = newMonitorService.getKuaiShouGroupMessageGroup(accountIds, startDate, endDate);
             JSONObject sumData = newMonitorService.getKuaiShouGroupSum(accountIds, startDate, endDate);
-            //List<JSONObject> chartData = newGroupReportService.getKsNewGroupGroupByStatDate(accountIds, startDate, endDate);
-            List<JSONObject> chartData = newMonitorService.getKuaiShouGroupMessageGroup(accountIds, startDate, endDate);
-            //List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
-            List<JSONObject> listData = newMonitorService.getKuaiShouGroupMessage(accountIds, startDate, endDate, target);
+            List<JSONObject> listData = newMonitorService.getKuaiShouGroupMessage(accountIds, startDate, endDate, target);*/
             result.put("sumData", sumData);
             result.put("chartData", chartData);
             result.put("listData", listData);
@@ -111,6 +111,7 @@ public class KsNewGroupReportCtrl {
         }
         return result;
     }
+
     @PostMapping("/report/excel")
     public void getExcelReport(@RequestBody JSONObject requestBody,
                                HttpServletRequest request,
@@ -160,7 +161,8 @@ public class KsNewGroupReportCtrl {
             log.error(e.getMessage());
         }
     }
-    /*
+
+    /**
      * 查询所有的快手运营
      */
     @GetMapping("/report/AllOperator")

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

@@ -63,12 +63,12 @@ public class KsNewPlanReportCtrl {
         String target = requestBody.getString("target");
         String order = requestBody.getString("order");
         try {
-            //JSONObject sumData = newPlanReportService.getSumNewPlanBy(accountIds, startDate, endDate);
-            JSONObject sumData = newMonitorService.getPlanSum(accountIds, startDate, endDate, "1");
-            //List<JSONObject> chartData = newPlanReportService.getKsNewPlanGroupByStatDate(accountIds, startDate, endDate);
+            JSONObject sumData = newPlanReportService.getSumNewPlanBy(accountIds, startDate, endDate);
+            List<JSONObject> chartData = newPlanReportService.getKsNewPlanGroupByStatDate(accountIds, startDate, endDate);
+            List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
+        /*    List<JSONObject> listData = newMonitorService.getPlanMessage(accountIds, startDate, endDate, target, "1");
             List<JSONObject> chartData = newMonitorService.getPlanMessageGroup(accountIds, startDate, endDate, "1");
-            //List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
-            List<JSONObject> listData = newMonitorService.getPlanMessage(accountIds, startDate, endDate, target, "1");
+            JSONObject sumData = newMonitorService.getPlanSum(accountIds, startDate, endDate, "1");*/
             result.put("sumData", sumData);
             result.put("chartData", chartData);
             result.put("listData", listData);
@@ -143,7 +143,7 @@ public class KsNewPlanReportCtrl {
             excelList.add(temp);
         });
         try {
-            String[] headers = {"账户名称","账户ID","账户所属人","新上计划数","有效计划数","最近上新时间"};
+            String[] headers = {"账户名称", "账户ID", "账户所属人", "新上计划数", "有效计划数", "最近上新时间"};
             OutputStream os = response.getOutputStream();
             ExportExcelUtils eeu = new ExportExcelUtils();
             XSSFWorkbook workbook = new XSSFWorkbook();
@@ -156,6 +156,7 @@ public class KsNewPlanReportCtrl {
             log.error(e.getMessage());
         }
     }
+
     /**
      * 查询所有的快手运营
      */

+ 36 - 23
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java

@@ -1,3 +1,4 @@
+
 package cn.com.ctop.kuaishou.modules.report.controller;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouGroupExplore;
@@ -11,11 +12,19 @@ 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.*;
+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.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 
+
 /**
  * 广告组的加速探索报表
  *
@@ -23,14 +32,16 @@ import java.util.Arrays;
  * @version V1.0
  * @date 2021-02-02
  */
+
 @Slf4j
 @Api(tags = "广告组的加速探索报表")
 @RestController
-@RequestMapping("/explore")
+@RequestMapping("/explores")
 public class KuaishouGroupExploreController {
     @Autowired
     private IKuaishouGroupExploreService kuaishouGroupExploreService;
 
+
     /**
      * 分页列表查询
      *
@@ -40,6 +51,7 @@ public class KuaishouGroupExploreController {
      * @param req
      * @return
      */
+
     @GetMapping(value = "/list")
     public Result<IPage<KuaishouGroupExplore>> queryPageList(KuaishouGroupExplore kuaishouGroupExplore,
                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -54,76 +66,71 @@ public class KuaishouGroupExploreController {
         return result;
     }
 
+
     /**
      * 查询加速探索信息接口
      *
      * @param data
      * @return
      */
+
     @PostMapping(value = "/unitExploreInfoGet")
     public Result<Object> unitExploreInfoGet(@RequestBody JSONObject data) {
         try {
-            return kuaishouGroupExploreService.unitExploreInfoGet(data);
+            return kuaishouGroupExploreService.unitExploreInfoGet(data.getLong("accountId"), data.getLong("unitId"));
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             return Result.error("操作失败");
         }
     }
 
-    /**
-     * 广告组的加速探索预算设置接口
-     *
-     * @param data
-     * @return
-     */
+
     @PostMapping(value = "/unitExploreBudgetUpdate")
     public Result<Object> unitExploreBudgetUpdate(@RequestBody JSONObject data) {
         try {
-            return kuaishouGroupExploreService.unitExploreBudgetUpdate(data);
+            return kuaishouGroupExploreService.unitExploreBudgetUpdate(data.getLong("accountId"), data.getLong("unitId"), data.getLong("exploreBudget"));
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             return Result.error("操作失败");
         }
     }
 
-    /**
-     * 暂停广告组的加速探索预算接口
-     *
-     * @param data
-     * @return
-     */
-    @PostMapping(value = "/unitExploreStatusPause")
-    public Result<Object> unitExploreStatusPause(@RequestBody JSONObject data) {
+    @PostMapping(value = "/querySpeedExploreReport")
+    public Result<Object> querySpeedExploreReport(@RequestBody JSONObject data) {
         try {
-            return kuaishouGroupExploreService.unitExploreStatusPause(data);
+            return kuaishouGroupExploreService.querySpeedExploreReport(data.getLong("accountId"), data.getLong("unitId"), data.getInteger("exploreBudget"), data.getLong("max_explore_budget"));
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             return Result.error("操作失败");
         }
     }
 
+
     /**
-     * 查询广告组的加速探索报表接口
+     * 暂停广告组的加速探索预算接口
      *
      * @param data
      * @return
      */
-    @PostMapping(value = "/querySpeedExploreReport")
-    public Result<Object> querySpeedExploreReport(@RequestBody JSONObject data) {
+
+    @PostMapping(value = "/unitExploreStatusPause")
+    public Result<Object> unitExploreStatusPause(@RequestBody JSONObject data) {
         try {
-            return kuaishouGroupExploreService.querySpeedExploreReport(data);
+            return kuaishouGroupExploreService.unitExploreStatusPause(data);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             return Result.error("操作失败");
         }
     }
 
+
     /**
      * 辅助探索
      *
      * @param data
      * @return
      */
+
     @PostMapping(value = "/adUnitExploreSupport")
     public Result<Object> adUnitExploreSupport(@RequestBody JSONObject data) {
         try {
@@ -141,6 +148,7 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
+
     @PostMapping(value = "/add")
     public Result<KuaishouGroupExplore> add(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -160,6 +168,7 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
+
     @PutMapping(value = "/edit")
     public Result<KuaishouGroupExplore> edit(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<KuaishouGroupExplore>();
@@ -176,12 +185,14 @@ public class KuaishouGroupExploreController {
         return result;
     }
 
+
     /**
      * 通过id删除
      *
      * @param id
      * @return
      */
+
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
         try {
@@ -199,6 +210,7 @@ public class KuaishouGroupExploreController {
      * @param ids
      * @return
      */
+
     @DeleteMapping(value = "/deleteBatch")
     public Result<KuaishouGroupExplore> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -217,6 +229,7 @@ public class KuaishouGroupExploreController {
      * @param id
      * @return
      */
+
     @GetMapping(value = "/queryById")
     public Result<KuaishouGroupExplore> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<KuaishouGroupExplore> result = new Result<>();

+ 246 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyExploreController.java

@@ -0,0 +1,246 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyExplore;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyExploreService;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+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.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 广告组加速探索报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-08-18
+ */
+@Slf4j
+@Api(tags = "广告组加速探索报表")
+@RestController
+@RequestMapping("/kuaishouReportDailyExplore")
+public class KuaishouReportDailyExploreController {
+    @Autowired
+    private IKuaishouReportDailyExploreService kuaishouReportDailyExploreService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaishouReportDailyExplore
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "广告组加速探索报表-分页列表查询", notes = "广告组加速探索报表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaishouReportDailyExplore>> queryPageList(KuaishouReportDailyExplore kuaishouReportDailyExplore,
+                                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                   HttpServletRequest req) {
+        Result<IPage<KuaishouReportDailyExplore>> result = new Result<>();
+        QueryWrapper<KuaishouReportDailyExplore> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouReportDailyExplore, req.getParameterMap());
+        Page<KuaishouReportDailyExplore> page = new Page<KuaishouReportDailyExplore>(pageNo, pageSize);
+        IPage<KuaishouReportDailyExplore> pageList = kuaishouReportDailyExploreService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaishouReportDailyExplore
+     * @return
+     */
+    @ApiOperation(value = "广告组加速探索报表-添加", notes = "广告组加速探索报表-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaishouReportDailyExplore> add(@RequestBody KuaishouReportDailyExplore kuaishouReportDailyExplore) {
+        Result<KuaishouReportDailyExplore> result = new Result<>();
+        try {
+            kuaishouReportDailyExploreService.save(kuaishouReportDailyExplore);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaishouReportDailyExplore
+     * @return
+     */
+    @ApiOperation(value = "广告组加速探索报表-编辑", notes = "广告组加速探索报表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaishouReportDailyExplore> edit(@RequestBody KuaishouReportDailyExplore kuaishouReportDailyExplore) {
+        Result<KuaishouReportDailyExplore> result = new Result<KuaishouReportDailyExplore>();
+        KuaishouReportDailyExplore kuaishouReportDailyExploreEntity = kuaishouReportDailyExploreService.getById(kuaishouReportDailyExplore.getId());
+        if (kuaishouReportDailyExploreEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaishouReportDailyExploreService.updateById(kuaishouReportDailyExplore);
+            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 {
+            kuaishouReportDailyExploreService.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<KuaishouReportDailyExplore> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<KuaishouReportDailyExplore> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaishouReportDailyExploreService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "广告组加速探索报表-通过id查询", notes = "广告组加速探索报表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaishouReportDailyExplore> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaishouReportDailyExplore> result = new Result<>();
+        KuaishouReportDailyExplore kuaishouReportDailyExplore = kuaishouReportDailyExploreService.getById(id);
+        if (kuaishouReportDailyExplore == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaishouReportDailyExplore);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaishouReportDailyExplore> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaishouReportDailyExplore kuaishouReportDailyExplore = JSON.parseObject(deString, KuaishouReportDailyExplore.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouReportDailyExplore, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaishouReportDailyExplore> pageList = kuaishouReportDailyExploreService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "广告组加速探索报表列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaishouReportDailyExplore.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("广告组加速探索报表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaishouReportDailyExplore> listKuaishouReportDailyExplores = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouReportDailyExplore.class, params);
+                kuaishouReportDailyExploreService.saveBatch(listKuaishouReportDailyExplores);
+                return Result.ok("文件导入成功!数据行数:" + listKuaishouReportDailyExplores.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 141 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyExplore.java

@@ -0,0 +1,141 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 广告组加速探索报表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-08-18
+ */
+@Data
+@TableName("ctop_kuaishou_report_daily_explore")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_daily_explore对象", description = "广告组加速探索报表")
+public class KuaishouReportDailyExplore {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long campaignId;
+    /**
+     * 组ID
+     */
+    @Excel(name = "组ID", width = 15)
+    @ApiModelProperty(value = "组ID")
+    private Long unitId;
+    /**
+     * 组名称
+     */
+    @Excel(name = "组名称", width = 15)
+    @ApiModelProperty(value = "组名称")
+    private String unitName;
+    /**
+     * 探索预算
+     */
+    @Excel(name = "探索预算", width = 15)
+    @ApiModelProperty(value = "探索预算")
+    private java.math.BigDecimal exploreBudget;
+    /**
+     * 优化目标
+     */
+    @Excel(name = "优化目标", width = 15)
+    @ApiModelProperty(value = "优化目标")
+    private Integer ocpxActionType;
+    /**
+     * 总消耗
+     */
+    @Excel(name = "总消耗", width = 15)
+    @ApiModelProperty(value = "总消耗")
+    private java.math.BigDecimal totalCharge;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long impression;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long click;
+    /**
+     * 转化数
+     */
+    @Excel(name = "转化数", width = 15)
+    @ApiModelProperty(value = "转化数")
+    private Long unifiedConversion;
+    /**
+     * 转化成本
+     */
+    @Excel(name = "转化成本", width = 15)
+    @ApiModelProperty(value = "转化成本")
+    private java.math.BigDecimal unitfiedConversionCost;
+    /**
+     * 记录日期
+     */
+    @Excel(name = "记录日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "记录日期")
+    private Date statDate;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+    /**
+     * 加速探索状态 0:默认;1:加速探索2:加速探索手动暂停;3:探索金额完成;4:时间到达截止时间,默认开启后只探索 6 小时
+     */
+    private Integer exploreStatus;
+    /**
+     * 可设置的最大加速探索预算,单位:里
+     */
+    private Long maxExploreBudget;
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyExplore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 广告组加速探索报表
+ *
+ * @author jeecg-boot
+ * 2021-08-18
+ * @version V1.0
+ */
+public interface KuaishouReportDailyExploreMapper extends BaseMapper<KuaishouReportDailyExplore> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyExploreMapper.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.report.mapper.KuaishouReportDailyExploreMapper">
+
+</mapper>

+ 5 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouGroupExploreService.java

@@ -11,20 +11,20 @@ import java.math.BigDecimal;
 /**
  * @Description: 广告组的加速探索报表
  * @Author: jeecg-boot
- * @Date:   2021-02-02
+ * @Date: 2021-02-02
  * @Version: V1.0
  */
 public interface IKuaishouGroupExploreService extends IService<KuaishouGroupExplore> {
 
-    Result<Object> unitExploreInfoGet(JSONObject data);
+    Result<Object> unitExploreInfoGet(Long accountId, Long unitId);
 
-    Result<Object> unitExploreBudgetUpdate(JSONObject data);
+    Result<Object> unitExploreBudgetUpdate(Long accountId, Long unitId, Long exploreBudget);
 
     Result<Object> unitExploreStatusPause(JSONObject data);
 
-    Result<Object> querySpeedExploreReport(JSONObject data);
+    Result<Object> querySpeedExploreReport(Long accountId, Long unitId, Integer exploreStatus, Long maxExploreBudget);
 
-    void unitOpenSpeedExplore(Long accountId, Long unitId, BigDecimal groupAccount,Long accountExploreId);
+    void unitOpenSpeedExplore(Long accountId, Long unitId, BigDecimal groupAccount, Long accountExploreId);
 
     void getReportByAccount(CtopOauthToken token);
 

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyExplore;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 广告组加速探索报表
+ * @author jeecg-boot
+ * 2021-08-18
+ * @version V1.0
+ */
+public interface IKuaishouReportDailyExploreService extends IService<KuaishouReportDailyExplore> {
+
+}

+ 58 - 41
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouGroupExploreServiceImpl.java

@@ -2,12 +2,21 @@ package cn.com.ctop.kuaishou.modules.report.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.utils.BigDecimalUtil;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouGroupSpeedExploreLog;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouGroupSpeedExploreLogService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouGroupExplore;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyExplore;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouGroupExploreMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyExploreService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -18,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,25 +45,23 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouGroupSpeedExploreLogService groupSpeedExploreLogService;
+    @Autowired
+    private IKuaishouReportDailyExploreService dailyExploreService;
+
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
 
     /**
-     * 查询加速探索信息
+     * 查询加速探索状态、预算
      *
      * @param
+     * @return
      * @throws
      * @author ZHAOXA
      */
     @Override
-    public Result<Object> unitExploreInfoGet(JSONObject data) {
+    public Result<Object> unitExploreInfoGet(Long accountId, Long unitId) {
         try {
-            Long accountId = data.getLong("accountId");
-            if (Check.isNull(accountId)) {
-                return Result.error("请选择广告主");
-            }
-            Long unitId = data.getLong("unitId");
-            if (Check.isNull(unitId)) {
-                return Result.error("请选择广告组");
-            }
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.UNIT_EXPLORE_INFO_GET;
             Map<String, String> header = new HashMap<>();
@@ -80,27 +88,16 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
     }
 
     /**
-     * 广告组加速探索预算设置
+     * 开启广告组加速探索
      *
      * @param
      * @throws
      * @author ZHAOXA
      */
     @Override
-    public Result<Object> unitExploreBudgetUpdate(JSONObject data) {
+    public Result<Object> unitExploreBudgetUpdate(Long accountId, Long unitId, Long exploreBudget) {
+        String msg = null;
         try {
-            Long accountId = data.getLong("accountId");
-            if (Check.isNull(accountId)) {
-                return Result.error("请选择广告主");
-            }
-            Long unitId = data.getLong("unitId");
-            if (Check.isNull(unitId)) {
-                return Result.error("请选择广告组");
-            }
-            Long exploreBudget = data.getLong("exploreBudget");
-            if (Check.isNull(exploreBudget)) {
-                return Result.error("请填写加速探索预算");
-            }
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.UNIT_EXPLORE_BUDGET_UPDATE;
             Map<String, String> header = new HashMap<>();
@@ -115,6 +112,21 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
+                    Result<Object> result1 = this.unitExploreInfoGet(accountId, unitId);
+                    if (result1.getCode() == 200) {
+                        JSONObject resultData = (JSONObject) result1.getResult();
+                        Integer exploreStatus = resultData.getInteger("explore_status");
+                        Long maxExploreBudget = resultData.getLong("max_explore_budget");
+                        KuaiShouGroup kuaiShouGroup = new KuaiShouGroup();
+
+                        KuaishouReportDailyExplore kuaishouGroupExplore = new KuaishouReportDailyExplore();
+                        kuaishouGroupExplore.setAccountId(accountId);
+                        kuaishouGroupExplore.setUnitId(unitId);
+                        kuaishouGroupExplore.setStatDate(new Date());
+                        kuaishouGroupExplore.setMaxExploreBudget(maxExploreBudget);
+                        kuaishouGroupExplore.setExploreStatus(exploreStatus);
+                        dailyExploreService.save(kuaishouGroupExplore);
+                    }
                     return Result.ok(resultJson.getJSONObject("data"));
                 } else {
                     log.info("广告组的加速探索预算设置失败,accountId:{},返回信息:{}", accountId, resultJson);
@@ -122,7 +134,7 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
                 }
             }
         } catch (Exception e) {
-            log.error("广告组的加速探索预算设置失败", e);
+            log.error("广告组({})启动加速探索失败", unitId, e);
         }
         return Result.error("广告组的加速探索预算设置失败");
     }
@@ -178,16 +190,8 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
      * @author ZHAOXA
      */
     @Override
-    public Result<Object> querySpeedExploreReport(JSONObject data) {
+    public Result<Object> querySpeedExploreReport(Long accountId, Long unitId, Integer exploreStatus, Long maxExploreBudget) {
         try {
-            Long accountId = data.getLong("accountId");
-            if (Check.isNull(accountId)) {
-                return Result.error("请选择广告主");
-            }
-            Long unitId = data.getLong("unitId");
-            if (Check.isNull(unitId)) {
-                return Result.error("请选择广告组");
-            }
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.QUERY_SPEED_EXPLORE_REPORT;
             Map<String, String> header = new HashMap<>();
@@ -202,19 +206,32 @@ public class KuaishouGroupExploreServiceImpl extends ServiceImpl<KuaishouGroupEx
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
                     JSONObject exploreJson = resultJson.getJSONObject("data");
-                    KuaishouGroupExplore kuaishouGroupExplore = JSONObject.toJavaObject(exploreJson, KuaishouGroupExplore.class);
+                    KuaishouReportDailyExplore kuaishouGroupExplore = JSONObject.toJavaObject(exploreJson, KuaishouReportDailyExplore.class);
                     if (Check.isNull(kuaishouGroupExplore)) {
                         return Result.error("查询失败,结果为空");
                     }
-                    QueryWrapper<KuaishouGroupExplore> queryWrapper = new QueryWrapper<>();
-                    queryWrapper.eq("unit_id", kuaishouGroupExplore.getUnitId());
-                    KuaishouGroupExplore one = this.getOne(queryWrapper);
+                    QueryWrapper<KuaishouReportDailyExplore> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("unit_id", unitId);
+                    queryWrapper.eq("account_id", accountId);
+                    KuaishouReportDailyExplore one = dailyExploreService.getOne(queryWrapper);
                     if (!Check.isNull(one)) {
                         kuaishouGroupExplore.setId(one.getId());
                     }
+                    KuaiShouGroup kuaiShouGroup = kuaiShouGroupService.selectGroupByUnitId(accountId, unitId);
+                    if(!Check.isNull(kuaiShouGroup)){
+                        kuaishouGroupExplore.setUnitName(kuaiShouGroup.getUnitName());
+                        kuaishouGroupExplore.setCampaignId(kuaiShouGroup.getCampaignId());
+                    }
                     kuaishouGroupExplore.setAccountId(accountId);
-                    this.saveOrUpdate(kuaishouGroupExplore);
-                    return Result.ok("添加成功");
+                    kuaishouGroupExplore.setExploreStatus(exploreStatus);
+                    kuaishouGroupExplore.setMaxExploreBudget(maxExploreBudget);
+                    kuaishouGroupExplore.setStatDate(new Date());
+                    kuaishouGroupExplore.setExploreBudget(BigDecimalUtil.divideBigDecimal(kuaishouGroupExplore.getExploreBudget(), new BigDecimal(1000)));
+                    kuaishouGroupExplore.setTotalCharge(BigDecimalUtil.divideBigDecimal(kuaishouGroupExplore.getTotalCharge(), new BigDecimal(1000)));
+                    boolean b = dailyExploreService.saveOrUpdate(kuaishouGroupExplore);
+                    if (b) {
+                        return Result.ok("添加成功");
+                    }
                 } else {
                     log.info("查询广告组的加速探索报表失败,accountId:{},返回信息:{}", accountId, resultJson);
                     return Result.error("查询广告组的加速探索报表失败," + resultJson.getString("message"));

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyExplore;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyExploreMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyExploreService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 广告组加速探索报表
+ *
+ * @author jeecg-boot
+ * 2021-08-18
+ * @version V1.0
+ */
+@Service
+public class KuaishouReportDailyExploreServiceImpl extends ServiceImpl<KuaishouReportDailyExploreMapper, KuaishouReportDailyExplore> implements IKuaishouReportDailyExploreService {
+
+}

+ 4 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/RuleKuaiShouPlanServiceImpl.java

@@ -186,10 +186,10 @@ public class RuleKuaiShouPlanServiceImpl extends ServiceImpl<RuleDatePlanKuaisho
                     unit.setUnitId(unitDetail.getLong("unit_id"));
                     unit.setUnitName(unitDetail.getString("unit_name"));
                     unit.setCharge(unitDetail.getBigDecimal("charge"));
-                    unit.setDeepConversionBid(new BigDecimal(group.getDeepConversionBid()).divide(new BigDecimal("1000")));
-                    unit.setDeepConversionType(group.getDeepConversionType());
-                    unit.setOcpxActionType(group.getOcpxActionType());
-                    unit.setCpaBid(new BigDecimal(group.getCpaBid()).divide(new BigDecimal("1000"), 2, RoundingMode.HALF_UP));
+//                    unit.setDeepConversionBid(new BigDecimal(group.getDeepConversionBid()).divide(new BigDecimal("1000")));
+//                    unit.setDeepConversionType(group.getDeepConversionType());
+//                    unit.setOcpxActionType(group.getOcpxActionType());
+//                    unit.setCpaBid(new BigDecimal(group.getCpaBid()).divide(new BigDecimal("1000"), 2, RoundingMode.HALF_UP));
                     //未知优化目标数据存空
                     if (group.getOcpxActionType() != 0) {
                         unit.setConvertNum(handleConvertNum(group.getOcpxActionType(), unitDetail));

+ 6 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceNewPlanReportCtrl.java

@@ -63,15 +63,13 @@ public class BytedanceNewPlanReportCtrl {
         String target = requestBody.getString("target");
         String order = requestBody.getString("order");
         try {
-            //JSONObject sumData = newPlanReportService.getSumNewPlanBy(accountIds, startDate, endDate);
-           // List<JSONObject> chartData = newPlanReportService.getBytedanceNewPlanGroupByStatDate(accountIds, startDate, endDate);
-           // List<JSONObject> listData = newPlanReportService.getBytedanceNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
-
-            JSONObject sumData = newMonitorService.getPlanSum(accountIds, startDate, endDate, "0");
+            JSONObject sumData = newPlanReportService.getSumNewPlanBy(accountIds, startDate, endDate);
+            List<JSONObject> chartData = newPlanReportService.getBytedanceNewPlanGroupByStatDate(accountIds, startDate, endDate);
+            List<JSONObject> listData = newPlanReportService.getBytedanceNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
 
+          /*  JSONObject sumData = newMonitorService.getPlanSum(accountIds, startDate, endDate, "0");
             List<JSONObject> chartData = newMonitorService.getPlanMessageGroup(accountIds, startDate, endDate, "0");
-
-            List<JSONObject> listData = newMonitorService.getPlanMessage(accountIds, startDate, endDate, target, "0");
+            List<JSONObject> listData = newMonitorService.getPlanMessage(accountIds, startDate, endDate, target, "0");*/
             result.put("sumData", sumData);
             result.put("chartData", chartData);
             result.put("listData", listData);
@@ -120,7 +118,7 @@ public class BytedanceNewPlanReportCtrl {
             excelList.add(temp);
         });
         try {
-            String[] headers = {"账户名称","账户ID","账户所属人","新上计划数","有效计划数","最近上新时间"};
+            String[] headers = {"账户名称", "账户ID", "账户所属人", "新上计划数", "有效计划数", "最近上新时间"};
             OutputStream os = response.getOutputStream();
             ExportExcelUtils eeu = new ExportExcelUtils();
             XSSFWorkbook workbook = new XSSFWorkbook();

+ 0 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java

@@ -33,17 +33,6 @@ public class BytedanceVideoReportServiceImpl implements IBytedanceVideoReportSer
 
     @Override
     public PageInfo<JSONObject> getVideoReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan,String leader, int pageSize, int pageNo) {
-        System.out.println("#################################################");
-        System.out.println("startDate:"+startDate);
-        System.out.println("endDate:"+endDate);
-        System.out.println("accountIds:"+accountIds);
-        System.out.println("filed:"+filed);
-        System.out.println("target:"+target);
-        System.out.println("order:"+order);
-        System.out.println("accountIds:"+accountIds);
-        System.out.println("accountIds:"+accountIds);
-        System.out.println("accountIds:"+accountIds);
-        System.out.println("#################################################");
         PageHelper.startPage(pageNo,pageSize);
         List<JSONObject> jsonObjectList=bytedanceVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan,leader);
         return new PageInfo<>(jsonObjectList);

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -512,10 +512,10 @@ public class ProjectMemberController {
      * @return
      */
     @GetMapping("/getProjectAccountByUserId")
-    public Result<List<Map<String, Object>>> getProjectAccountBy(String mediaType) {
+    public Result<List<Map<String, Object>>> getProjectAccountBy(String mediaType,String userId) {
         Result<List<Map<String, Object>>> resultBody = new Result<>();
         try {
-            String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
+
             List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId, mediaType);
             resultBody.setSuccess(true);
             resultBody.setResult(result);

+ 3 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java

@@ -35,6 +35,7 @@ import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -55,13 +56,13 @@ import java.util.Map;
 public class UserAllocationController {
     @Autowired
     private IUserAllocationService userAllocationService;
-    @Autowired
+    @Resource
     private UserAllocationMapper userAllocationMapper;
     @Autowired
     private IProjectService projectService;
     @Autowired
     private ISysRoleExtService sysRoleService;
-    @Autowired
+    @Resource
     private ProjectMemberMapper memberMapper;
     @Autowired
     private IProjectMemberService projectMemberService;
@@ -71,8 +72,6 @@ public class UserAllocationController {
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
     @Autowired
-    private IKuaiShouAdvertiserBaseInfoService kuaiShouAdvertiserBaseInfoService;
-    @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
 
 
@@ -309,9 +308,7 @@ public class UserAllocationController {
             result.setSuccess(false);
             result.success("查询失败");
         }
-
         return result;
-
     }
 
 
@@ -529,9 +526,6 @@ public class UserAllocationController {
      * @param userAllocation
      * @return
      */
-    @Autowired
-    private IRuleAccountTemplateService ruleAccountTemplateService;
-
     @ApiOperation(value = "用户分配-编辑", notes = "用户分配-编辑")
     @PutMapping(value = "/edit")
     public Result<UserAllocation> edit(@RequestBody UserAllocation userAllocation) {

+ 0 - 28
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -35,7 +35,6 @@ import java.util.Map;
  */
 @Service
 public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, ProjectMember> implements IProjectMemberService {
-
     @Autowired
     private ProjectMemberMapper memberMapper;
     @Autowired
@@ -124,10 +123,6 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
 
         return projectMemberList;
     }
-
-    @Autowired
-    private IUserAllocationService userAllocationService;
-
     @Override
     public List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType) {
         List<Map<String, Object>> result = new ArrayList<>();
@@ -139,35 +134,12 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
             mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
         }
-
         //查询登录账号下的项目
         List<ProjectMember> projectMemberList = this.queryProjectMemberBy(userId, mediaList);
         if (projectMemberList.isEmpty()) {
             return result;
         }
-
-        // Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectMemberList(projectMemberList);
         Map<Long, List<JSONObject>> accountMap = this.getAccountListByProjectMemberList(projectMemberList);
-
-
-      /*  temp.put("project", projectMember);
-        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("project_id", projectMember.getProjectId());
-        queryWrapper.isNotNull("account_id");
-        List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
-        if (userAllocations.isEmpty()) {
-            temp = null;
-        } else {
-            temp.put("account", userAllocations);*/
-
-/*
-        projectMemberList.forEach(ProjectMember -> {
-            Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
-            if (temp != null) {
-                result.add(temp);
-            }
-        });*/
-
         for (ProjectMember member : projectMemberList) {
             Map<String, Object> temp = new HashMap<>();
             temp.put("project", member);

+ 10 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java

@@ -8,12 +8,10 @@ import cn.com.ctop.common.module.utils.StatusCode;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -31,6 +29,9 @@ public class FileController {
     @Autowired
     private IMaterialImageInfoService materialImageInfoService;
 
+
+
+
     @RequestMapping("file/check")
     public Map<String, Object> chenckFile(String code, Long projectId) {
         return materialInfoService.checkMaterialInfo(code, projectId);
@@ -51,21 +52,21 @@ public class FileController {
 
     @PostMapping("/insertV3")
     public Map<String, Object> insertV3(@RequestBody JSONObject data) {
-        Map<String,Object>result = new HashMap<>();
+        Map<String, Object> result = new HashMap<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         Long projectId = data.getLong("projectId");
         JSONArray array = data.getJSONArray("videoArray");
         //校验重复code逻辑
         JSONArray checkArray = materialInfoService.checkArrayCode(array);
-        if(null!=checkArray&&!checkArray.isEmpty()){
-            for (int i=0;i<array.size();i++){
+        if (null != checkArray && !checkArray.isEmpty()) {
+            for (int i = 0; i < array.size(); i++) {
                 JSONObject json = array.getJSONObject(i);
                 json.put("userId", user.getId());
-                json.put("projectId",projectId);
+                json.put("projectId", projectId);
                 materialInfoService.correlationUploadV2(json);
             }
         }
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 

+ 37 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/MaterialUsrController.java

@@ -0,0 +1,37 @@
+package org.jeecg.modules.fileupload.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.fileupload.service.IMaterialUsrService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RequestMapping("materialUse")
+@RestController
+public class MaterialUsrController {
+    @Autowired
+    private IMaterialUsrService materialUsrService;
+
+    @GetMapping("/getMaterialUseDetail")
+    public Result<JSONObject> getMaterialUseDetail(String code) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            if (Check.isNull(code)) {
+                throw new Exception("素材md5不能为空");
+            }
+            JSONObject json = materialUsrService.getMaterialUseInfo(code);
+            result.setSuccess(true);
+            result.setResult(json);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+
+    }
+
+
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/mapper/MaterialUsrServiceMapper.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.fileupload.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MaterialUsrServiceMapper {
+
+    List<JSONObject> getAccountInfo(@Param("code") String code);
+
+    Integer getKuiShouRelationCount(@Param("accountId") Long accountId, @Param("photoId") String photoId);
+
+    JSONObject getKuiShouRefuseRelationCount(@Param("accountId") Long accountId, @Param("photoId") String photoId);
+
+    List<JSONObject> getByteDanceAccountInfo(String code);
+
+    Integer getByteDanceRelationCount(@Param("accountId") String accountId, @Param("vid") String vid);
+}

+ 65 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/mapper/xml/MaterialUseMapper.xml

@@ -0,0 +1,65 @@
+<?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="org.jeecg.modules.fileupload.mapper.MaterialUsrServiceMapper">
+
+
+    <select id="getAccountInfo" resultType="com.alibaba.fastjson.JSONObject">
+    SELECT
+	t1.account_id as 'accountId',
+	t1.photo_id as 'photoId',
+	t2.user_name as 'userName',
+	t2.account_status as 'accountStatus'
+    FROM
+	(
+		SELECT
+			account_id,
+			photo_id
+		FROM
+			ctop_kuaishou_video_get
+		WHERE
+			signature = #{code}
+	) t1
+    LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+    order by t2.account_status;
+    </select>
+
+    <select id="getKuiShouRelationCount" resultType="java.lang.Integer">
+		SELECT count(1)  from  ctop_kuaishou_creative WHERE account_id = #{accountId} AND photo_id =  #{photoId}
+	</select>
+    <select id="getKuiShouRefuseRelationCount" resultType="com.alibaba.fastjson.JSONObject">
+		SELECT count(1) as 'refuseCount',
+		GROUP_CONCAT(DISTINCT review_detail  SEPARATOR '@#')  as 'refuseDetail'
+		from  ctop_kuaishou_creative
+		WHERE account_id = #{accountId}
+		AND photo_id = #{photoId}
+		AND `status` = 42
+
+	</select>
+    <select id="getByteDanceAccountInfo" resultType="com.alibaba.fastjson.JSONObject">
+	SELECT
+	CONCAT(t1.account_id,'') as 'accountId',
+	t1.vid as 'vid',
+	CONCAT(t1.material_id,'')  as 'materialId',
+	t2.user_name as 'userName',
+	t2.account_status as 'accountStatus'
+    FROM
+	(
+		SELECT
+			account_id,
+			vid,
+			material_id
+		FROM
+			ctop_bytedance_video_info
+		WHERE
+			signature = #{code}
+	) t1
+    LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+      order by t2.account_status;
+
+	</select>
+    <select id="getByteDanceRelationCount" resultType="java.lang.Integer">
+		select  count(1)  from ctop_bytedance_creative where  account_id = #{accountId}
+		and video_id = #{vid}
+
+	</select>
+</mapper>

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/service/IMaterialUsrService.java

@@ -0,0 +1,7 @@
+package org.jeecg.modules.fileupload.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+public interface IMaterialUsrService {
+    JSONObject getMaterialUseInfo(String code);
+}

+ 69 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/service/impl/MaterialUsrServiceImpl.java

@@ -0,0 +1,69 @@
+package org.jeecg.modules.fileupload.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.fileupload.mapper.MaterialUsrServiceMapper;
+import org.jeecg.modules.fileupload.service.IMaterialUsrService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class MaterialUsrServiceImpl implements IMaterialUsrService {
+    @Autowired
+    private MaterialUsrServiceMapper materialUsrServiceMapper;
+
+
+    @Override
+    public JSONObject getMaterialUseInfo(String code) {
+        JSONObject returnJson = new JSONObject();
+        List<JSONObject> kuaishouInfo = this.getKuaiShouMaterialInfo(code);
+        returnJson.put("kuaishou", kuaishouInfo);
+        List<JSONObject> byteDanceInfo = this.getbyteDanceMaterialInfo(code);
+        returnJson.put("byteDance", byteDanceInfo);
+        return returnJson;
+
+
+    }
+
+
+    private List<JSONObject> getKuaiShouMaterialInfo(String code) {
+        List<JSONObject> accountInfos = materialUsrServiceMapper.getAccountInfo(code);
+        if (Check.isNull(accountInfos)) {
+            return null;
+        }
+        for (int i = 0; i < accountInfos.size(); i++) {
+            JSONObject accountJson = accountInfos.get(i);
+            Long accountId = accountJson.getLong("accountId");
+            String photoId = accountJson.getString("photoId");
+            Integer relationCount = materialUsrServiceMapper.getKuiShouRelationCount(accountId, photoId);
+            accountJson.put("relationCount", relationCount);
+            JSONObject refuseInfo = materialUsrServiceMapper.getKuiShouRefuseRelationCount(accountId, photoId);
+            accountJson.put("refuseInfo", refuseInfo);
+        }
+
+
+        return accountInfos;
+    }
+
+
+    private List<JSONObject> getbyteDanceMaterialInfo(String code) {
+        List<JSONObject> accountInfos = materialUsrServiceMapper.getByteDanceAccountInfo(code);
+        if (Check.isNull(accountInfos)) {
+            return null;
+        }
+        for (int i = 0; i < accountInfos.size(); i++) {
+            JSONObject accountJson = accountInfos.get(i);
+            String accountId = accountJson.getString("accountId");
+            String vid = accountJson.getString("vid");
+            Integer relationCount = materialUsrServiceMapper.getByteDanceRelationCount(accountId, vid);
+            accountJson.put("relationCount", relationCount);
+        }
+
+
+        return accountInfos;
+    }
+
+
+}

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -142,6 +142,8 @@ public class LoginController {
 				}
 				String departId = sysDepartService.selectIdByOrdCode(sysUser.getOrgCode());
 				sysUser.setDepartId(departId);
+				//根据 账号 查看该用户以及角色名称
+				sysUser = sysUserService.getUserByName(sysUser.getUsername());
 				result = sysUserService.checkUserIsEffective(sysUser);
 				if (!result.isSuccess()) {
 					return result;