Bladeren bron

修改定时任务

syh 5 jaren geleden
bovenliggende
commit
1d78ef0ba4
62 gewijzigde bestanden met toevoegingen van 1249 en 1881 verwijderingen
  1. 12 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/LoadFileUtil.java
  2. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java
  4. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportLoadJob.java
  5. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java
  6. 52 11
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  7. 1 1
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/entity/MaterialInfo.java
  8. 2 2
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/mapper/MaterialInfoMapper.java
  9. 1 1
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/mapper/xml/MaterialInfoMapper.xml
  10. 2 2
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/IMaterialInfoService.java
  11. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  12. 4 4
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialInfoServiceImpl.java
  13. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java
  14. 1 5
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumDeviceController.java
  15. 45 39
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskController.java
  16. 17 21
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskItemController.java
  17. 253 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskLogController.java
  18. 15 20
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumDevice.java
  19. 21 22
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTask.java
  20. 70 61
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskItem.java
  21. 81 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskLog.java
  22. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumDeviceMapper.java
  23. 2 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskItemMapper.java
  24. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskLogMapper.java
  25. 2 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskMapper.java
  26. 5 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/xml/AppiumTaskLogMapper.xml
  27. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumDeviceService.java
  28. 5 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskItemService.java
  29. 15 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskLogService.java
  30. 3 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskService.java
  31. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumDeviceServiceImpl.java
  32. 26 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskItemServiceImpl.java
  33. 20 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskLogServiceImpl.java
  34. 55 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskServiceImpl.java
  35. 0 173
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumDeviceList.vue
  36. 0 243
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskItemList.vue
  37. 0 173
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskList.vue
  38. 0 138
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal.vue
  39. 0 145
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal__Style#Drawer.vue
  40. 0 224
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal.vue
  41. 0 231
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal__Style#Drawer.vue
  42. 0 138
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal.vue
  43. 0 145
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal__Style#Drawer.vue
  44. 217 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/AppiumUtil.java
  45. 4 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/test/AppiumTest.java
  46. 3 2
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/controller/MaterialInfoController.java
  47. 2 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCampaign.java
  48. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
  49. 2 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java
  50. 9 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouVideoUpload.java
  51. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  52. 70 13
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  53. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyCreativeStatistic.java
  54. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyCreativeStatistic.java
  55. 37 0
      module-report/src/main/java/cn/com/ctop/bytedance/controller/MaterialReportController.java
  56. 4 5
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/AccountReportMapper.java
  57. 7 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/MaterialReportMapper.java
  58. 7 1
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/AccountReportMapper.xml
  59. 23 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml
  60. 7 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IMaterialReportService.java
  61. 80 21
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/AccountReportServiceImpl.java
  62. 17 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

+ 12 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/LoadFileUtil.java

@@ -1,5 +1,6 @@
 package org.jeecg.common.util;
 
+import org.apache.commons.codec.digest.DigestUtils;
 import org.jeecg.common.util.encryption.AesEncryptUtil;
 
 import java.io.*;
@@ -94,5 +95,16 @@ public class LoadFileUtil {
         return flag;
     }
 
+    /**
+     * 获取文件md5
+     *
+     * @param path
+     * @return
+     * @throws IOException
+     */
+    public static String getMD5(String path) throws IOException {
+        return DigestUtils.md5Hex(new FileInputStream(path));
+    }
+
 
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -119,7 +119,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/template/convert/list/url", "anon");
         //文件上传接口
 		filterChainDefinitionMap.put("/upload/**", "anon");
-
+        filterChainDefinitionMap.put("/appium/appiumTask/run", "anon");
 
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java

@@ -281,6 +281,18 @@ public class ByteDanceAdvertiserPostController {
         return result;
     }
 
+    @GetMapping("loadData")
+    public Map<String, Object> loadData() {
+        Map<String, Object> result = new HashMap<>();
+        try {
+            kuaishouInterfaceService.loadData();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
+        return result;
+    }
+
     @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportLoadJob.java

@@ -23,7 +23,6 @@ public class KuaishouDailyReportLoadJob implements Job {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
-
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         Date getDate = DateUtils.addDay(new Date(), -1);
@@ -33,6 +32,7 @@ public class KuaishouDailyReportLoadJob implements Job {
             log.info("定时获取头条数据异常:为获取到可用的token");
             return;
         }
+
         tokens.forEach(token -> {
             //1:获取全量广告计划数据
             kuaishouInterfaceService.getCampaignList(token);

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

@@ -1,6 +1,6 @@
 package org.jeecg.modules.fileupload.controller;
 
-import cn.com.ctop.manage.modules.material.service.IMaterialInfoService;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,6 +12,7 @@ import java.util.Map;
 
 /**
  * 素材库工具接口
+ *
  * @author jeecg-boot
  */
 @RestController

+ 52 - 11
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -19,6 +19,9 @@ import org.springframework.test.context.junit4.SpringRunner;
 import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
@@ -68,6 +71,40 @@ public class SampleTest {
         createInternalService.createInternal(json);
     }
 
+    static ExecutorService executorService = null;
+    static CountDownLatch countDownLatch = null; //线程计数器          如果不用执行完后统一走流程,可以不要这个
+
+    @Test
+    public void loadData() throws InterruptedException {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+//        Date getDate = new Date();
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+            return;
+        }
+        int times = tokens.size();
+        executorService = Executors.newFixedThreadPool(10);
+        countDownLatch = new CountDownLatch(times);
+        for (CtopOauthToken token : tokens) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    if (token.getAccountId() == 2731757) {
+                        System.out.println("" + token.getAccountId() + "开始");
+                        kuaishouInterfaceService.getAdvertiserCreativeReportHourly(token, getDate, getDate);
+                        System.out.println("" + token.getAccountId() + "结束");
+                    }
+                    countDownLatch.countDown();
+                }
+            });
+        }
+
+        countDownLatch.await();
+        System.out.println("Game Over");
+        //关掉线程池
+        executorService.shutdown();
+    }
     @Test
     public void loadAllMetiaralInfo() {
         Date getDate = DateUtils.addDay(new Date(), -1);
@@ -76,27 +113,31 @@ public class SampleTest {
             log.info("定时获取头条数据异常:为获取到可用的token");
             return;
         }
+//        tokens.forEach(token -> {
+//            kuaishouInterfaceService.getCampaignList(token);
+//        });
+//        tokens.forEach(token -> {
+//                kuaishouInterfaceService.getGroupList(token);
+//        });
         tokens.forEach(token -> {
-            //1:获取全量广告计划数据
-            kuaishouInterfaceService.getCampaignList(token);
-            //1:获取全量广告组数据
-            kuaishouInterfaceService.getGroupList(token);
-            //1:获取全量创意数据
             kuaishouInterfaceService.getCreativeList(token);
-            //2:获取全量视频素材数据
+        });
+        tokens.forEach(token -> {
             kuaishouInterfaceService.getVideoList(token);
         });
 
-        log.info("快手物料数据同步完成");
 
+        log.info("快手物料数据同步完成");
         tokens.forEach(token -> {
-            //1: 获取广告主信息数据
             kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
-            //2:获取广告计划信息数据
+        });
+        tokens.forEach(token -> {
             kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
-            //3:获取广告组信息数据
+        });
+        tokens.forEach(token -> {
             kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
-            //4: 获取广告创意信息数据
+        });
+        tokens.forEach(token -> {
             kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate);
         });
     }

+ 1 - 1
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/entity/MaterialInfo.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.manage.modules.material.entity;
+package cn.com.ctop.common.module.entity;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;

+ 2 - 2
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/mapper/MaterialInfoMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.manage.modules.material.mapper;
+package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.manage.modules.material.entity.MaterialInfo;
+import cn.com.ctop.common.module.entity.MaterialInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 1 - 1
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/mapper/xml/MaterialInfoMapper.xml

@@ -1,5 +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.manage.modules.material.mapper.MaterialInfoMapper">
+<mapper namespace="cn.com.ctop.common.module.mapper.MaterialInfoMapper">
 
 </mapper>

+ 2 - 2
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/IMaterialInfoService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.manage.modules.material.service;
+package cn.com.ctop.common.module.service;
 
-import cn.com.ctop.manage.modules.material.entity.MaterialInfo;
+import cn.com.ctop.common.module.entity.MaterialInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.Map;

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -150,7 +150,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     @Override
     public List<CtopOauthToken> getTokenListByType(String platformType) {
         QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("media_id", platformType);
+        queryWrapper.eq("media_id", platformType).orderByDesc("account_id");
         return this.list(queryWrapper);
     }
 }

+ 4 - 4
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialInfoServiceImpl.java

@@ -1,10 +1,10 @@
-package cn.com.ctop.manage.modules.material.service.impl;
+package cn.com.ctop.common.module.service.impl;
 
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
-import cn.com.ctop.manage.modules.material.entity.MaterialInfo;
-import cn.com.ctop.manage.modules.material.mapper.MaterialInfoMapper;
-import cn.com.ctop.manage.modules.material.service.IMaterialInfoService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -58,7 +58,7 @@ public class KuaishouInterfaceConstant {
     /**
      * 视频文件上传
      */
-    public static final String VIDEO_UPLOAD = "/rest/openapi/v1/file/ad/video/upload";
+    public static final String VIDEO_UPLOAD = "/rest/openapi/v2/file/ad/video/upload";
     /**
      * 视频文件获取
      */

+ 1 - 5
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumDeviceController.java

@@ -8,16 +8,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
-
 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;
@@ -40,10 +37,9 @@ import io.swagger.annotations.ApiOperation;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
 @Api(tags = "手机设备表")

+ 45 - 39
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskController.java

@@ -1,52 +1,46 @@
 package cn.com.ctop.crawler.modules.appium.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 org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
-
-import java.util.Date;
-
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 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;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
-@Api(tags = "手机任务表")
+@Api(tags = "任务表")
 @RestController
 @RequestMapping("/appium/appiumTask")
 public class AppiumTaskController {
@@ -62,8 +56,8 @@ public class AppiumTaskController {
      * @param req
      * @return
      */
-    @AutoLog(value = "手机任务表-分页列表查询")
-    @ApiOperation(value = "手机任务表-分页列表查询", notes = "手机任务表-分页列表查询")
+    @AutoLog(value = "任务表-分页列表查询")
+    @ApiOperation(value = "任务表-分页列表查询", notes = "任务表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AppiumTask>> queryPageList(AppiumTask appiumTask,
                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -84,8 +78,8 @@ public class AppiumTaskController {
      * @param appiumTask
      * @return
      */
-    @AutoLog(value = "手机任务表-添加")
-    @ApiOperation(value = "手机任务表-添加", notes = "手机任务表-添加")
+    @AutoLog(value = "任务表-添加")
+    @ApiOperation(value = "任务表-添加", notes = "任务表-添加")
     @PostMapping(value = "/add")
     public Result<AppiumTask> add(@RequestBody AppiumTask appiumTask) {
         Result<AppiumTask> result = new Result<AppiumTask>();
@@ -105,8 +99,8 @@ public class AppiumTaskController {
      * @param appiumTask
      * @return
      */
-    @AutoLog(value = "手机任务表-编辑")
-    @ApiOperation(value = "手机任务表-编辑", notes = "手机任务表-编辑")
+    @AutoLog(value = "任务表-编辑")
+    @ApiOperation(value = "任务表-编辑", notes = "任务表-编辑")
     @PutMapping(value = "/edit")
     public Result<AppiumTask> edit(@RequestBody AppiumTask appiumTask) {
         Result<AppiumTask> result = new Result<AppiumTask>();
@@ -129,8 +123,8 @@ public class AppiumTaskController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务表-通过id删除")
-    @ApiOperation(value = "手机任务表-通过id删除", notes = "手机任务表-通过id删除")
+    @AutoLog(value = "任务表-通过id删除")
+    @ApiOperation(value = "任务表-通过id删除", notes = "任务表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
         try {
@@ -148,8 +142,8 @@ public class AppiumTaskController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "手机任务表-批量删除")
-    @ApiOperation(value = "手机任务表-批量删除", notes = "手机任务表-批量删除")
+    @AutoLog(value = "任务表-批量删除")
+    @ApiOperation(value = "任务表-批量删除", notes = "任务表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AppiumTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<AppiumTask> result = new Result<AppiumTask>();
@@ -168,8 +162,8 @@ public class AppiumTaskController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务表-通过id查询")
-    @ApiOperation(value = "手机任务表-通过id查询", notes = "手机任务表-通过id查询")
+    @AutoLog(value = "任务表-通过id查询")
+    @ApiOperation(value = "任务表-通过id查询", notes = "任务表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AppiumTask> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<AppiumTask> result = new Result<AppiumTask>();
@@ -208,13 +202,25 @@ public class AppiumTaskController {
         ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
         List<AppiumTask> pageList = appiumTaskService.list(queryWrapper);
         //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "手机任务表列表");
+        mv.addObject(NormalExcelConstants.FILE_NAME, "任务表列表");
         mv.addObject(NormalExcelConstants.CLASS, AppiumTask.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("手机任务表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务表列表数据", "导出人:Jeecg", "导出信息"));
         mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
         return mv;
     }
 
+    @RequestMapping(value = "/run", method = RequestMethod.POST)
+    public Result<?> run(HttpServletRequest request, HttpServletResponse response, Integer taskId, Integer deviceId) {
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                appiumTaskService.runTask(taskId, deviceId);
+            }
+        };
+        thread.start();
+        return Result.ok("任务已启动");
+    }
+
     /**
      * 通过excel导入数据
      *

+ 17 - 21
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskItemController.java

@@ -8,16 +8,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
-
 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;
@@ -39,14 +36,13 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
-@Api(tags = "手机任务步骤表")
+@Api(tags = "任务内容表")
 @RestController
 @RequestMapping("/appium/appiumTaskItem")
 public class AppiumTaskItemController {
@@ -62,8 +58,8 @@ public class AppiumTaskItemController {
      * @param req
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-分页列表查询")
-    @ApiOperation(value = "手机任务步骤表-分页列表查询", notes = "手机任务步骤表-分页列表查询")
+    @AutoLog(value = "任务内容表-分页列表查询")
+    @ApiOperation(value = "任务内容表-分页列表查询", notes = "任务内容表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AppiumTaskItem>> queryPageList(AppiumTaskItem appiumTaskItem,
                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -84,8 +80,8 @@ public class AppiumTaskItemController {
      * @param appiumTaskItem
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-添加")
-    @ApiOperation(value = "手机任务步骤表-添加", notes = "手机任务步骤表-添加")
+    @AutoLog(value = "任务内容表-添加")
+    @ApiOperation(value = "任务内容表-添加", notes = "任务内容表-添加")
     @PostMapping(value = "/add")
     public Result<AppiumTaskItem> add(@RequestBody AppiumTaskItem appiumTaskItem) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -105,8 +101,8 @@ public class AppiumTaskItemController {
      * @param appiumTaskItem
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-编辑")
-    @ApiOperation(value = "手机任务步骤表-编辑", notes = "手机任务步骤表-编辑")
+    @AutoLog(value = "任务内容表-编辑")
+    @ApiOperation(value = "任务内容表-编辑", notes = "任务内容表-编辑")
     @PutMapping(value = "/edit")
     public Result<AppiumTaskItem> edit(@RequestBody AppiumTaskItem appiumTaskItem) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -129,8 +125,8 @@ public class AppiumTaskItemController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-通过id删除")
-    @ApiOperation(value = "手机任务步骤表-通过id删除", notes = "手机任务步骤表-通过id删除")
+    @AutoLog(value = "任务内容表-通过id删除")
+    @ApiOperation(value = "任务内容表-通过id删除", notes = "任务内容表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
         try {
@@ -148,8 +144,8 @@ public class AppiumTaskItemController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-批量删除")
-    @ApiOperation(value = "手机任务步骤表-批量删除", notes = "手机任务步骤表-批量删除")
+    @AutoLog(value = "任务内容表-批量删除")
+    @ApiOperation(value = "任务内容表-批量删除", notes = "任务内容表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AppiumTaskItem> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -168,8 +164,8 @@ public class AppiumTaskItemController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-通过id查询")
-    @ApiOperation(value = "手机任务步骤表-通过id查询", notes = "手机任务步骤表-通过id查询")
+    @AutoLog(value = "任务内容表-通过id查询")
+    @ApiOperation(value = "任务内容表-通过id查询", notes = "任务内容表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AppiumTaskItem> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -208,9 +204,9 @@ public class AppiumTaskItemController {
         ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
         List<AppiumTaskItem> pageList = appiumTaskItemService.list(queryWrapper);
         //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "手机任务步骤表列表");
+        mv.addObject(NormalExcelConstants.FILE_NAME, "任务内容表列表");
         mv.addObject(NormalExcelConstants.CLASS, AppiumTaskItem.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("手机任务步骤表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务内容表列表数据", "导出人:Jeecg", "导出信息"));
         mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
         return mv;
     }

+ 253 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskLogController.java

@@ -0,0 +1,253 @@
+package cn.com.ctop.crawler.modules.appium.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 org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskLog;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskLogService;
+
+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 2019-11-01
+ */
+@Slf4j
+@Api(tags = "任务日志表")
+@RestController
+@RequestMapping("/appium/appiumTaskLog")
+public class AppiumTaskLogController {
+    @Autowired
+    private IAppiumTaskLogService appiumTaskLogService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param appiumTaskLog
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "任务日志表-分页列表查询")
+    @ApiOperation(value = "任务日志表-分页列表查询", notes = "任务日志表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AppiumTaskLog>> queryPageList(AppiumTaskLog appiumTaskLog,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<AppiumTaskLog>> result = new Result<IPage<AppiumTaskLog>>();
+        QueryWrapper<AppiumTaskLog> queryWrapper = QueryGenerator.initQueryWrapper(appiumTaskLog, req.getParameterMap());
+        Page<AppiumTaskLog> page = new Page<AppiumTaskLog>(pageNo, pageSize);
+        IPage<AppiumTaskLog> pageList = appiumTaskLogService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param appiumTaskLog
+     * @return
+     */
+    @AutoLog(value = "任务日志表-添加")
+    @ApiOperation(value = "任务日志表-添加", notes = "任务日志表-添加")
+    @PostMapping(value = "/add")
+    public Result<AppiumTaskLog> add(@RequestBody AppiumTaskLog appiumTaskLog) {
+        Result<AppiumTaskLog> result = new Result<AppiumTaskLog>();
+        try {
+            appiumTaskLogService.save(appiumTaskLog);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param appiumTaskLog
+     * @return
+     */
+    @AutoLog(value = "任务日志表-编辑")
+    @ApiOperation(value = "任务日志表-编辑", notes = "任务日志表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<AppiumTaskLog> edit(@RequestBody AppiumTaskLog appiumTaskLog) {
+        Result<AppiumTaskLog> result = new Result<AppiumTaskLog>();
+        AppiumTaskLog appiumTaskLogEntity = appiumTaskLogService.getById(appiumTaskLog.getId());
+        if (appiumTaskLogEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = appiumTaskLogService.updateById(appiumTaskLog);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "任务日志表-通过id删除")
+    @ApiOperation(value = "任务日志表-通过id删除", notes = "任务日志表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            appiumTaskLogService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "任务日志表-批量删除")
+    @ApiOperation(value = "任务日志表-批量删除", notes = "任务日志表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<AppiumTaskLog> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<AppiumTaskLog> result = new Result<AppiumTaskLog>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.appiumTaskLogService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "任务日志表-通过id查询")
+    @ApiOperation(value = "任务日志表-通过id查询", notes = "任务日志表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<AppiumTaskLog> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<AppiumTaskLog> result = new Result<AppiumTaskLog>();
+        AppiumTaskLog appiumTaskLog = appiumTaskLogService.getById(id);
+        if (appiumTaskLog == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(appiumTaskLog);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<AppiumTaskLog> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                AppiumTaskLog appiumTaskLog = JSON.parseObject(deString, AppiumTaskLog.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(appiumTaskLog, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<AppiumTaskLog> pageList = appiumTaskLogService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "任务日志表列表");
+        mv.addObject(NormalExcelConstants.CLASS, AppiumTaskLog.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<AppiumTaskLog> listAppiumTaskLogs = ExcelImportUtil.importExcel(file.getInputStream(), AppiumTaskLog.class, params);
+                appiumTaskLogService.saveBatch(listAppiumTaskLogs);
+                return Result.ok("文件导入成功!数据行数:" + listAppiumTaskLogs.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("文件导入失败!");
+    }
+
+}

+ 15 - 20
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumDevice.java

@@ -1,27 +1,22 @@
 package cn.com.ctop.crawler.modules.appium.entity;
 
-import java.io.Serializable;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.Date;
+
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_device")
@@ -31,28 +26,28 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 public class AppiumDevice {
 
     /**
-     * id
+     * 主键
      */
-    @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
     private Integer id;
     /**
-     * ip
+     * IP
      */
-    @Excel(name = "ip", width = 15)
-    @ApiModelProperty(value = "ip")
+    @Excel(name = "IP", width = 15)
+    @ApiModelProperty(value = "IP")
     private String ip;
     /**
-     * port
+     * 端口号
      */
-    @Excel(name = "port", width = 15)
-    @ApiModelProperty(value = "port")
+    @Excel(name = "端口号", width = 15)
+    @ApiModelProperty(value = "端口号")
     private String port;
     /**
-     * status
+     * 状态
      */
-    @Excel(name = "status", width = 15)
-    @ApiModelProperty(value = "status")
+    @Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
     private Integer status;
     /**
      * createTime

+ 21 - 22
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTask.java

@@ -1,58 +1,55 @@
 package cn.com.ctop.crawler.modules.appium.entity;
 
-import java.io.Serializable;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.Date;
+import java.util.List;
+
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_task")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value = "ctop_appium_task对象", description = "手机任务表")
+@ApiModel(value = "ctop_appium_task对象", description = "任务表")
 public class AppiumTask {
 
     /**
-     * id
+     * 主键
      */
-    @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
     private Integer id;
     /**
-     * taskName
+     * 任务名称
      */
-    @Excel(name = "taskName", width = 15)
-    @ApiModelProperty(value = "taskName")
+    @Excel(name = "任务名称", width = 15)
+    @ApiModelProperty(value = "任务名称")
     private String taskName;
     /**
-     * appPackage
+     * APP包名
      */
-    @Excel(name = "appPackage", width = 15)
-    @ApiModelProperty(value = "appPackage")
+    @Excel(name = "APP包名", width = 15)
+    @ApiModelProperty(value = "APP包名")
     private String appPackage;
     /**
-     * appActivity
+     * APP界面名
      */
-    @Excel(name = "appActivity", width = 15)
-    @ApiModelProperty(value = "appActivity")
+    @Excel(name = "APP界面名", width = 15)
+    @ApiModelProperty(value = "APP界面名")
     private String appActivity;
     /**
      * createTime
@@ -64,4 +61,6 @@ public class AppiumTask {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+    @TableField(exist = false)
+    private List<AppiumTask> subList;
 }

+ 70 - 61
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskItem.java

@@ -1,131 +1,138 @@
 package cn.com.ctop.crawler.modules.appium.entity;
 
-import java.io.Serializable;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.Date;
+import java.util.List;
+
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_task_item")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value = "ctop_appium_task_item对象", description = "手机任务步骤表")
+@ApiModel(value = "ctop_appium_task_item对象", description = "任务内容表")
 public class AppiumTaskItem {
 
     /**
-     * id
+     * 主键
      */
-    @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
     private Integer id;
     /**
-     * taskId
+     * 任务ID
      */
-    @Excel(name = "taskId", width = 15)
-    @ApiModelProperty(value = "taskId")
+    @Excel(name = "任务ID", width = 15)
+    @ApiModelProperty(value = "任务ID")
     private Integer taskId;
     /**
-     * parentId
+     * 父ID
      */
-    @Excel(name = "parentId", width = 15)
-    @ApiModelProperty(value = "parentId")
+    @Excel(name = "父ID", width = 15)
+    @ApiModelProperty(value = "父ID")
     private Integer parentId;
     /**
-     * seq
+     * 顺序
      */
-    @Excel(name = "seq", width = 15)
-    @ApiModelProperty(value = "seq")
+    @Excel(name = "顺序", width = 15)
+    @ApiModelProperty(value = "顺序")
     private Integer seq;
     /**
-     * findType
+     * 查找类型
      */
-    @Excel(name = "findType", width = 15)
-    @ApiModelProperty(value = "findType")
+    @Excel(name = "查找类型", width = 15)
+    @ApiModelProperty(value = "查找类型")
     private String findType;
+
+    @Excel(name = "名称", width = 15)
+    @ApiModelProperty(value = "名称")
+    private String name;
     /**
-     * findKey
+     * 查找关键字
      */
-    @Excel(name = "findKey", width = 15)
-    @ApiModelProperty(value = "findKey")
+    @Excel(name = "查找关键字", width = 15)
+    @ApiModelProperty(value = "查找关键字")
     private String findKey;
     /**
-     * clickType
+     * 点击类型
      */
-    @Excel(name = "clickType", width = 15)
-    @ApiModelProperty(value = "clickType")
+    @Excel(name = "点击类型", width = 15)
+    @ApiModelProperty(value = "点击类型")
     private String clickType;
     /**
-     * offsiteX
+     * 偏移量X
      */
-    @Excel(name = "offsiteX", width = 15)
-    @ApiModelProperty(value = "offsiteX")
+    @Excel(name = "偏移量X", width = 15)
+    @ApiModelProperty(value = "偏移量X")
     private Integer offsiteX;
     /**
-     * offsiteY
+     * 偏移量Y
      */
-    @Excel(name = "offsiteY", width = 15)
-    @ApiModelProperty(value = "offsiteY")
+    @Excel(name = "偏移量Y", width = 15)
+    @ApiModelProperty(value = "偏移量Y")
     private Integer offsiteY;
     /**
-     * loopRate
+     * 循环间隔
      */
-    @Excel(name = "loopRate", width = 15)
-    @ApiModelProperty(value = "loopRate")
+    @Excel(name = "循环间隔", width = 15)
+    @ApiModelProperty(value = "循环间隔")
     private Integer loopRate;
     /**
-     * isMust
+     * 循环类型
+     */
+    @Excel(name = "循环类型", width = 15)
+    @ApiModelProperty(value = "循环类型")
+    private String loopType;
+    /**
+     * 是否必经执行
      */
-    @Excel(name = "isMust", width = 15)
-    @ApiModelProperty(value = "isMust")
-    private Boolean isMust;
+    @Excel(name = "是否必经执行", width = 15)
+    @ApiModelProperty(value = "是否必经执行")
+    private Integer isMust;
     /**
-     * textEqualType
+     * 文本查找类型
      */
-    @Excel(name = "textEqualType", width = 15)
-    @ApiModelProperty(value = "textEqualType")
+    @Excel(name = "文本查找类型", width = 15)
+    @ApiModelProperty(value = "文本查找类型")
     private String textEqualType;
     /**
-     * textEqualKey
+     * 文本查找关键字
      */
-    @Excel(name = "textEqualKey", width = 15)
-    @ApiModelProperty(value = "textEqualKey")
+    @Excel(name = "文本查找关键字", width = 15)
+    @ApiModelProperty(value = "文本查找关键字")
     private String textEqualKey;
     /**
-     * swapType
+     * 滑动类型
      */
-    @Excel(name = "swapType", width = 15)
-    @ApiModelProperty(value = "swapType")
+    @Excel(name = "滑动类型", width = 15)
+    @ApiModelProperty(value = "滑动类型")
     private String swapType;
     /**
-     * waitTime
+     * 延迟时长
      */
-    @Excel(name = "waitTime", width = 15)
-    @ApiModelProperty(value = "waitTime")
+    @Excel(name = "延迟时长", width = 15)
+    @ApiModelProperty(value = "延迟时长")
     private Integer waitTime;
     /**
-     * isClose
+     * 是否执行完关闭
      */
-    @Excel(name = "isClose", width = 15)
-    @ApiModelProperty(value = "isClose")
-    private Boolean isClose;
+    @Excel(name = "是否执行完关闭", width = 15)
+    @ApiModelProperty(value = "是否执行完关闭")
+    private Integer isClose;
     /**
      * createTime
      */
@@ -135,5 +142,7 @@ public class AppiumTaskItem {
      * updateTime
      */
     @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
+	private Date updateTime;
+    @TableField(exist = false)
+    private List<AppiumTaskItem> subList;
 }

+ 81 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskLog.java

@@ -0,0 +1,81 @@
+package cn.com.ctop.crawler.modules.appium.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 任务日志表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Data
+@TableName("ctop_appium_task_log")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_appium_task_log对象", description = "任务日志表")
+public class AppiumTaskLog {
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+    /**
+     * 任务ID
+     */
+    @Excel(name = "任务ID", width = 15)
+    @ApiModelProperty(value = "任务ID")
+    private Integer taskId;
+    /**
+     * 设备ID
+     */
+    @Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private Integer deviceId;
+    /**
+     * 任务名称
+     */
+    @Excel(name = "任务名称", width = 15)
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+    /**
+     * 设备IP
+     */
+    @Excel(name = "设备IP", width = 15)
+    @ApiModelProperty(value = "设备IP")
+    private String deviceIp;
+    /**
+     * 设备端口
+     */
+    @Excel(name = "设备端口", width = 15)
+    @ApiModelProperty(value = "设备端口")
+    private String devicePort;
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumDeviceMapper.java

@@ -8,9 +8,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * 手机设备表
- *
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumDeviceMapper extends BaseMapper<AppiumDevice> {

+ 2 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskItemMapper.java

@@ -7,10 +7,9 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumTaskItemMapper extends BaseMapper<AppiumTaskItem> {

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskLogMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.appium.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 任务日志表
+ *
+ * @author: jeecg-boot
+ * @date: 2019-11-01
+ * @cersion: V1.0
+ */
+public interface AppiumTaskLogMapper extends BaseMapper<AppiumTaskLog> {
+
+}

+ 2 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskMapper.java

@@ -7,10 +7,9 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumTaskMapper extends BaseMapper<AppiumTask> {

+ 5 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/xml/AppiumTaskLogMapper.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.crawler.modules.appium.mapper.AppiumTaskLogMapper">
+
+</mapper>

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumDeviceService.java

@@ -5,10 +5,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumDeviceService extends IService<AppiumDevice> {
 

+ 5 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskItemService.java

@@ -3,13 +3,14 @@ package cn.com.ctop.crawler.modules.appium.service;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumTaskItemService extends IService<AppiumTaskItem> {
-
+    public List<AppiumTaskItem> initTaskItemList(Integer taskId, Integer parentId);
 }

+ 15 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskLogService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.crawler.modules.appium.service;
+
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 任务日志表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+public interface IAppiumTaskLogService extends IService<AppiumTaskLog> {
+
+}

+ 3 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskService.java

@@ -4,12 +4,11 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumTaskService extends IService<AppiumTask> {
-
+    public void runTask(Integer taskId, Integer deviceId);
 }

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumDeviceServiceImpl.java

@@ -9,10 +9,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumDeviceServiceImpl extends ServiceImpl<AppiumDeviceMapper, AppiumDevice> implements IAppiumDeviceService {

+ 26 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskItemServiceImpl.java

@@ -3,18 +3,41 @@ package cn.com.ctop.crawler.modules.appium.service.impl;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskItemMapper;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumTaskItemServiceImpl extends ServiceImpl<AppiumTaskItemMapper, AppiumTaskItem> implements IAppiumTaskItemService {
+    public List<AppiumTaskItem> initTaskItemList(Integer taskId, Integer parentId) {
+        List<AppiumTaskItem> list = new ArrayList<>();
+        QueryWrapper<AppiumTaskItem> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("task_id", taskId);
+        if (parentId == null) {
+            queryWrapper.isNull("parent_id");
+        } else {
+            queryWrapper.eq("parent_id", parentId);
+        }
 
+        queryWrapper.orderByAsc("seq");
+        list = this.list(queryWrapper);
+        if (list != null && list.size() > 0) {
+            for (int i = 0; i < list.size(); i++) {
+                AppiumTaskItem taskItem = list.get(i);
+                taskItem.setSubList(initTaskItemList(taskItem.getTaskId(), taskItem.getId()));
+                list.set(i, taskItem);
+            }
+        }
+        return list;
+    }
 }

+ 20 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskLogServiceImpl.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.crawler.modules.appium.service.impl;
+
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskLog;
+import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskLogMapper;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskLogService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * 任务日志表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Service
+public class AppiumTaskLogServiceImpl extends ServiceImpl<AppiumTaskLogMapper, AppiumTaskLog> implements IAppiumTaskLogService {
+
+}

+ 55 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskServiceImpl.java

@@ -1,20 +1,71 @@
 package cn.com.ctop.crawler.modules.appium.service.impl;
 
+import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskLog;
 import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskMapper;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskLogService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
+import cn.com.ctop.crawler.modules.core.util.AppiumUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.appium.java_client.android.AndroidDriver;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import java.util.List;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumTaskServiceImpl extends ServiceImpl<AppiumTaskMapper, AppiumTask> implements IAppiumTaskService {
+    @Autowired
+    private IAppiumTaskItemService iAppiumTaskItemService;
+    @Autowired
+    private IAppiumDeviceService iAppiumDeviceService;
+    @Autowired
+    private IAppiumTaskLogService iAppiumTaskLogService;
+
+    public void runTask(Integer taskId, Integer deviceId) {
+        AppiumTask task = this.getById(taskId);
+        AppiumDevice appiumDevice = iAppiumDeviceService.getById(deviceId);
+        appiumDevice.setStatus(2);
+        iAppiumDeviceService.updateById(appiumDevice);
+        AppiumTaskLog log = new AppiumTaskLog();
+        log.setDeviceId(deviceId);
+        log.setDeviceIp(appiumDevice.getIp());
+        log.setDevicePort(appiumDevice.getPort());
+        log.setStatus(1);
+        log.setTaskId(taskId);
+        log.setTaskName(task.getTaskName());
+        iAppiumTaskLogService.save(log);
+        List<AppiumTaskItem> taskItemList = iAppiumTaskItemService.initTaskItemList(taskId, null);
+        AppiumUtil appiumUtil = new AppiumUtil();
+        try {
+            AndroidDriver androidDriver = appiumUtil.initAndroidDriver("http://39.106.184.70:4723/wd/hub", appiumDevice.getIp() + ":" + appiumDevice.getPort(), task.getAppPackage(), task.getAppActivity());
+            if (taskItemList != null && taskItemList.size() > 0) {
+                for (AppiumTaskItem appiumTaskItem : taskItemList) {
+                    appiumUtil.runTask(androidDriver, appiumTaskItem, null);
+                }
+                log.setStatus(2);
+                iAppiumTaskLogService.updateById(log);
+                appiumDevice.setStatus(1);
+                iAppiumDeviceService.updateById(appiumDevice);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.setStatus(3);
+            iAppiumTaskLogService.updateById(log);
+            appiumDevice.setStatus(1);
+            iAppiumDeviceService.updateById(appiumDevice);
+        }
+    }
+
 
 }

+ 0 - 173
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumDeviceList.vue

@@ -1,173 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="ip">
-                            <a-input placeholder="请输入ip" v-model="queryParam.ip"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="port">
-                            <a-input placeholder="请输入port" v-model="queryParam.port"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="status">
-                                <a-input placeholder="请输入status" v-model="queryParam.status"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机设备表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumDevice-modal ref="modalForm" @ok="modalFormOk"></appiumDevice-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumDeviceModal from './modules/AppiumDeviceModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumDeviceList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumDeviceModal
-        },
-        data() {
-            return {
-                description: '手机设备表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'ip',
-                        align: "center",
-                        dataIndex: 'ip'
-                    },
-                    {
-                        title: 'port',
-                        align: "center",
-                        dataIndex: 'port'
-                    },
-                    {
-                        title: 'status',
-                        align: "center",
-                        dataIndex: 'status'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumDevice/list",
-                    delete: "/appium/appiumDevice/delete",
-                    deleteBatch: "/appium/appiumDevice/deleteBatch",
-                    exportXlsUrl: "appium/appiumDevice/exportXls",
-                    importExcelUrl: "appium/appiumDevice/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 243
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskItemList.vue

@@ -1,243 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="taskId">
-                            <a-input placeholder="请输入taskId" v-model="queryParam.taskId"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="parentId">
-                            <a-input placeholder="请输入parentId" v-model="queryParam.parentId"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="seq">
-                                <a-input placeholder="请输入seq" v-model="queryParam.seq"></a-input>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="findType">
-                                <a-input placeholder="请输入findType" v-model="queryParam.findType"></a-input>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="findKey">
-                                <a-input placeholder="请输入findKey" v-model="queryParam.findKey"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机任务步骤表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumTaskItem-modal ref="modalForm" @ok="modalFormOk"></appiumTaskItem-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumTaskItemModal from './modules/AppiumTaskItemModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumTaskItemList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumTaskItemModal
-        },
-        data() {
-            return {
-                description: '手机任务步骤表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'taskId',
-                        align: "center",
-                        dataIndex: 'taskId'
-                    },
-                    {
-                        title: 'parentId',
-                        align: "center",
-                        dataIndex: 'parentId'
-                    },
-                    {
-                        title: 'seq',
-                        align: "center",
-                        dataIndex: 'seq'
-                    },
-                    {
-                        title: 'findType',
-                        align: "center",
-                        dataIndex: 'findType'
-                    },
-                    {
-                        title: 'findKey',
-                        align: "center",
-                        dataIndex: 'findKey'
-                    },
-                    {
-                        title: 'clickType',
-                        align: "center",
-                        dataIndex: 'clickType'
-                    },
-                    {
-                        title: 'offsiteX',
-                        align: "center",
-                        dataIndex: 'offsiteX'
-                    },
-                    {
-                        title: 'offsiteY',
-                        align: "center",
-                        dataIndex: 'offsiteY'
-                    },
-                    {
-                        title: 'loopRate',
-                        align: "center",
-                        dataIndex: 'loopRate'
-                    },
-                    {
-                        title: 'isMust',
-                        align: "center",
-                        dataIndex: 'isMust'
-                    },
-                    {
-                        title: 'textEqualType',
-                        align: "center",
-                        dataIndex: 'textEqualType'
-                    },
-                    {
-                        title: 'textEqualKey',
-                        align: "center",
-                        dataIndex: 'textEqualKey'
-                    },
-                    {
-                        title: 'swapType',
-                        align: "center",
-                        dataIndex: 'swapType'
-                    },
-                    {
-                        title: 'waitTime',
-                        align: "center",
-                        dataIndex: 'waitTime'
-                    },
-                    {
-                        title: 'isClose',
-                        align: "center",
-                        dataIndex: 'isClose'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumTaskItem/list",
-                    delete: "/appium/appiumTaskItem/delete",
-                    deleteBatch: "/appium/appiumTaskItem/deleteBatch",
-                    exportXlsUrl: "appium/appiumTaskItem/exportXls",
-                    importExcelUrl: "appium/appiumTaskItem/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 173
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskList.vue

@@ -1,173 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="taskName">
-                            <a-input placeholder="请输入taskName" v-model="queryParam.taskName"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="appPackage">
-                            <a-input placeholder="请输入appPackage" v-model="queryParam.appPackage"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="appActivity">
-                                <a-input placeholder="请输入appActivity" v-model="queryParam.appActivity"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机任务表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumTask-modal ref="modalForm" @ok="modalFormOk"></appiumTask-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumTaskModal from './modules/AppiumTaskModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumTaskList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumTaskModal
-        },
-        data() {
-            return {
-                description: '手机任务表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'taskName',
-                        align: "center",
-                        dataIndex: 'taskName'
-                    },
-                    {
-                        title: 'appPackage',
-                        align: "center",
-                        dataIndex: 'appPackage'
-                    },
-                    {
-                        title: 'appActivity',
-                        align: "center",
-                        dataIndex: 'appActivity'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumTask/list",
-                    delete: "/appium/appiumTask/delete",
-                    deleteBatch: "/appium/appiumTask/deleteBatch",
-                    exportXlsUrl: "appium/appiumTask/exportXls",
-                    importExcelUrl: "appium/appiumTask/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 138
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal.vue

@@ -1,138 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="ip">
-                    <a-input placeholder="请输入ip" v-decorator="['ip', validatorRules.ip ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="port">
-                    <a-input placeholder="请输入port" v-decorator="['port', validatorRules.port ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="status">
-                    <a-input placeholder="请输入status" v-decorator="['status', validatorRules.status ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumDeviceModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    ip: {rules: [{required: true, message: '请输入ip!'}]},
-                    port: {rules: [{required: true, message: '请输入port!'}]},
-                    status: {rules: [{required: true, message: '请输入status!'}]},
-                },
-                url: {
-                    add: "/appium/appiumDevice/add",
-                    edit: "/appium/appiumDevice/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'ip', 'port', 'status'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 145
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal__Style#Drawer.vue

@@ -1,145 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="ip">
-                    <a-input placeholder="请输入ip" v-decorator="['ip', validatorRules.ip ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="port">
-                    <a-input placeholder="请输入port" v-decorator="['port', validatorRules.port ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="status">
-                    <a-input placeholder="请输入status" v-decorator="['status', validatorRules.status ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumDeviceModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    ip: {rules: [{required: true, message: '请输入ip!'}]},
-                    port: {rules: [{required: true, message: '请输入port!'}]},
-                    status: {rules: [{required: true, message: '请输入status!'}]},
-                },
-                url: {
-                    add: "/appium/appiumDevice/add",
-                    edit: "/appium/appiumDevice/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'ip', 'port', 'status'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 0 - 224
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal.vue

@@ -1,224 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskId">
-                    <a-input placeholder="请输入taskId" v-decorator="['taskId', validatorRules.taskId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="parentId">
-                    <a-input placeholder="请输入parentId" v-decorator="['parentId', validatorRules.parentId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="seq">
-                    <a-input-number v-decorator="[ 'seq', validatorRules.seq ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findType">
-                    <a-input placeholder="请输入findType" v-decorator="['findType', validatorRules.findType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findKey">
-                    <a-input placeholder="请输入findKey" v-decorator="['findKey', validatorRules.findKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="clickType">
-                    <a-input placeholder="请输入clickType" v-decorator="['clickType', validatorRules.clickType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteX">
-                    <a-input-number v-decorator="[ 'offsiteX', validatorRules.offsiteX ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteY">
-                    <a-input-number v-decorator="[ 'offsiteY', validatorRules.offsiteY ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="loopRate">
-                    <a-input placeholder="请输入loopRate" v-decorator="['loopRate', validatorRules.loopRate ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isMust">
-                    <a-input placeholder="请输入isMust" v-decorator="['isMust', validatorRules.isMust ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualType">
-                    <a-input placeholder="请输入textEqualType"
-                             v-decorator="['textEqualType', validatorRules.textEqualType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualKey">
-                    <a-input placeholder="请输入textEqualKey"
-                             v-decorator="['textEqualKey', validatorRules.textEqualKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="swapType">
-                    <a-input placeholder="请输入swapType" v-decorator="['swapType', validatorRules.swapType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="waitTime">
-                    <a-input placeholder="请输入waitTime" v-decorator="['waitTime', validatorRules.waitTime ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isClose">
-                    <a-input placeholder="请输入isClose" v-decorator="['isClose', validatorRules.isClose ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskItemModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskId: {rules: [{required: true, message: '请输入taskId!'}]},
-                    parentId: {rules: [{required: true, message: '请输入parentId!'}]},
-                    seq: {rules: [{required: true, message: '请输入seq!'}]},
-                    findType: {rules: [{required: true, message: '请输入findType!'}]},
-                    findKey: {rules: [{required: true, message: '请输入findKey!'}]},
-                    clickType: {rules: [{required: true, message: '请输入clickType!'}]},
-                    offsiteX: {rules: [{required: true, message: '请输入offsiteX!'}]},
-                    offsiteY: {rules: [{required: true, message: '请输入offsiteY!'}]},
-                    loopRate: {rules: [{required: true, message: '请输入loopRate!'}]},
-                    isMust: {rules: [{required: true, message: '请输入isMust!'}]},
-                    textEqualType: {rules: [{required: true, message: '请输入textEqualType!'}]},
-                    textEqualKey: {rules: [{required: true, message: '请输入textEqualKey!'}]},
-                    swapType: {rules: [{required: true, message: '请输入swapType!'}]},
-                    waitTime: {rules: [{required: true, message: '请输入waitTime!'}]},
-                    isClose: {rules: [{required: true, message: '请输入isClose!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTaskItem/add",
-                    edit: "/appium/appiumTaskItem/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskId', 'parentId', 'seq', 'findType', 'findKey', 'clickType', 'offsiteX', 'offsiteY', 'loopRate', 'isMust', 'textEqualType', 'textEqualKey', 'swapType', 'waitTime', 'isClose'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 231
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal__Style#Drawer.vue

@@ -1,231 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskId">
-                    <a-input placeholder="请输入taskId" v-decorator="['taskId', validatorRules.taskId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="parentId">
-                    <a-input placeholder="请输入parentId" v-decorator="['parentId', validatorRules.parentId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="seq">
-                    <a-input-number v-decorator="[ 'seq', validatorRules.seq ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findType">
-                    <a-input placeholder="请输入findType" v-decorator="['findType', validatorRules.findType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findKey">
-                    <a-input placeholder="请输入findKey" v-decorator="['findKey', validatorRules.findKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="clickType">
-                    <a-input placeholder="请输入clickType" v-decorator="['clickType', validatorRules.clickType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteX">
-                    <a-input-number v-decorator="[ 'offsiteX', validatorRules.offsiteX ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteY">
-                    <a-input-number v-decorator="[ 'offsiteY', validatorRules.offsiteY ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="loopRate">
-                    <a-input placeholder="请输入loopRate" v-decorator="['loopRate', validatorRules.loopRate ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isMust">
-                    <a-input placeholder="请输入isMust" v-decorator="['isMust', validatorRules.isMust ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualType">
-                    <a-input placeholder="请输入textEqualType"
-                             v-decorator="['textEqualType', validatorRules.textEqualType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualKey">
-                    <a-input placeholder="请输入textEqualKey"
-                             v-decorator="['textEqualKey', validatorRules.textEqualKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="swapType">
-                    <a-input placeholder="请输入swapType" v-decorator="['swapType', validatorRules.swapType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="waitTime">
-                    <a-input placeholder="请输入waitTime" v-decorator="['waitTime', validatorRules.waitTime ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isClose">
-                    <a-input placeholder="请输入isClose" v-decorator="['isClose', validatorRules.isClose ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskItemModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskId: {rules: [{required: true, message: '请输入taskId!'}]},
-                    parentId: {rules: [{required: true, message: '请输入parentId!'}]},
-                    seq: {rules: [{required: true, message: '请输入seq!'}]},
-                    findType: {rules: [{required: true, message: '请输入findType!'}]},
-                    findKey: {rules: [{required: true, message: '请输入findKey!'}]},
-                    clickType: {rules: [{required: true, message: '请输入clickType!'}]},
-                    offsiteX: {rules: [{required: true, message: '请输入offsiteX!'}]},
-                    offsiteY: {rules: [{required: true, message: '请输入offsiteY!'}]},
-                    loopRate: {rules: [{required: true, message: '请输入loopRate!'}]},
-                    isMust: {rules: [{required: true, message: '请输入isMust!'}]},
-                    textEqualType: {rules: [{required: true, message: '请输入textEqualType!'}]},
-                    textEqualKey: {rules: [{required: true, message: '请输入textEqualKey!'}]},
-                    swapType: {rules: [{required: true, message: '请输入swapType!'}]},
-                    waitTime: {rules: [{required: true, message: '请输入waitTime!'}]},
-                    isClose: {rules: [{required: true, message: '请输入isClose!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTaskItem/add",
-                    edit: "/appium/appiumTaskItem/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskId', 'parentId', 'seq', 'findType', 'findKey', 'clickType', 'offsiteX', 'offsiteY', 'loopRate', 'isMust', 'textEqualType', 'textEqualKey', 'swapType', 'waitTime', 'isClose'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 0 - 138
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal.vue

@@ -1,138 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskName">
-                    <a-input placeholder="请输入taskName" v-decorator="['taskName', validatorRules.taskName ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appPackage">
-                    <a-input placeholder="请输入appPackage" v-decorator="['appPackage', validatorRules.appPackage ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appActivity">
-                    <a-input placeholder="请输入appActivity" v-decorator="['appActivity', validatorRules.appActivity ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskName: {rules: [{required: true, message: '请输入taskName!'}]},
-                    appPackage: {rules: [{required: true, message: '请输入appPackage!'}]},
-                    appActivity: {rules: [{required: true, message: '请输入appActivity!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTask/add",
-                    edit: "/appium/appiumTask/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskName', 'appPackage', 'appActivity'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 145
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal__Style#Drawer.vue

@@ -1,145 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskName">
-                    <a-input placeholder="请输入taskName" v-decorator="['taskName', validatorRules.taskName ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appPackage">
-                    <a-input placeholder="请输入appPackage" v-decorator="['appPackage', validatorRules.appPackage ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appActivity">
-                    <a-input placeholder="请输入appActivity" v-decorator="['appActivity', validatorRules.appActivity ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskName: {rules: [{required: true, message: '请输入taskName!'}]},
-                    appPackage: {rules: [{required: true, message: '请输入appPackage!'}]},
-                    appActivity: {rules: [{required: true, message: '请输入appActivity!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTask/add",
-                    edit: "/appium/appiumTask/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskName', 'appPackage', 'appActivity'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 217 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/AppiumUtil.java

@@ -0,0 +1,217 @@
+package cn.com.ctop.crawler.modules.core.util;
+
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
+import com.google.gson.Gson;
+import io.appium.java_client.TouchAction;
+import io.appium.java_client.android.AndroidDriver;
+import io.appium.java_client.touch.WaitOptions;
+import io.appium.java_client.touch.offset.PointOption;
+import org.openqa.selenium.Point;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.net.URL;
+import java.time.Duration;
+import java.util.List;
+
+public class AppiumUtil {
+    private Boolean isLoop = true;
+    private Duration duration = Duration.ofSeconds(1);
+
+    public void swipeToUp(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action1 = new TouchAction(driver).press(PointOption.point(width / 2, height * 3 / 4)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 2, height / 4)).release();
+        action1.perform();
+    }
+
+    public void swipeToDown(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action2 = new TouchAction(driver).press(PointOption.point(width / 2, height / 4)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 2, height * 3 / 4)).release();
+        action2.perform();
+    }
+
+    public void swipeToLeft(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action3 = new TouchAction(driver).press(PointOption.point(width * 3 / 4, height / 2)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 4, height / 2)).release();
+        action3.perform();
+    }
+
+    public void tapPoint(AndroidDriver driver, Integer x, Integer y) {
+        TouchAction action = new TouchAction(driver).tap(PointOption.point(x, y)).release();
+        action.perform();
+    }
+
+    public void swipeToRight(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action4 = new TouchAction(driver).press(PointOption.point(width / 4, height / 2)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width * 3 / 4, height / 2)).release();
+        action4.perform();
+    }
+
+    public AndroidDriver initAndroidDriver(String serverUrl, String deviceName, String appPackage, String appActivity) throws Exception {
+        return new AndroidDriver(new URL(serverUrl), initCapabilities(deviceName, appPackage, appActivity));
+    }
+
+    public DesiredCapabilities initCapabilities(String deviceName, String appPackage, String appActivity) {
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setCapability("deviceName", deviceName);
+        desiredCapabilities.setCapability("platformName", "Android");
+        desiredCapabilities.setCapability("appPackage", appPackage);
+        desiredCapabilities.setCapability("noReset", true);
+        desiredCapabilities.setCapability("unicodeKeyboard", true);
+        desiredCapabilities.setCapability("resetKeyboard", true);
+        desiredCapabilities.setCapability("appActivity", appActivity);
+        return desiredCapabilities;
+    }
+
+    public WebElement getElementById(AndroidDriver androidDriver, String id) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsById(id);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public WebElement getElementByClass(AndroidDriver androidDriver, String className) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsByClassName(className);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public WebElement getElementByXpath(AndroidDriver androidDriver, String xpath) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsByXPath(xpath);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public void runTask(AndroidDriver androidDriver, AppiumTaskItem appiumTaskItem, WebElement loopElement) throws Exception {
+        if (appiumTaskItem != null) {
+            System.out.println(new Gson().toJson(appiumTaskItem));
+            if (appiumTaskItem.getWaitTime() != null && appiumTaskItem.getWaitTime() > 0) {
+                Thread.sleep(appiumTaskItem.getWaitTime());
+            }
+            if (appiumTaskItem.getLoopType() != null && appiumTaskItem.getLoopType().equals("noloop")) {
+                if (appiumTaskItem.getFindType() != null) {
+                    WebElement element = null;
+                    if (appiumTaskItem.getFindType().equals("id")) {
+                        element = getElementById(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("class")) {
+                        element = getElementByClass(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("xpath")) {
+                        element = getElementByXpath(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("loop")) {
+                        element = loopElement;
+                    }
+                    if (element != null) {
+                        if (appiumTaskItem.getTextEqualType() != null) {
+                            if (appiumTaskItem.getTextEqualType().equals("eq")) {
+                                if (!element.getText().equals(appiumTaskItem.getTextEqualKey())) {
+                                    return;
+                                }
+                            } else if (appiumTaskItem.getTextEqualType().equals("neq")) {
+                                if (element.getText() == null || element.getText().equals(appiumTaskItem.getTextEqualKey())) {
+                                    return;
+                                }
+                            }
+                        }
+                        if (appiumTaskItem.getClickType() != null) {
+                            if (appiumTaskItem.getClickType().equals("element")) {
+                                element.click();
+                            } else if (appiumTaskItem.getClickType().equals("point")) {
+                                Point point = element.getLocation();
+                                tapPoint(androidDriver, point.getX() + appiumTaskItem.getOffsiteX(), point.getY() + appiumTaskItem.getOffsiteY());
+                            }
+                        }
+                        List<AppiumTaskItem> subTask = appiumTaskItem.getSubList();
+                        if (subTask != null && subTask.size() > 0) {
+                            for (AppiumTaskItem task : subTask) {
+                                runTask(androidDriver, task, element);
+                            }
+                        }
+                    } else {
+                        if (appiumTaskItem.getIsMust() != null && appiumTaskItem.getIsMust() == 1) {
+                            if (appiumTaskItem.getLoopRate() != null && appiumTaskItem.getLoopRate() > 0) {
+                                Thread.sleep(appiumTaskItem.getLoopRate());
+                            }
+                            runTask(androidDriver, appiumTaskItem, element);
+                            return;
+                        }
+                        if (appiumTaskItem.getClickType() != null && appiumTaskItem.getClickType().equals("point")) {
+                            tapPoint(androidDriver, appiumTaskItem.getOffsiteX(), appiumTaskItem.getOffsiteY());
+                        }
+                    }
+                }
+                if (appiumTaskItem.getSwapType() != null) {
+                    if (appiumTaskItem.getSwapType().equals("up")) {
+                        this.swipeToUp(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("down")) {
+                        this.swipeToDown(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("left")) {
+                        this.swipeToLeft(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("right")) {
+                        this.swipeToRight(androidDriver);
+                    }
+                }
+            } else if (appiumTaskItem.getLoopType() != null && appiumTaskItem.getLoopType().equals("loop")) {
+                while (isLoop) {
+                    System.out.println("loop:" + isLoop);
+                    if (appiumTaskItem.getFindType() != null) {
+                        List<WebElement> list = null;
+                        if (appiumTaskItem.getFindType().equals("id")) {
+                            list = androidDriver.findElementsById(appiumTaskItem.getFindKey());
+                        } else if (appiumTaskItem.getFindType().equals("class")) {
+                            list = androidDriver.findElementsByClassName(appiumTaskItem.getFindKey());
+                        } else if (appiumTaskItem.getFindType().equals("xpath")) {
+                            list = androidDriver.findElementsByXPath(appiumTaskItem.getFindKey());
+                        }
+                        if (list != null && list.size() > 0) {
+                            for (WebElement element : list) {
+                                if (!isLoop) {
+                                    break;
+                                }
+                                if (appiumTaskItem.getLoopRate() != null && appiumTaskItem.getLoopRate() > 0) {
+                                    Thread.sleep(appiumTaskItem.getLoopRate());
+                                }
+                                List<AppiumTaskItem> subTask = appiumTaskItem.getSubList();
+                                if (subTask != null && subTask.size() > 0) {
+                                    for (AppiumTaskItem task : subTask) {
+                                        runTask(androidDriver, task, element);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    if (appiumTaskItem.getSwapType() != null) {
+                        if (appiumTaskItem.getSwapType().equals("up")) {
+                            this.swipeToUp(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("down")) {
+                            this.swipeToDown(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("left")) {
+                            this.swipeToLeft(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("right")) {
+                            this.swipeToRight(androidDriver);
+                        }
+                    }
+                }
+
+            }
+            if (appiumTaskItem.getIsClose() != null && appiumTaskItem.getIsClose() == 1) {
+                this.isLoop = false;
+            }
+        }
+    }
+}

+ 4 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/test/AppiumTest.java

@@ -237,7 +237,7 @@ public class AppiumTest {
     public void t() {
         try {
 //            AndroidDriver androidDriver = initAndroidDriver("http://39.106.184.70:4723/wd/hub","183.131.157.66:10005","com.smile.gifmaker","com.yxcorp.gifshow.HomeActivity");
-            AndroidDriver androidDriver = initAndroidDriver("http://127.0.0.1:4723/wd/hub", "127.0.0.1:62001", "com.smile.gifmaker", "com.yxcorp.gifshow.HomeActivity");
+            AndroidDriver androidDriver = initAndroidDriver("http://39.106.184.70:4723/wd/hub", "183.131.157.66:10005", "com.smile.gifmaker", "com.yxcorp.gifshow.HomeActivity");
 
             List<AppiumTask> list = initTask();
             for (AppiumTask task : list) {
@@ -304,6 +304,9 @@ public class AppiumTest {
                             runTask(androidDriver, appiumTask, element);
                             return;
                         }
+                        if (appiumTask.getClickType() != null && appiumTask.getClickType().equals("point")) {
+                            tapPoint(androidDriver, appiumTask.getOffsiteX(), appiumTask.getOffsiteY());
+                        }
                     }
                 }
                 if (appiumTask.getSwapType() != null) {

+ 3 - 2
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/controller/MaterialInfoController.java

@@ -1,7 +1,8 @@
 package cn.com.ctop.manage.modules.material.controller;
 
-import cn.com.ctop.manage.modules.material.entity.MaterialInfo;
-import cn.com.ctop.manage.modules.material.service.IMaterialInfoService;
+
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 2 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCampaign.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.batch.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;
@@ -30,9 +29,9 @@ public class KuaiShouCampaign {
     /**
      * id
      */
-    @TableId(type = IdType.AUTO)
+    @TableId
     @ApiModelProperty(value = "id")
-    private Long id;
+    private String id;
     /**
      * 账户ID
      */

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java

@@ -31,7 +31,7 @@ public class KuaiShouCreative {
      */
     @TableId
     @ApiModelProperty(value = "id")
-    private Long id;
+    private String id;
     /**
      * 账户ID
      */

+ 2 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.batch.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;
@@ -30,9 +29,9 @@ public class KuaiShouGroup {
     /**
      * id
      */
-    @TableId(type = IdType.AUTO)
+    @TableId
     @ApiModelProperty(value = "id")
-    private Long id;
+    private String id;
     /**
      * 账户ID
      */

+ 9 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouVideoUpload.java

@@ -51,6 +51,15 @@ public class KuaiShouVideoUpload {
     @Excel(name = "本地保存地址", width = 15)
     @ApiModelProperty(value = "本地保存地址")
     private Object savaPath;
+
+    /**
+     * 本地保存地址
+     */
+    @Excel(name = "md5", width = 15)
+    @ApiModelProperty(value = "md5")
+    private Object signature;
+
+
     /**
      * 视频大小
      */

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java

@@ -256,4 +256,6 @@ public interface IKuaishouInterfaceService {
     void getCampaignList(CtopOauthToken token);
 
     void getGroupList(CtopOauthToken token);
+
+    void loadData() throws InterruptedException;
 }

+ 70 - 13
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.*;
@@ -46,6 +47,9 @@ import java.io.IOException;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.util.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * @author
@@ -700,15 +704,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     private KuaishouReportDailyCreativeStatistic setDailyStatistic(KuaishouReportDailyCreative creative, CtopOauthToken token) {
         KuaishouReportDailyCreativeStatistic statistic = new KuaishouReportDailyCreativeStatistic(creative);
-        KuaiShouCreative getCreative = kuaiShouCreativeService.getById(creative.getId());
+        KuaiShouCreative getCreative = kuaiShouCreativeService.getById("" + token.getAccountId() + creative.getCreativeId());
         if (null != getCreative) {
             statistic.setCreativeName(getCreative.getCreativeName());
-            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById(getCreative.getCampaignId());
+            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById("" + token.getAccountId() + getCreative.getCampaignId());
             if (null != getCampaign) {
                 statistic.setCampaignId(getCampaign.getCampaignId());
                 statistic.setCampaignName(getCampaign.getCampaignName());
             }
-            KuaiShouGroup getGroup = kuaiShouGroupService.getById(getCreative.getUnitId());
+            KuaiShouGroup getGroup = kuaiShouGroupService.getById("" + token.getAccountId() + getCreative.getUnitId());
             if (null != getGroup) {
                 statistic.setUnitId(getGroup.getUnitId());
                 statistic.setUnitName(getGroup.getUnitName());
@@ -821,15 +825,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     private KuaishouReportHourlyCreativeStatistic setHourlyStatistic(KuaishouReportHourlyCreative creative, CtopOauthToken token) {
         KuaishouReportHourlyCreativeStatistic statistic = new KuaishouReportHourlyCreativeStatistic(creative);
-        KuaiShouCreative getCreative = kuaiShouCreativeService.getById(creative.getId());
+        KuaiShouCreative getCreative = kuaiShouCreativeService.getById("" + token.getAccountId() + creative.getCreativeId());
         if (null != getCreative) {
             statistic.setCreativeName(getCreative.getCreativeName());
-            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById(getCreative.getCampaignId());
+            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById("" + token.getAccountId() + getCreative.getCampaignId());
             if (null != getCampaign) {
                 statistic.setCampaignId(getCampaign.getCampaignId());
                 statistic.setCampaignName(getCampaign.getCampaignName());
             }
-            KuaiShouGroup getGroup = kuaiShouGroupService.getById(getCreative.getUnitId());
+            KuaiShouGroup getGroup = kuaiShouGroupService.getById("" + token.getAccountId() + getCreative.getUnitId());
             if (null != getGroup) {
                 statistic.setUnitId(getGroup.getUnitId());
                 statistic.setUnitName(getGroup.getUnitName());
@@ -1079,7 +1083,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             return;
         }
         addCampaign(accountId, details);
-        getCreativeListByPage(accessToken, accountId, page + 1);
+        getCampaignListByPage(accessToken, accountId, page + 1);
     }
 
     /**
@@ -1160,18 +1164,18 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
     }
 
-
     private void addCampaign(Long advertiserId, JSONArray details) {
         for (int i = 0; i < details.size(); i++) {
             JSONObject detail = JSONObject.parseObject(details.get(i).toString());
             if (!Check.isNull(detail)) {
                 KuaiShouCampaign campaign = new KuaiShouCampaign();
+                campaign.setId("" + advertiserId + detail.getLong("campaign_id"));
                 campaign.setAccountId(advertiserId);
                 campaign.setCampaignId(detail.getLong("campaign_id"));
                 campaign.setCampaignName(detail.getString("campaign_name"));
                 campaign.setDayBudget(detail.getLong("day_budget"));
                 campaign.setStatus(detail.getInteger("status"));
-                campaignMapper.insert(campaign);
+                kuaiShouCampaignService.saveOrUpdate(campaign);
             }
         }
     }
@@ -1181,6 +1185,59 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         getGroupListByPage(token, 1);
     }
 
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    static ExecutorService executorService = null;
+    static CountDownLatch countDownLatch = null; //线程计数器          如果不用执行完后统一走流程,可以不要这个
+
+    @Override
+    public void loadData() throws InterruptedException {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+//        Date getDate = new Date();
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+            return;
+        }
+        int times = tokens.size();
+        executorService = Executors.newFixedThreadPool(5);
+        countDownLatch = new CountDownLatch(times);
+        for (CtopOauthToken token : tokens) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    //1:获取全量广告计划数据
+                    getCampaignList(token);
+                    //1:获取全量广告组数据
+                    getGroupList(token);
+                    //1:获取全量创意数据
+                    getCreativeList(token);
+                    //2:获取全量视频素材数据
+                    getVideoList(token);
+                    countDownLatch.countDown();
+                }
+            });
+        }
+        countDownLatch.await();
+        //关掉线程池
+        executorService.shutdown();
+
+        executorService = Executors.newFixedThreadPool(5);
+        countDownLatch = new CountDownLatch(times);
+        for (CtopOauthToken token : tokens) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    getAdvertiserCreativeReportHourly(token, getDate, getDate);
+                    countDownLatch.countDown();
+                }
+            });
+        }
+        countDownLatch.await();
+        //关掉线程池
+        executorService.shutdown();
+    }
+
     private void getGroupListByPage(CtopOauthToken token, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
         JSONObject param = new JSONObject();
@@ -1307,7 +1364,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     }
 
-
     private void addGroup(Long advertiserId, JSONArray details) {
         if (!Check.isNull(details)) {
             for (int i = 0; i < details.size(); i++) {
@@ -1323,6 +1379,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setCampaignId(detail.getLong("campaign_id"));
                     Long unitId = detail.getLong("unit_id");
                     group.setUnitId(unitId);
+                    group.setId("" + advertiserId + unitId);
                     group.setUnitName(detail.getString("unit_name"));
                     group.setBidType(detail.getInteger("bid_type"));
                     group.setReviewDetail(detail.getString("review_detail"));
@@ -1335,7 +1392,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
-                    groupMapper.insert(group);
+                    kuaiShouGroupService.saveOrUpdate(group);
                     // 添加应用信息
                     JSONObject diverseJson = detail.getJSONObject("diverse_data");
                     if (!Check.isNull(diverseJson)) {
@@ -1404,7 +1461,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             JSONObject detailJson = JSONObject.parseObject(details.get(i).toString());
             if (!Check.isNull(detailJson)) {
                 KuaiShouCreative creative = new KuaiShouCreative();
-                creative.setId(detailJson.getLong("creative_id"));
+                creative.setId("" + advertiserId + detailJson.getLong("creative_id"));
                 creative.setAccountId(advertiserId);
                 creative.setStatus(detailJson.getInteger("status"));
                 creative.setCampaignId(detailJson.getLong("campaign_id"));
@@ -1512,7 +1569,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 JSONObject detailJson = JSONObject.parseObject(details.get(i).toString());
                                 if (!Check.isNull(detailJson)) {
                                     KuaiShouCreative creative = new KuaiShouCreative();
-                                    creative.setId(detailJson.getLong("creative_id"));
+                                    creative.setId("" + advertiserId + detailJson.getLong("creative_id"));
                                     creative.setAccountId(advertiserId);
                                     creative.setStatus(detailJson.getInteger("status"));
                                     creative.setCampaignId(detailJson.getLong("campaign_id"));

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyCreativeStatistic.java

@@ -1,8 +1,10 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -137,6 +139,8 @@ public class KuaishouReportDailyCreativeStatistic {
      */
     @Excel(name = "平均千次曝光消耗", width = 15)
     @ApiModelProperty(value = "平均千次曝光消耗")
+    @JsonProperty("impression_1k_cost")
+    @TableField("impression_1k_cost")
     private BigDecimal impression1kCost;
     /**
      * eventCreditGrantLandingPageCost

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyCreativeStatistic.java

@@ -1,8 +1,10 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -143,6 +145,8 @@ public class KuaishouReportHourlyCreativeStatistic {
      */
     @Excel(name = "平均千次曝光消耗", width = 15)
     @ApiModelProperty(value = "平均千次曝光消耗")
+    @JsonProperty("impression_1k_cost")
+    @TableField("impression_1k_cost")
     private BigDecimal impression1kCost;
     /**
      * eventCreditGrantLandingPageCost

+ 37 - 0
module-report/src/main/java/cn/com/ctop/bytedance/controller/MaterialReportController.java

@@ -0,0 +1,37 @@
+package cn.com.ctop.bytedance.controller;
+
+
+import cn.com.ctop.bytedance.service.IMaterialReportService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/materialReport")
+public class MaterialReportController {
+    @Autowired
+    private IMaterialReportService materialReportService;
+
+
+    @GetMapping(value = "/getKuaiShouMaterialReport")
+    public JSONObject getKuaiShouMaterialReport(@RequestBody String userId) {
+        String roleCode = materialReportService.getRoleCodeByUserId(userId);
+        if ("operator".equals(roleCode)) {
+            // 根据创建人查询accountId
+
+        } else {
+            // 查询所有
+        }
+
+
+        return null;
+
+    }
+
+
+}

+ 4 - 5
module-report/src/main/java/cn/com/ctop/bytedance/mapper/AccountReportMapper.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 public interface AccountReportMapper {
@@ -106,16 +107,15 @@ public interface AccountReportMapper {
      * @param accountIds
      * @return
      */
-    List<JSONObject> selectAccountReportByDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("accountIds") JSONArray accountIds);
+    List<JSONObject> selectAccountReportByDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("accountIds") JSONArray accountIds, @Param("discount") BigDecimal discount);
 
 
     /**
-     *
      * @param accountIds
      * @return
      */
 
-    List<JSONObject> selectAccountReport(@Param("accountIds") JSONArray accountIds);
+    List<JSONObject> selectAccountReport(@Param("accountIds") JSONArray accountIds, @Param("discount") BigDecimal discount);
 
 
     /**
@@ -126,10 +126,9 @@ public interface AccountReportMapper {
      * @param statHour
      * @return
      */
-    JSONObject selectSummaryByAccountId(@Param("date") String date, @Param("accountIds") JSONArray accountIds, @Param("statHour") Integer statHour);
+    JSONObject selectSummaryByAccountId(@Param("date") String date, @Param("accountIds") JSONArray accountIds, @Param("statHour") Integer statHour, @Param("discount") BigDecimal discount);
 
     /**
-     *
      * @param startDate
      * @param endDate
      * @param accountIds

+ 7 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/MaterialReportMapper.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.bytedance.mapper;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface MaterialReportMapper {
+    String getRoleCodeByUserId(@Param("userId") String userId);
+}

+ 7 - 1
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/AccountReportMapper.xml

@@ -15,8 +15,10 @@
         sum(bclick) bClick,-- 行为数
         sum(form_count) formCount, -- 表单提交数
         (sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
+        ((sum(charge) / sum(form_count)) / #{discount}) afterFormPrice, -- 表单提交单价
         sum(activation) activationCount, -- 激活数
-        (sum(charge) / sum(activation)) activationPrice -- 激活单价
+        (sum(charge) / sum(activation)) activationPrice, -- 激活单价
+        ((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice -- 激活单价
         from
         ctop_kuaishou_report_hourly_account
         where stat_date = #{date}
@@ -41,8 +43,10 @@
         sum(bclick) bClick,-- 行为数
         sum(form_count) formCount,
         (sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
+        ((sum(charge) / sum(form_count)) / #{discount}) afterFormPrice, -- 表单提交单价
         sum(activation) activationCount, -- 激活数
         (sum(charge) / sum(activation)) activationPrice, -- 激活单价
+        ((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice, -- 激活单价
         account_id accountId,
         (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
         from
@@ -68,8 +72,10 @@
         sum(bclick) bClick,-- 行为数
         sum(form_count) formCount,
         (sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
+        ((sum(charge) / sum(form_count)) / #{discount}) afterFormPrice, -- 表单提交单价
         sum(activation) activationCount, -- 激活数
         (sum(charge) / sum(activation)) activationPrice, -- 激活单价
+        ((sum(charge) / sum(activation)) / #{discount}) afterActivationPrice, -- 激活单价
         account_id accountId,
         (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
         from

+ 23 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml

@@ -0,0 +1,23 @@
+<?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.bytedance.mapper.MaterialReportMapper">
+
+
+    <select id="getRoleCodeByUserId" parameterType="Object" resultType="java.lang.String">
+	SELECT
+    role_code
+    FROM
+    sys_role
+    WHERE
+    id = (
+    SELECT
+    t2.role_id
+    FROM
+    sys_user t1
+    LEFT JOIN sys_user_role t2 ON t1.id = t2.user_id
+    WHERE
+    t1.id = #{userId,jdbcType=VARCHAR}
+    )
+	</select>
+
+</mapper>

+ 7 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IMaterialReportService.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.bytedance.service;
+
+public interface IMaterialReportService {
+    String getRoleCodeByUserId(String userId);
+
+
+}

+ 80 - 21
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/AccountReportServiceImpl.java

@@ -249,10 +249,10 @@ public class AccountReportServiceImpl implements IAccountReportService {
                 }
                 JSONObject chainRatioJson = new JSONObject();
                 accountDetail = accountReportMapper.selectReportDetailGroupAccountId(nowDate, accountIds, hour);
-                JSONObject nowAccountSummary = accountReportMapper.selectSummaryByAccountId(nowDate, accountIds, hour);
+                JSONObject nowAccountSummary = accountReportMapper.selectSummaryByAccountId(nowDate, accountIds, hour, discount);
                 if (!Check.isNull(nowAccountSummary)) {
                     returnJson.put("now", nowAccountSummary);
-                    JSONObject yesterdayAccountSummary = accountReportMapper.selectSummaryByAccountId(anotherDay, accountIds, hour);
+                    JSONObject yesterdayAccountSummary = accountReportMapper.selectSummaryByAccountId(anotherDay, accountIds, hour, discount);
                     if (!Check.isNull(yesterdayAccountSummary)) {
                         returnJson.put("yesterday", yesterdayAccountSummary);
                         BigDecimal nowCost = nowAccountSummary.getBigDecimal("cost");
@@ -264,6 +264,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("costProportion", 0); // 消耗环比
                             }
+                        } else {
+                            chainRatioJson.put("costProportion", 0); // 消耗环比
                         }
 
                         Long photoShow = nowAccountSummary.getLong("photoShow");// 今日封面展示
@@ -275,6 +277,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("showProportion", 0); // 展示环比
                             }
+                        } else {
+                            chainRatioJson.put("showProportion", 0); // 展示环比
                         }
 
                         Long photoClick = nowAccountSummary.getLong("photoClick");// 封面点击
@@ -286,6 +290,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("photoClickProportion", 0); // 点击环比
                             }
+                        } else {
+                            chainRatioJson.put("photoClickProportion", 0); // 点击环比
                         }
 
                         Long nowAClick = nowAccountSummary.getLong("aclick"); // 爆光
@@ -297,6 +303,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("aClickProportion", 0); //爆光环比
                             }
+                        } else {
+                            chainRatioJson.put("aClickProportion", 0); //爆光环比
                         }
 
                         BigDecimal nowPhotoClickRatio = nowAccountSummary.getBigDecimal("photoClickRatio"); // 封面点击率
@@ -308,6 +316,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("photoClickRatioProportion", 0); // 封面点击率环比
                             }
+                        } else {
+                            chainRatioJson.put("photoClickRatioProportion", 0); // 封面点击率环比
                         }
 
                         BigDecimal nowCvr = nowAccountSummary.getBigDecimal("cvr"); // cvr
@@ -319,6 +329,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("cvrProportion", 0); // cvr环比
                             }
+                        } else {
+                            chainRatioJson.put("cvrProportion", 0); // cvr环比
                         }
 
                         BigDecimal nowCpm = nowAccountSummary.getBigDecimal("cpm"); // cpm
@@ -330,6 +342,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("cpmProportion", 0); // cpm环比
                             }
+                        } else {
+                            chainRatioJson.put("cpmProportion", 0); // cpm环比
                         }
 
                         Long nowBClick = nowAccountSummary.getLong("bClick"); // 行为数
@@ -341,6 +355,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("bClickProportion", 0); //行为数环比
                             }
+                        } else {
+                            chainRatioJson.put("bClickProportion", 0); //行为数环比
                         }
 
                         Long nowFormCount = nowAccountSummary.getLong("formCount"); // 表单提交数
@@ -353,6 +369,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("formCountProportion", 0); //表单提交数环比
                             }
+                        } else {
+                            chainRatioJson.put("formCountProportion", 0); //表单提交数环比
                         }
 
 
@@ -365,6 +383,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
                             } else {
                                 chainRatioJson.put("activationCountProportion", 0); //表单提交数环比
                             }
+                        } else {
+                            chainRatioJson.put("activationCountProportion", 0); //表单提交数环比
                         }
 
                         BigDecimal nowFormPrice = nowAccountSummary.getBigDecimal("formPrice"); // 表单提交单价
@@ -372,26 +392,60 @@ public class AccountReportServiceImpl implements IAccountReportService {
                         if (!Check.isNull(nowFormPrice) && !Check.isNull(yesterdayFormPrice)) {
                             if (yesterdayFormPrice.compareTo(new BigDecimal(0)) != 0) {
                                 BigDecimal formPriceProportion = (nowFormPrice.subtract(yesterdayFormPrice)).divide(yesterdayFormPrice, BigDecimal.ROUND_HALF_UP, 2);
-                                chainRatioJson.put("formPriceProportion", formPriceProportion.divide(discount, BigDecimal.ROUND_HALF_UP, 2));
+                                chainRatioJson.put("beforeFormPriceProportion", formPriceProportion); // 折前消耗单价
                             } else {
-                                chainRatioJson.put("formPriceProportion", 0); // 表单提交单价环比
+                                chainRatioJson.put("beforeFormPriceProportion", 0); // 折前消耗单价
                             }
+                        } else {
+                            chainRatioJson.put("beforeFormPriceProportion", 0); // 折前消耗单价
+                        }
+
+
+                        BigDecimal nowAfterFormPrice = nowAccountSummary.getBigDecimal("afterFormPrice"); // 表单提交单价
+                        BigDecimal yesterdayAfterFormPrice = yesterdayAccountSummary.getBigDecimal("afterFormPrice");
+                        if (!Check.isNull(nowAfterFormPrice) && !Check.isNull(yesterdayAfterFormPrice)) {
+                            if (yesterdayAfterFormPrice.compareTo(new BigDecimal(0)) != 0) {
+                                BigDecimal afterFormPriceProportion = (nowAfterFormPrice.subtract(yesterdayAfterFormPrice)).divide(yesterdayAfterFormPrice, BigDecimal.ROUND_HALF_UP, 2);
+                                chainRatioJson.put("afterFormPriceProportion", afterFormPriceProportion); // 折后提交单价
+                            } else {
+                                chainRatioJson.put("afterFormPriceProportion", 0); // 折后提交单价
+                            }
+                        } else {
+                            chainRatioJson.put("afterFormPriceProportion", 0); // 折后提交单价
+                        }
 
 
-                            BigDecimal nowActivationPrice = nowAccountSummary.getBigDecimal("activationPrice"); // 表单提交单价
-                            BigDecimal yesterdayActivationPrice = yesterdayAccountSummary.getBigDecimal("activationPrice");
-                            if (!Check.isNull(nowActivationPrice) && !Check.isNull(yesterdayActivationPrice)) {
-                                if (yesterdayFormPrice.compareTo(new BigDecimal(0)) != 0) {
-                                    BigDecimal activationPriceProportion = (nowActivationPrice.subtract(yesterdayActivationPrice)).divide(yesterdayActivationPrice, BigDecimal.ROUND_HALF_UP, 2);
-                                    chainRatioJson.put("activationPriceProportion", activationPriceProportion.divide(discount, BigDecimal.ROUND_HALF_UP, 2));
-                                } else {
-                                    chainRatioJson.put("activationPriceProportion", 0); // 表单提交单价环比
-                                }
+                        BigDecimal nowActivationPrice = nowAccountSummary.getBigDecimal("activationPrice"); // 转化提交单价
+                        BigDecimal yesterdayActivationPrice = yesterdayAccountSummary.getBigDecimal("activationPrice");
+                        if (!Check.isNull(nowActivationPrice) && !Check.isNull(yesterdayActivationPrice)) {
+                            if (yesterdayActivationPrice.compareTo(new BigDecimal(0)) != 0) {
+                                BigDecimal activationPriceProportion = (nowActivationPrice.subtract(yesterdayActivationPrice)).divide(yesterdayActivationPrice, BigDecimal.ROUND_HALF_UP, 2);
+                                chainRatioJson.put("beforeActivationPriceProportion", activationPriceProportion); // 折前转化单价
+                            } else {
+                                chainRatioJson.put("beforeActivationPriceProportion", 0); // 折前激活单价
                             }
+                        } else {
+                            chainRatioJson.put("beforeActivationPriceProportion", 0); // 折前激活单价
                         }
+
+
+                        BigDecimal nowAfterActivationPrice = nowAccountSummary.getBigDecimal("afterActivationPrice"); // 转化提交单价
+                        BigDecimal yesterdayAfterActivationPrice = yesterdayAccountSummary.getBigDecimal("afterActivationPrice");
+                        if (!Check.isNull(nowAfterActivationPrice) && !Check.isNull(yesterdayAfterActivationPrice)) {
+                            if (yesterdayAfterActivationPrice.compareTo(new BigDecimal(0)) != 0) {
+                                BigDecimal activationPriceProportion = (nowAfterActivationPrice.subtract(yesterdayAfterActivationPrice)).divide(yesterdayAfterActivationPrice, BigDecimal.ROUND_HALF_UP, 2);
+                                chainRatioJson.put("afterActivationPriceProportion", activationPriceProportion); // 折后转化单价
+                            } else {
+                                chainRatioJson.put("afterActivationPriceProportion", 0); // 折后激活单价
+                            }
+                        } else {
+                            chainRatioJson.put("afterActivationPriceProportion", 0); // 折后激活单价
+                        }
+
+
+                        returnJson.put("chainRatio", chainRatioJson);
                     }
                 }
-                returnJson.put("chainRatio", chainRatioJson);
             } else if (type == 2) {
                 if (Check.isNull(statHour)) {
                     accountDetail = accountReportMapper.selectReportDetailGroupAccountId(anotherDay, accountIds, 23);
@@ -401,46 +455,51 @@ public class AccountReportServiceImpl implements IAccountReportService {
 
             } else if (type == 3) { // 近七天
                 String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
-                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
 
             } else if (type == 4) { // 近15天
                 String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
-                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
 
 
             } else if (type == 5) {// 近一个月
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
-                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
 
 
             } else if (type == 6) {// 近三个月
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -3);
-                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
 
 
             } else if (type == 7) {// 近六个月
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -6);
-                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
 
 
             } else if (type == 8) {  // 所有
-                accountDetail = accountReportMapper.selectAccountReport(accountIds);
+                accountDetail = accountReportMapper.selectAccountReport(accountIds, discount);
 
 
             } else if (type == 9) {  // 自定义查询日期
                 String startDate = json.getString("startDate");
                 String endDate = json.getString("endDate");
-                accountDetail = accountReportMapper.selectAccountReportByDate(startDate, endDate, accountIds);
+                accountDetail = accountReportMapper.selectAccountReportByDate(startDate, endDate, accountIds, discount);
 
             }
 
+
             returnJson.put("accountDetail", accountDetail);
+
+
         } catch (Exception e) {
             e.printStackTrace();
 
         }
 
+
         return returnJson;
     }
 
+
 }

+ 17 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.bytedance.service.impl;
+
+import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
+import cn.com.ctop.bytedance.service.IMaterialReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MaterialReportServiceImpl implements IMaterialReportService {
+    @Autowired
+    private MaterialReportMapper materialReportMapper;
+
+    @Override
+    public String getRoleCodeByUserId(String userId) {
+        return materialReportMapper.getRoleCodeByUserId(userId);
+    }
+}