Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

xuzuoyun 4 years ago
parent
commit
c44f034e24
97 changed files with 3089 additions and 462 deletions
  1. 33 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/GeneralConstant.java
  2. 67 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  3. 2 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  4. 9 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java
  5. 39 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  6. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  7. 107 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  8. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  9. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  10. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IImageReportDailyService.java
  11. 133 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ImageReportDailyServiceImpl.java
  12. 4 4
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  13. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  14. 46 27
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  15. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceCleanMaterialReport.java
  16. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouCleanMaterialReport.java
  17. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceCleanMaterialReportMapper.java
  18. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaiShouCleanMaterialReportMapper.java
  19. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  20. 7 2
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  21. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceCleanMaterialReportMapper.xml
  22. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouCleanMaterialReportMapper.xml
  23. 35 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  24. 26 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  25. 2 7
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IByteDanceCleanMaterialReportService.java
  26. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IKuaiShouCleanMaterialReportService.java
  27. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialImageInfoService.java
  28. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java
  29. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialTagInfoService.java
  30. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  31. 26 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ByteDanceCleanMaterialReportServiceImpl.java
  32. 18 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouCleanMaterialReportServiceImpl.java
  33. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java
  34. 70 15
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  35. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagInfoServiceImpl.java
  36. 16 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  37. 99 34
      module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java
  38. 52 0
      module-common/src/main/java/com/xxl/job/core/enums/NoEn.java
  39. 12 0
      module-job-bytedance/pom.xml
  40. 0 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java
  41. 45 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/WechatApproveAttendanceJob.java
  42. 43 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/WechatAttendanceJob.java
  43. 0 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java
  44. 99 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouRealTimeController.java
  45. 9 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouRealTimeDataService.java
  46. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java
  47. 17 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java
  48. 110 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouRealTimeDataServiceImpl.java
  49. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouCleanMaterialReportController.java
  50. 290 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyImage.java
  51. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeMapper.java
  52. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyImageMapper.java
  53. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml
  54. 106 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyImageMapper.xml
  55. 0 29
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaiShouCleanMaterialReportService.java
  56. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyCreativeService.java
  57. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyImageService.java
  58. 0 41
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouCleanMaterialReportServiceImpl.java
  59. 27 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyCreativeServiceImpl.java
  60. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyImageServiceImpl.java
  61. 3 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/constant/QYWxConstant.java
  62. 27 16
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatCheckinDataController.java
  63. 28 1
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatDepartmentController.java
  64. 368 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatNoListController.java
  65. 65 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatAttendance.java
  66. 9 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinData.java
  67. 67 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatNoList.java
  68. 63 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/enums/SpNoEnum.java
  69. 6 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java
  70. 3 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatDepartmentMapper.java
  71. 23 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatNoListMapper.java
  72. 65 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml
  73. 6 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatDepartmentMapper.xml
  74. 89 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatNoListMapper.xml
  75. 5 1
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatCheckinDataService.java
  76. 4 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatDepartmentService.java
  77. 49 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatNoListService.java
  78. 11 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatTokenService.java
  79. 0 1
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatUserListService.java
  80. 62 22
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java
  81. 5 11
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatDepartmentServiceImpl.java
  82. 388 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java
  83. 30 7
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatTokenServiceImpl.java
  84. 0 14
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatUserListServiceImpl.java
  85. 0 23
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceCleanMaterialService.java
  86. 0 46
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceCleanMaterialServiceImpl.java
  87. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java
  88. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/ByteDanceCleanMaterialReportController.java
  89. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceCreativeDailyReportMapper.java
  90. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceCreativeDailyReportMapper.xml
  91. 2 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml
  92. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceCreativeDailyReportService.java
  93. 0 5
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceReportMaterialDailyService.java
  94. 0 54
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceCleanMaterialReportServiceImpl.java
  95. 20 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceCreativeDailyReportServiceImpl.java
  96. 0 45
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java
  97. 3 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

+ 33 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/GeneralConstant.java

@@ -0,0 +1,33 @@
+package org.jeecg.common.constant;
+
+/**
+ * 项目中一般字符串常量
+ *
+ * @ClassName GeneralConstant
+ * @Author ZHAOXA
+ * @date 2020-09-29 10:33
+ */
+public class GeneralConstant {
+
+    /**
+     * code
+     */
+    public static final String CODE = "code";
+    public static final String MESSAGE = "message";
+    public static final String ERR_CODE = "errcode";
+    public static final String DAY_BEGIN = " 00:00:00";
+    public static final String DAY_END = " 23:59:59";
+    public static final String PAGE_NO = "pageNo";
+    public static final String PAGE_SIZE = "pageSize";
+    public static final String API_START_TIME = "starttime";
+    public static final String API_END_TIME = "endtime";
+    public static final String START_TIME = "startTime";
+    public static final String STOP_TIME = "stopTime";
+    public static final String ACCESS_TOKEN = "accessToken";
+    public static final String TYPE = "type";
+    public static final String VALUE = "value";
+
+
+
+
+}

+ 67 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -10,7 +10,14 @@ import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 
 /**
 /**
  * 类描述:时间操作定义类
  * 类描述:时间操作定义类
@@ -71,6 +78,21 @@ public class DateUtils extends PropertyEditorSupport {
     private static final long HOUR_IN_MILLIS = 3600 * 1000L;
     private static final long HOUR_IN_MILLIS = 3600 * 1000L;
     private static final long MINUTE_IN_MILLIS = 60 * 1000L;
     private static final long MINUTE_IN_MILLIS = 60 * 1000L;
     private static final long SECOND_IN_MILLIS = 1000L;
     private static final long SECOND_IN_MILLIS = 1000L;
+    /**
+     * 格式常量
+     */
+    public final static String SHORT_FORMAT = "yyyyMMdd";
+    public final static String LONG_FORMAT = "yyyyMMddHHmmss";
+    public final static String YEARHOUR_FORMAT = "yyyyMMddHH";
+    public final static String WEB_FORMAT = "yyyy-MM-dd";
+    public final static String TIME_FORMAT = "HHmmss";
+    public final static String COLON_TIME_FORMAT = "HH:mm:ss";
+    public final static String CHINESEDT_FORMAT = "yyyy年MM月dd日";
+    public final static String NEW_FORMAT = "yyyy-MM-dd HH:mm:ss";
+    public final static String WEB_FORMAT_ALL = "yyyy MM dd HH mm ss";
+    public final static String SECOND_FORMAT = "yyyy-MM-dd HH";
+    public final static String GREGORIAN_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+    public final static String NOMS_GREGORIAN_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
 
 
     public static String getNowHour(Date date) {
     public static String getNowHour(Date date) {
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
@@ -731,7 +753,6 @@ public class DateUtils extends PropertyEditorSupport {
         return temp;
         return temp;
     }
     }
 
 
-
     private static Calendar zeroFromHour(long milliseconds) {
     private static Calendar zeroFromHour(long milliseconds) {
         Calendar calendar = Calendar.getInstance(); // 获得一个日历
         Calendar calendar = Calendar.getInstance(); // 获得一个日历
 
 
@@ -1480,6 +1501,50 @@ public class DateUtils extends PropertyEditorSupport {
         return lDate;
         return lDate;
     }
     }
 
 
+    /**
+     * 获取前一天的日期
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    public static String getLastDay(String time) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        Date date = null;
+        try {
+            date = sdf.parse(time);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        calendar.setTime(date);
+        int day = calendar.get(Calendar.DATE);
+        //                      此处修改为+1则是获取后一天
+        calendar.set(Calendar.DATE, day - 1);
+
+        String lastDay = sdf.format(calendar.getTime());
+        return lastDay;
+    }
+
+    /**
+     * 获取当月1号零时零分的时间
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    public static String initDateByMonth() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sdf.format(calendar.getTime());
+    }
 }
 }
 
 
 
 

+ 2 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java

@@ -91,6 +91,7 @@ public class MD5Util {
 	}
 	}
 
 
 	public static void main(String[] args) throws Exception {
 	public static void main(String[] args) throws Exception {
-		System.out.println(getFileMd5("D:\\3-1599203419045.jpg"));
+		System.out.println(getFileMd5("D:\\mnt\\0427有缘3-帆楠E打车-同城热恋-1587982341839.mp4"));
+		System.out.println(getFileMd5("D:\\mnt\\0427有缘4-帆楠E洗脚-同城热恋-1593661309704.mp4"));
 	}
 	}
 }
 }

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.ctop.service.IImageReportDailyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -12,8 +13,15 @@ import java.util.Map;
 public class ImageCostController {
 public class ImageCostController {
     @Autowired
     @Autowired
     private IBytedanceReportMaterialDailyService materialDailyService;
     private IBytedanceReportMaterialDailyService materialDailyService;
+    @Autowired
+    private IImageReportDailyService imageReportDailyService;
     @PostMapping("bytedance/cost")
     @PostMapping("bytedance/cost")
     public Map<String,Object> bytedanceImageCost(@RequestBody JSONObject data){
     public Map<String,Object> bytedanceImageCost(@RequestBody JSONObject data){
-        return materialDailyService.bytedanceImageCost(data);
+        return imageReportDailyService.bytedanceImageCost(data);
+    }
+
+    @PostMapping("kuaishou/cost")
+    public Map<String,Object> kuaishouImageCost(@RequestBody JSONObject data){
+        return imageReportDailyService.kuaishouImageCost(data);
     }
     }
 }
 }

+ 39 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -9,10 +9,6 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
 import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -35,10 +31,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.net.URLDecoder;
 import java.net.URLDecoder;
 import java.text.ParseException;
 import java.text.ParseException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * 素材信息
  * 素材信息
@@ -315,6 +308,44 @@ public class MaterialInfoController {
         return result;
         return result;
     }
     }
 
 
+    @GetMapping(value = "/listV2")
+    public Map<String,Object> queryPageList(String type,Integer status,Long projectId,String materialName,String code,
+                                                     String startDate,String endDate,String tagCode,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        List<Long>projectIds = null;
+        String userId = user.getId();
+        String roleCode = roleService.getRoleCodeByUserId(userId);
+        if(null == tagCode||tagCode.trim().equals("")){
+            tagCode = null;
+        }
+        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")){
+            //查询所有
+            if(null!=projectId&&projectId!=0){
+                projectIds = new ArrayList<>();
+                projectIds.add(projectId);
+            }
+            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
+        }else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)){
+            //查询自己所在项目下的数据
+            if(null == projectId||projectId == 0){
+                projectIds = memberService.selectProjectsByUserId(userId);
+            }else{
+                projectIds = new ArrayList<>();
+                projectIds.add(projectId);
+            }
+            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
+        }else{
+            //查询自己上传的视频
+            if(null!=projectId&&projectId!=0){
+                projectIds = new ArrayList<>();
+                projectIds.add(projectId);
+            }
+            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,userId,pageNo,pageSize);
+        }
+    }
+
 
 
     @AutoLog(value = "素材信息-分页列表查询")
     @AutoLog(value = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")

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

@@ -330,6 +330,7 @@ public class ProjectController {
                 projectMemberService.removeByMap(map);
                 projectMemberService.removeByMap(map);
                 ProjectMember member = new ProjectMember();
                 ProjectMember member = new ProjectMember();
                 member.setProjectId(id);
                 member.setProjectId(id);
+                member.setProjectName(project.getProjectName());
                 member.setUserId(userId);
                 member.setUserId(userId);
                 member.setUserName(userName);
                 member.setUserName(userName);
                 String roleCode = sysRoleService.getRoleCodeByUserId(userId);
                 String roleCode = sysRoleService.getRoleCodeByUserId(userId);

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

@@ -2,14 +2,19 @@ package org.jeecg.modules.ctop.controller;
 
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.common.module.utils.StringUtils;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -29,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 用户分配
  * 用户分配
@@ -55,6 +61,14 @@ public class UserAllocationController {
     @Autowired
     @Autowired
     private IProjectMemberService projectMemberService;
     private IProjectMemberService projectMemberService;
 
 
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+
+
     @GetMapping(value = "/accountTurnProject")
     @GetMapping(value = "/accountTurnProject")
     public Result<Object> getAccountList(Long accountId, Long projectId) {
     public Result<Object> getAccountList(Long accountId, Long projectId) {
         Result<Object> result = new Result<>();
         Result<Object> result = new Result<>();
@@ -196,6 +210,99 @@ public class UserAllocationController {
     }
     }
 
 
 
 
+    @GetMapping(value = "/updateAuthName")
+    public Result<UserAllocation> updateAuthName(Long accountId, String mediaId) {
+        Result<UserAllocation> result = new Result<>();
+        try {
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+
+            String authName = null;
+            if (mediaId.equals("2") || mediaId.equals("4")) {
+                Map<String, Object> advertiseBaseInfoMap = kuaishouInterfaceService.advertiserInfo(accountId, oauthToken.getAccessToken());
+                Integer code = (Integer) advertiseBaseInfoMap.get("code");
+                if (code != 0) {
+                    throw new Exception("更新授权名称失败");
+
+                }
+                authName = (String) advertiseBaseInfoMap.get("userName");
+            } else if (mediaId.equals("1") || mediaId.equals("3")) {
+                Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(String.valueOf(accountId), oauthToken.getAccessToken());
+                Integer code = (Integer) advertiserDataMap.get("code");
+                if (code != 0) {
+                    throw new Exception("更新授权名称失败");
+
+                }
+                authName = (String) advertiserDataMap.get("name");
+            }
+            UserAllocation allocation = new UserAllocation();
+            allocation.setAuthName(authName);
+
+            QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("account_id", accountId);
+            queryWrapper.eq("media_id", mediaId);
+
+            boolean update = userAllocationService.update(allocation, queryWrapper);
+            if (update) {
+                result.setSuccess(true);
+            } else {
+                result.setSuccess(false);
+            }
+
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+
+    }
+
+
+    /**
+     * 统计报表 查看所有账号
+     *
+     * @param projectId
+     * @return
+     */
+    @GetMapping(value = "/getUserIdListByProjectId")
+    public Result<List<JSONObject>> getUserIdListByProjectId(Long projectId) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            if (Check.isNull(projectId)) {
+                throw new Exception("请选择项目id");
+            }
+            List<JSONObject> userIdList = userAllocationService.getUserIdListByProjectId(projectId);
+            result.setSuccess(true);
+            result.setResult(userIdList);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.success(e.getMessage());
+        }
+        return result;
+    }
+
+
+    @GetMapping(value = "/getAccountIdListByUserId")
+    public Result<List<JSONObject>> getAccountIdListByUserId(Long userId) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            if (Check.isNull(userId)) {
+                throw new Exception("请选择快手id");
+            }
+            List<JSONObject> accountIdList = userAllocationService.getAccountIdListByUserId(userId);
+            result.setSuccess(true);
+            result.setResult(accountIdList);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.success(e.getMessage());
+        }
+        return result;
+    }
+
+
     /**
     /**
      * 分页列表查询
      * 分页列表查询
      *
      *

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java

@@ -1,7 +1,7 @@
 package org.jeecg.modules.ctop.job;
 package org.jeecg.modules.ctop.job;
 
 
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceCreativeDailyReportService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionContext;
@@ -18,7 +18,7 @@ import java.util.concurrent.Executors;
 @Slf4j
 @Slf4j
 public class ByteDanceCleanMaterialJob implements Job {
 public class ByteDanceCleanMaterialJob implements Job {
     @Autowired
     @Autowired
-    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+    private IBytedanceCreativeDailyReportService bytedanceCreativeDailyReportService;
     static ExecutorService executorService = null;
     static ExecutorService executorService = null;
 
 
     @Override
     @Override
@@ -26,7 +26,7 @@ public class ByteDanceCleanMaterialJob implements Job {
         Thread thread = new Thread() {
         Thread thread = new Thread() {
             @Override
             @Override
             public void run() {
             public void run() {
-                List<String> signatureList = byteDanceCleanMaterialReportService.getSignature();
+                List<String> signatureList = bytedanceCreativeDailyReportService.getSignatureList();
                 if (Check.isNull(signatureList)) {
                 if (Check.isNull(signatureList)) {
                     log.error("头条素材数据获取为空");
                     log.error("头条素材数据获取为空");
                     return;
                     return;
@@ -37,7 +37,7 @@ public class ByteDanceCleanMaterialJob implements Job {
                     executorService.submit(new Runnable() {
                     executorService.submit(new Runnable() {
                         @Override
                         @Override
                         public void run() {
                         public void run() {
-                            byteDanceCleanMaterialReportService.calculationMaterialReport(signature);
+                            bytedanceCreativeDailyReportService.calculationMaterialReport(signature);
                         }
                         }
                     });
                     });
                 }
                 }

+ 4 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml

@@ -112,7 +112,10 @@
     <select id="queryProjectMemberByUserId" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
     <select id="queryProjectMemberByUserId" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
         select
         distinct b.project_id as projectId,
         distinct b.project_id as projectId,
-        b.project_name as projectName,
+         (
+         select project_name  from ctop_project
+         where id = b.project_id
+        )as projectName,
         a.advertiser_id as advertiserId,
         a.advertiser_id as advertiserId,
         (
         (
         select name from ctop_advertiser where id = a.advertiser_id
         select name from ctop_advertiser where id = a.advertiser_id

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IImageReportDailyService.java

@@ -0,0 +1,11 @@
+package org.jeecg.modules.ctop.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IImageReportDailyService {
+    Map<String,Object> bytedanceImageCost(JSONObject data);
+
+    Map<String, Object> kuaishouImageCost(JSONObject data);
+}

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

@@ -0,0 +1,133 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
+import cn.com.ctop.common.module.entity.SysUser;
+import cn.com.ctop.common.module.service.IMaterialImageInfoService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO;
+import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.modules.ctop.service.IImageReportDailyService;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class ImageReportDailyServiceImpl implements IImageReportDailyService {
+
+    @Override
+    public Map<String,Object> bytedanceImageCost(JSONObject data) {
+        Map<String,Object>result = new HashMap<>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        Integer pageNumber = data.getInteger("pageNumber");
+        if(null == pageNumber||pageNumber ==0){
+            pageNumber = 1;
+        }
+        if(null == pageSize||pageSize ==0){
+            pageSize = 10;
+        }
+        PageHelper.startPage(pageNumber,pageSize);
+        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
+        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
+        if(null!=vos&&!vos.isEmpty()){
+            List<ImageCostVO>setVos = new ArrayList<>();
+            for(ImageCostVO vo:vos){
+                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
+                if(null!=imageInfo){
+                    vo.setUserId(imageInfo.getUserId());
+                    SysUser user = sysUserService.getById(imageInfo.getUserId());
+                    vo.setUserName(user.getUsername());
+                }else{
+                    vo.setUserName("-");
+                }
+                setVos.add(vo);
+            }
+            pageInfo.setList(setVos);
+        }
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> kuaishouImageCost(JSONObject data) {
+        Map<String,Object>result = new HashMap<>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        Integer pageNumber = data.getInteger("pageNumber");
+        if(null == pageNumber||pageNumber ==0){
+            pageNumber = 1;
+        }
+        if(null == pageSize||pageSize ==0){
+            pageSize = 10;
+        }
+        PageHelper.startPage(pageNumber,pageSize);
+        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
+        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
+        if(null!=vos&&!vos.isEmpty()){
+            List<ImageCostVO>setVos = new ArrayList<>();
+            for(ImageCostVO vo:vos){
+                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
+                if(null!=imageInfo){
+                    vo.setUserId(imageInfo.getUserId());
+                    SysUser user = sysUserService.getById(imageInfo.getUserId());
+                    vo.setUserName(user.getUsername());
+                }else{
+                    vo.setUserName("-");
+                }
+                setVos.add(vo);
+            }
+            pageInfo.setList(setVos);
+        }
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    private IMaterialImageInfoService imageInfoService;
+    @Autowired
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+}

+ 4 - 4
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -126,8 +126,8 @@ mybatis-plus:
       id-type: 4
       id-type: 4
       # 默认数据库表下划线命名
       # 默认数据库表下划线命名
       table-underline: true
       table-underline: true
-#  configuration:
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 #jeecg专用配置
 #jeecg专用配置
 jeecg:
 jeecg:
   elasticsearch:
   elasticsearch:
@@ -162,8 +162,8 @@ jeecg:
     chrome-driver: D://chromedriver.exe
     chrome-driver: D://chromedriver.exe
     csv-upload: /mnt/upload/csv/
     csv-upload: /mnt/upload/csv/
     bak-database-file: /mnt/data/bak/
     bak-database-file: /mnt/data/bak/
-    report-history: /mnt/upload/report/history/
-    report-daily: /mnt/upload/report/daily/
+    report-history: D://mnt//reportKs//
+    report-daily: D://mnt//reportKs//
 kuaishou:
 kuaishou:
   group-control:
   group-control:
     path: http://39.106.184.70
     path: http://39.106.184.70

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,8 +1,8 @@
 #mysql
 #mysql
 diver_name=com.mysql.jdbc.Driver
 diver_name=com.mysql.jdbc.Driver
-url=jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
-username=root
-password=123456
+url=jdbc:mysql://139.186.27.96:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
+username=hcst
+password=test@20190531
 database_name=jeecg-boot
 database_name=jeecg-boot
 #oracle
 #oracle
 #diver_name=oracle.jdbc.driver.OracleDriver
 #diver_name=oracle.jdbc.driver.OracleDriver

+ 46 - 27
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -15,7 +15,6 @@ import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
-import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -49,18 +48,21 @@ public class SampleTest {
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
     @Autowired
     @Autowired
     private IMaterialImageInfoService imageInfoService;
     private IMaterialImageInfoService imageInfoService;
-    @Autowired
-    private IWechatCheckinDataService wechatCheckinDataService;
-
     @Test
     @Test
-    public void loadBytedanceMatData() {
-        wechatCheckinDataService.getCheckinData();
+    public void loadBytedanceMatData(){
+        executorService = Executors.newFixedThreadPool(5);
+        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+        for (CtopOauthToken token:tokens) {
+            reportService.getAdvertiserPlanReport(token,new Date(),new Date(),CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+        }
     }
     }
 
 
     @Test
     @Test
-    public void initImageCode() {
-        List<MaterialImageInfo> imageInfos = imageInfoService.list();
-        for (MaterialImageInfo image : imageInfos) {
+    public void initImageCode(){
+        QueryWrapper<MaterialImageInfo>queryWrapper = new QueryWrapper<>();
+        queryWrapper.le("update_time","2020-09-23 18:35:00");
+        List<MaterialImageInfo> imageInfos = imageInfoService.list(queryWrapper);
+        for (MaterialImageInfo image:imageInfos) {
             imageInfoService.initImageCode(image);
             imageInfoService.initImageCode(image);
         }
         }
     }
     }
@@ -71,10 +73,10 @@ public class SampleTest {
         QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
         QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("media_id", 2);
         queryWrapper.eq("media_id", 2);
         List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
         List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
-        for (CtopOauthToken token : list) {
-            kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-20", "2020-09-20", "daily");
+         for (CtopOauthToken token : list) {
+        kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-20", "2020-09-20", "daily");
 
 
-        }
+         }
 
 
     }
     }
 
 
@@ -153,18 +155,18 @@ public class SampleTest {
     @Test
     @Test
     public void loadKuaishouAgentData() {
     public void loadKuaishouAgentData() {
         kuaishouReportDailyAgentService.loginAgent();
         kuaishouReportDailyAgentService.loginAgent();
-        for (int i = 0; i < 20; i++) {
-            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
-            kuaishouReportDailyAgentService.getReport(currentDate, DateUtils.getNowDate("yyyy-MM-dd"));
-        }
-//
-//        try {
-//            for (int i = 1; i < 30; i++) {
-//                kuaishouReportDailyAgentService.getAccount(i);
-//            }
-//        } catch (Exception e) {
-//            e.printStackTrace();
+//        for (int i = 0; i < 20; i++) {
+//            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+//            kuaishouReportDailyAgentService.getReport(currentDate, DateUtils.getNowDate("yyyy-MM-dd"));
 //        }
 //        }
+//
+        try {
+            for (int i = 1; i < 30; i++) {
+                kuaishouReportDailyAgentService.getAccount(i);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
     }
 
 
     @Autowired
     @Autowired
@@ -189,14 +191,31 @@ public class SampleTest {
     }
     }
 
 
     @Test
     @Test
-    public void testBytedanceVideoReport() {
+    public void testBytedanceVideoReport(){
         List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
         List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
-        for (int i = 2; i < 100; i++) {
-            String date = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
-            for (CtopOauthToken token : tokens) {
+        for(int i=2;i<100;i++){
+            String date = DateUtils.formatDate(DateUtils.addDay(new Date(),-i));
+            for (CtopOauthToken token:tokens) {
 //                bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
 //                bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
             }
             }
         }
         }
     }
     }
 
 
+    @Test
+    public void loadKuaishouReportData() {
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("media_id", 2);
+        List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
+        for (CtopOauthToken token : list) {
+            kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-17", "2020-09-19", "history");
+            kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-20", "2020-09-20", "daily");
+        }
+    }
+
+    @Autowired
+    private IKuaiShouHistoryReportTaskService historyReportTaskService;
+    @Test
+    public void loadHistoryJob(){
+        historyReportTaskService.getTaskList();
+    }
 }
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceCleanMaterialReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.report.entity;
+package cn.com.ctop.common.module.entity;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouCleanMaterialReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.kuaishou.modules.report.entity;
+package cn.com.ctop.common.module.entity;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceCleanMaterialReportMapper.java

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

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaiShouCleanMaterialReportMapper.java

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

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java

@@ -34,4 +34,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
     Long getProjectIdByAccountId(@Param("accountId") Long accountId);
     Long getProjectIdByAccountId(@Param("accountId") Long accountId);
 
 
     List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
     List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
+
+    List<MaterialInfo> getListByParams(@Param("tagCode")String tagCode,@Param("type")String type, @Param("status")Integer status, @Param("projectIds")List<Long> projectIds, @Param("materialName")String materialName, @Param("code")String code, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
 }
 }

+ 7 - 2
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -14,8 +14,13 @@ import java.util.List;
  * @Version: V1.0
  * @Version: V1.0
  */
  */
 public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
-    List<UserAllocation> selectAccountListByProjectId(@Param("projectId")Long projectId);
-    String queryAdvertiserId(@Param("accountId")Long accountId);
+    List<UserAllocation> selectAccountListByProjectId(@Param("projectId") Long projectId);
+
+    String queryAdvertiserId(@Param("accountId") Long accountId);
 
 
     List<JSONObject> getAccountListByProject(@Param("projectId") Long projectId);
     List<JSONObject> getAccountListByProject(@Param("projectId") Long projectId);
+
+    List<JSONObject> getUserIdListByProjectId(@Param("projectId") Long projectId);
+
+    List<JSONObject> getAccountIdListByUserId(@Param("userId") Long userId);
 }
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceCleanMaterialReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.modules.report.mapper.ByteDanceCleanMaterialReportMapper">
+<mapper namespace="cn.com.ctop.common.module.mapper.ByteDanceCleanMaterialReportMapper">
 
 
 </mapper>
 </mapper>

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouCleanMaterialReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouCleanMaterialReportMapper">
+<mapper namespace="cn.com.ctop.common.module.mapper.KuaiShouCleanMaterialReportMapper">
 
 
 </mapper>
 </mapper>

+ 35 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -113,6 +113,41 @@
         limit 1
         limit 1
     </select>
     </select>
 
 
+    <select id="getListByParams" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
+        select
+        distinct matInfo.code,
+        matInfo.project_id,
+        matInfo.id
+        from ctop_material_info matInfo
+        left join ctop_material_tag_info tagInfo on tagInfo.code = matInfo.code
+        where 1=1
+        <if test="tagCode!=null">
+            and tagInfo.tag_code like concat(#{tagCode},'%')
+        </if>
+        <if test="status!=null">
+            and matInfo.status = #{status}
+        </if>
+        <if test="userId!=null">
+            and matInfo.user_id = #{userId}
+        </if>
+        <if test="materialName!=null">
+            and matInfo.material_name like concat('%',#{materialName},'%')
+        </if>
+        <if test="projectIds!=null">
+            and matInfo.project_id in
+            <foreach item="item" index="index" collection="projectIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startDate!=null">
+            and matInfo.create_time &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and matInfo.create_time &lt;= #{endDate}
+        </if>
+        order by matInfo.create_time desc
+
+    </select>
     <select id="getListByDate" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
     <select id="getListByDate" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
         select  *  from
         select  *  from
         ctop_material_info
         ctop_material_info

+ 26 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -31,4 +31,30 @@
        where project_id = #{projectId}
        where project_id = #{projectId}
        order by create_time desc
        order by create_time desc
     </select>
     </select>
+
+    <select id="getUserIdListByProjectId" resultType="com.alibaba.fastjson.JSONObject">
+   SELECT t1.user_id as 'userId',
+    t1.account_id as 'accountId',
+    t1.user_name  as 'userName'
+    from  ctop_kuaishou_advertiser_base_info t1  LEFT JOIN
+    ctop_user_allocation  t2
+    ON t1.account_id = t2.account_id
+    WHERE t2.project_id = #{projectId}
+    GROUP BY t1.user_id;
+    </select>
+
+
+    <select id="getAccountIdListByUserId" resultType="com.alibaba.fastjson.JSONObject">
+    SELECT
+    t1.account_id as 'accountId',
+    t1.auth_name  as 'authName',
+    t1.user_name as 'userName'
+    from ctop_user_allocation   t1  LEFT JOIN
+    ctop_kuaishou_advertiser_base_info t2
+    ON t1.account_id = t2.account_id
+    WHERE t2.user_id = #{userId}
+    AND t1.account_status = 0
+    </select>
+
+
 </mapper>
 </mapper>

+ 2 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IByteDanceCleanMaterialReportService.java

@@ -1,10 +1,8 @@
-package cn.com.ctop.toutiao.modules.report.service;
+package cn.com.ctop.common.module.service;
 
 
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
-import java.util.List;
-
 /**
 /**
  * 头条-数据清洗
  * 头条-数据清洗
  *
  *
@@ -14,8 +12,5 @@ import java.util.List;
  */
  */
 public interface IByteDanceCleanMaterialReportService extends IService<ByteDanceCleanMaterialReport> {
 public interface IByteDanceCleanMaterialReportService extends IService<ByteDanceCleanMaterialReport> {
 
 
-    List<String> getSignature();
-
-
     void calculationMaterialReport(String signature);
     void calculationMaterialReport(String signature);
 }
 }

+ 15 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IKuaiShouCleanMaterialReportService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 快手素材清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-24
+ */
+public interface IKuaiShouCleanMaterialReportService extends IService<KuaiShouCleanMaterialReport> {
+
+}

+ 2 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialImageInfoService.java

@@ -15,7 +15,6 @@ import java.util.Map;
  * @date 2020-03-16
  * @date 2020-03-16
  */
  */
 public interface IMaterialImageInfoService extends IService<MaterialImageInfo> {
 public interface IMaterialImageInfoService extends IService<MaterialImageInfo> {
-
     /**
     /**
      * 根据视频id  关联封面
      * 根据视频id  关联封面
      */
      */
@@ -23,10 +22,11 @@ public interface IMaterialImageInfoService extends IService<MaterialImageInfo> {
 
 
     Map<String, Object> checkMaterialInfo(String code, String videoId);
     Map<String, Object> checkMaterialInfo(String code, String videoId);
 
 
-
     List<String> getCodeList();
     List<String> getCodeList();
 
 
     List<JSONObject> getUrlList(String videoId);
     List<JSONObject> getUrlList(String videoId);
 
 
     void initImageCode(MaterialImageInfo image);
     void initImageCode(MaterialImageInfo image);
+
+    MaterialImageInfo getByCode(String signature);
 }
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -73,4 +73,6 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
     List<String> getEffiCode();
     List<String> getEffiCode();
 
 
     List<MaterialInfo> getListByDate(String startDate, String endDate);
     List<MaterialInfo> getListByDate(String startDate, String endDate);
+
+    Map<String,Object> getListByParams(String tagCode,String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize);
 }
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialTagInfoService.java

@@ -17,4 +17,6 @@ public interface IMaterialTagInfoService extends IService<MaterialTagInfo> {
     Map<String, Object> mark(JSONObject data, LoginUser loginUser);
     Map<String, Object> mark(JSONObject data, LoginUser loginUser);
 
 
     Map<String, Object> getTagDetail(MaterialTagInfo materialTagInfo);
     Map<String, Object> getTagDetail(MaterialTagInfo materialTagInfo);
+
+    void deleteByCode(String code);
 }
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -28,4 +28,8 @@ public interface IUserAllocationService extends IService<UserAllocation> {
     String getAdvertiserIdByAccountId(Long accountId);
     String getAdvertiserIdByAccountId(Long accountId);
 
 
     List<JSONObject> getAccountListByProject(Long projectId);
     List<JSONObject> getAccountListByProject(Long projectId);
+
+    List<JSONObject> getUserIdListByProjectId(Long projectId);
+
+    List<JSONObject> getAccountIdListByUserId(Long userId);
 }
 }

+ 26 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ByteDanceCleanMaterialReportServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.mapper.ByteDanceCleanMaterialReportMapper;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+/**
+ * 头条-数据清洗
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-25
+ */
+@Service
+@Primary
+
+public class ByteDanceCleanMaterialReportServiceImpl extends ServiceImpl<ByteDanceCleanMaterialReportMapper, ByteDanceCleanMaterialReport> implements IByteDanceCleanMaterialReportService {
+
+    @Override
+    public void calculationMaterialReport(String signature) {
+
+    }
+}

+ 18 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouCleanMaterialReportServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.mapper.KuaiShouCleanMaterialReportMapper;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手素材清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-24
+ */
+@Service
+public class KuaiShouCleanMaterialReportServiceImpl extends ServiceImpl<KuaiShouCleanMaterialReportMapper, KuaiShouCleanMaterialReport> implements IKuaiShouCleanMaterialReportService {
+}

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java

@@ -143,4 +143,12 @@ public class MaterialImageInfoServiceImpl extends ServiceImpl<MaterialImageInfoM
         }
         }
     }
     }
 
 
+    @Override
+    public MaterialImageInfo getByCode(String signature) {
+        QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("code",signature);
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
 }
 }

+ 70 - 15
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.tencentcloudapi.mps.v20190612.models.DescribeTaskDetailResponse;
 import com.tencentcloudapi.mps.v20190612.models.DescribeTaskDetailResponse;
 import it.sauronsoftware.jave.Encoder;
 import it.sauronsoftware.jave.Encoder;
 import it.sauronsoftware.jave.EncoderException;
 import it.sauronsoftware.jave.EncoderException;
@@ -408,7 +410,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                         String height = String.valueOf(m.getVideo().getSize().getHeight());
                         String height = String.valueOf(m.getVideo().getSize().getHeight());
                         materialParameter.setHeight(height);
                         materialParameter.setHeight(height);
 
 
-
                         fis = new FileInputStream(file);
                         fis = new FileInputStream(file);
                         FileChannel fc = fis.getChannel();
                         FileChannel fc = fis.getChannel();
                         BigDecimal fileSize = new BigDecimal(fc.size());
                         BigDecimal fileSize = new BigDecimal(fc.size());
@@ -517,7 +518,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             MaterialInfo info = new MaterialInfo();
             MaterialInfo info = new MaterialInfo();
             Long projectId = json.getLong("projectId");
             Long projectId = json.getLong("projectId");
             String code = json.getString("code");
             String code = json.getString("code");
-           // info.setId(code + projectId);
+            info.setId(code + "_" + projectId);
             info.setCode(code);
             info.setCode(code);
             if (!Check.isNull(json.getString("watermarkUrl"))) {
             if (!Check.isNull(json.getString("watermarkUrl"))) {
                 info.setWatermarkUrl(json.getString("watermarkUrl"));
                 info.setWatermarkUrl(json.getString("watermarkUrl"));
@@ -546,13 +547,15 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                 String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
                 String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
                 info.setCoverUrl(coverUrl);
                 info.setCoverUrl(coverUrl);
                 Thread thread = new Thread() {
                 Thread thread = new Thread() {
-                        @Override
-                        public void run() { try {
+                    @Override
+                    public void run() {
+                        try {
                             log.info("开始抽帧,code:{}", code);
                             log.info("开始抽帧,code:{}", code);
                             materialCutFrameService.getTencentCutFrame(videoUrl, code, coverUrl);
                             materialCutFrameService.getTencentCutFrame(videoUrl, code, coverUrl);
                         } catch (Exception e) {
                         } catch (Exception e) {
                             e.printStackTrace();
                             e.printStackTrace();
-                        } }
+                        }
+                    }
                 };
                 };
                 thread.start();
                 thread.start();
             } else {
             } else {
@@ -584,15 +587,15 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                     log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
                     log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
                 }
                 }
             }
             }
-
+            materialTagInfoService.deleteByCode(code);
             JSONArray modalityTagList = json.getJSONArray("modalityTagList");
             JSONArray modalityTagList = json.getJSONArray("modalityTagList");
-            insertTagList(code,userId,modalityTagList);
+            insertTagList(code, userId, modalityTagList);
             JSONArray contentTagList = json.getJSONArray("contentTagList");
             JSONArray contentTagList = json.getJSONArray("contentTagList");
-            insertTagList(code,userId,contentTagList);
+            insertTagList(code, userId, contentTagList);
             JSONArray senceTagList = json.getJSONArray("senceTagList");
             JSONArray senceTagList = json.getJSONArray("senceTagList");
-            insertTagList(code,userId,senceTagList);
+            insertTagList(code, userId, senceTagList);
             JSONArray modTagList = json.getJSONArray("modTagList");
             JSONArray modTagList = json.getJSONArray("modTagList");
-            insertTagList(code,userId,modTagList);
+            insertTagList(code, userId, modTagList);
             getFile(info, project.getMediaId());
             getFile(info, project.getMediaId());
             ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
             ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         } catch (Exception e) {
         } catch (Exception e) {
@@ -602,17 +605,18 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         return resultMap;
         return resultMap;
     }
     }
 
 
-    private void insertTagList(String code,String userId,JSONArray tagList){
-        if(null!=tagList&&!tagList.isEmpty()){
-            for(int m=0;m<tagList.size();m++){
+    private void insertTagList(String code, String userId, JSONArray tagList) {
+        if (null != tagList && !tagList.isEmpty()) {
+            for (int m = 0; m < tagList.size(); m++) {
                 Long tagId = tagList.getLong(m);
                 Long tagId = tagList.getLong(m);
                 TagInfo tagInfo = tagInfoService.getById(tagId);
                 TagInfo tagInfo = tagInfoService.getById(tagId);
-                MaterialTagInfo setTag= new MaterialTagInfo(code,tagInfo,userId);
+                MaterialTagInfo setTag = new MaterialTagInfo(code, tagInfo, userId);
                 setTag.setCategoryId(tagInfo.getTagCategoryId());
                 setTag.setCategoryId(tagInfo.getTagCategoryId());
                 materialTagInfoService.save(setTag);
                 materialTagInfoService.save(setTag);
             }
             }
         }
         }
     }
     }
+
     @Autowired
     @Autowired
     private ITagInfoService tagInfoService;
     private ITagInfoService tagInfoService;
     @Autowired
     @Autowired
@@ -644,7 +648,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         List<String> effiSignatureList = materialInfoMapper.getEffiSignature();
         List<String> effiSignatureList = materialInfoMapper.getEffiSignature();
         for (String code : effiSignatureList) {
         for (String code : effiSignatureList) {
             MaterialInfo materialInfo = materialInfoMapper.getMaterialInfoByCode(code);
             MaterialInfo materialInfo = materialInfoMapper.getMaterialInfoByCode(code);
-
             if (materialInfo == null) {
             if (materialInfo == null) {
                 continue;
                 continue;
             }
             }
@@ -672,6 +675,58 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public List<MaterialInfo> getListByDate(String startDate, String endDate) {
     public List<MaterialInfo> getListByDate(String startDate, String endDate) {
         return materialInfoMapper.getListByDate(startDate, endDate);
         return materialInfoMapper.getListByDate(startDate, endDate);
     }
     }
+
+    @Override
+    public Map<String,Object> getListByParams(String tagCode,String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
+        Map<String,Object> result = new HashMap<>();
+        PageHelper.startPage(pageNo,pageSize);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate, userId);
+        List<MaterialInfo> setList = new ArrayList<>();
+        PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
+        if(null!=dailyList&&!dailyList.isEmpty()){
+            for(MaterialInfo info:dailyList){
+                MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
+                //判断是否已经同步到快手平台
+                Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
+                if (kuaishouMaterialUpCount > 0) {
+                    materialInfo.setKuaishouVideoIsUp(1);
+                } else {
+                    materialInfo.setKuaishouVideoIsUp(0);
+                }
+                //判断是否已经同步到抖音平台
+                Integer toutiaoMaterialUpCount = this.getToutiaoUpVideoCount(info.getCode());
+                if (toutiaoMaterialUpCount > 0) {
+                    materialInfo.setToutiaoVideoIsUp(1);
+                } else {
+                    materialInfo.setToutiaoVideoIsUp(0);
+                }
+
+                //TODO 消耗统计
+
+                Project project = projectService.getById(info.getProjectId());
+                if (!Check.isNull(project)) {
+                    materialInfo.setMediaId(project.getMediaId());
+                    materialInfo.setProjectName(project.getProjectName());
+                }
+
+                QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
+                imageInfoQueryWrapper.eq("video_id", info.getCode());
+                imageInfoQueryWrapper.eq("status", 0);
+                List<MaterialImageInfo> imageInfoList = materialImageInfoService.list(imageInfoQueryWrapper);
+                if (Check.isNull(imageInfoList)) {
+                    materialInfo.setWhetherUnaudited(false);
+                } else {
+                    materialInfo.setWhetherUnaudited(true);
+                }
+
+                setList.add(materialInfo);
+            }
+        }
+        pageInfo.setList(setList);
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }
 }
 
 
 
 

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

@@ -96,7 +96,8 @@ public class MaterialTagInfoServiceImpl extends ServiceImpl<MaterialTagInfoMappe
         return this.list(queryWrapper);
         return this.list(queryWrapper);
     }
     }
 
 
-    private void deleteByCode(String code) {
+    @Override
+    public void deleteByCode(String code) {
         UpdateWrapper<MaterialTagInfo>updateWrapper = new UpdateWrapper<>();
         UpdateWrapper<MaterialTagInfo>updateWrapper = new UpdateWrapper<>();
         updateWrapper.eq("code",code).set("status",0).set("update_time",new Date());
         updateWrapper.eq("code",code).set("status",0).set("update_time",new Date());
         this.update(updateWrapper);
         this.update(updateWrapper);

+ 16 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -103,4 +103,20 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     public List<JSONObject> getAccountListByProject(Long projectId) {
     public List<JSONObject> getAccountListByProject(Long projectId) {
         return userAllocationMapper.getAccountListByProject(projectId);
         return userAllocationMapper.getAccountListByProject(projectId);
     }
     }
+
+    /**
+     * 获取项目下的所有userId
+     *
+     * @param projectId
+     * @return
+     */
+    @Override
+    public List<JSONObject> getUserIdListByProjectId(Long projectId) {
+        return userAllocationMapper.getUserIdListByProjectId(projectId);
+    }
+
+    @Override
+    public List<JSONObject> getAccountIdListByUserId(Long userId) {
+        return userAllocationMapper.getAccountIdListByUserId(userId);
+    }
 }
 }

+ 99 - 34
module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java

@@ -1,8 +1,18 @@
 package cn.com.ctop.common.module.utils;
 package cn.com.ctop.common.module.utils;
 
 
 
 
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.*;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
+import org.apache.poi.xssf.usermodel.XSSFFont;
+import org.apache.poi.xssf.usermodel.XSSFRichTextString;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
@@ -92,8 +102,94 @@ public class ExportExcelUtils {
         }
         }
     }
     }
 
 
+
+    public void exportExcelForAttendance(XSSFWorkbook workbook, int sheetNum, String sheetTitle, String[] headers, List<List<Object>> result) {
+        // 生成一个表格
+        XSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        XSSFCellStyle style = workbook.createCellStyle();
+        XSSFCellStyle style2 = workbook.createCellStyle();
+        XSSFCellStyle style3 = workbook.createCellStyle();
+        // 设置这些样式
+        style.setFillForegroundColor(IndexedColors.PALE_BLUE.index);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style.setBorderBottom(BorderStyle.THIN);
+        style.setBorderLeft(BorderStyle.THIN);
+        style.setBorderRight(BorderStyle.THIN);
+        style.setBorderTop(BorderStyle.THIN);
+        // style.setAlignment(HorizontalAlignment.CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
+        // 生成一个字体
+        XSSFFont font = workbook.createFont();
+        font.setColor(IndexedColors.BLACK.index);
+        font.setFontHeightInPoints((short) 12);
+        font.setBold(true);
+        // 把字体应用到当前的样式
+        style.setFont(font);
+
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+        //迟到时间超过15分钟的考勤记录样式(标黄)
+        style2.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.index);
+        style2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style2.setBorderBottom(BorderStyle.THIN);
+        style2.setBorderLeft(BorderStyle.THIN);
+        style2.setBorderRight(BorderStyle.THIN);
+        style2.setBorderTop(BorderStyle.THIN);
+        // 产生表格标题行
+        XSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            XSSFCell cell = row.createCell((short) i);
+            cell.setCellStyle(style);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<Object> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+                //迟到时间超过15分钟的考勤记录判断
+                boolean changeColor = false;
+                if (m.contains("迟到")) {
+                    String duration = String.valueOf(m.get(m.size() - 2));
+                    if (!Check.isNull(duration) && Integer.valueOf(duration.replace(" min", "")) - 15 > 0) {
+                        changeColor = true;
+                    }
+                }
+                for (Object obj : m) {
+                    XSSFCell cell = row.createCell((short) cellIndex);
+                    if (!Check.isNull(obj)) {
+                        if (changeColor) {
+                            cell.setCellStyle(style2);
+                        }
+                        if (obj instanceof String) {
+                            cell.setCellValue((String) obj);
+                        } else if (obj instanceof Double) {
+                            cell.setCellValue((Double) obj);
+                        } else if (obj instanceof BigDecimal) {
+                            BigDecimal bigDecimal = (BigDecimal) obj;
+                            cell.setCellValue(bigDecimal.doubleValue());
+                        } else if (obj instanceof Long) {
+                            cell.setCellValue(String.valueOf(obj));
+                        } else {
+                            cell.setCellValue(obj.toString());
+                        }
+                    }
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
+
     public void exportExcelForMediaReport(XSSFWorkbook workbook, int sheetNum,
     public void exportExcelForMediaReport(XSSFWorkbook workbook, int sheetNum,
-                            String sheetTitle, String[] headers, List<List<Object>> result) {
+                                          String sheetTitle, String[] headers, List<List<Object>> result) {
         // 生成一个表格
         // 生成一个表格
         XSSFSheet sheet = workbook.createSheet();
         XSSFSheet sheet = workbook.createSheet();
         workbook.setSheetName(sheetNum, sheetTitle);
         workbook.setSheetName(sheetNum, sheetTitle);
@@ -180,35 +276,4 @@ public class ExportExcelUtils {
     }
     }
 
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 }
 }

+ 52 - 0
module-common/src/main/java/com/xxl/job/core/enums/NoEn.java

@@ -0,0 +1,52 @@
+package com.xxl.job.core.enums;
+
+/**
+ * 项目中0~25数字字符串枚举
+ *
+ * @ClassName GeneralConstant
+ * @Author ZHAOXA
+ * @date 2020-09-29 10:33
+ */
+public enum NoEn {
+    NO0("0", 0),
+    NO1("1", 1),
+    NO2("2", 2),
+    NO3("3", 3),
+    NO4("4", 4),
+    NO5("5", 5),
+    NO6("6", 6),
+    NO7("7", 7),
+    NO8("8", 8),
+    NO9("9", 9),
+    NO10("10", 10),
+    NO11("11", 11),
+    NO12("12", 12),
+    NO13("13", 13),
+    NO14("14", 14),
+    NO15("15", 15),
+    NO16("16", 16),
+    NO17("17", 17),
+    NO18("18", 18),
+    NO19("19", 19),
+    NO20("20", 20),
+    NO21("21", 21),
+    NO22("22", 21),
+    NO23("23", 23),
+    NO24("24", 24),
+    NO25("25", 25);
+    private final String strValue;
+    private final int intValue;
+
+    private NoEn(String strValue, int intValue) {
+        this.strValue = strValue;
+        this.intValue = intValue;
+    }
+
+    public String valueStr() {
+        return strValue;
+    }
+
+    public int valueInt() {
+        return intValue;
+    }
+}

+ 12 - 0
module-job-bytedance/pom.xml

@@ -79,6 +79,12 @@
             <scope>compile</scope>
             <scope>compile</scope>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-oa</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>
             <version>3.5.0</version>
@@ -139,6 +145,12 @@
             <artifactId>module-check</artifactId>
             <artifactId>module-check</artifactId>
             <version>2.0.2</version>
             <version>2.0.2</version>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-oa</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
     <dependencyManagement>
     <dependencyManagement>

+ 0 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.job.bytedance.handler;
 package cn.com.ctop.job.bytedance.handler;
 
 
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;
 import com.xxl.job.core.log.XxlJobLogger;

+ 45 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/WechatApproveAttendanceJob.java

@@ -0,0 +1,45 @@
+package cn.com.ctop.job.bytedance.handler;
+
+
+import cn.com.ctop.oa.modules.service.IWechatNoListService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 异常考勤审批数据入库
+ *
+ * @param
+ * @author ZHAOXA
+ * @return
+ * @throws
+ */
+@Component
+public class WechatApproveAttendanceJob {
+    @Autowired
+    private IWechatNoListService wechatNoListService;
+
+    /**
+     * 异常考勤审批数据入库
+     * 频率:每月2日凌晨2点同步审批数据 cron:0 0 2 2 * ?
+     * 审批状态表
+     * starttime 统计开始时间,上个月1号零时零分的时间 例:2020-08-01 00:00:00;
+     * endtime 统计结束时间,本月1号零时零分的时间 例:2020-09-01 00:00:00;
+     *
+     * @author ZHAOXA
+     */
+    @XxlJob("wechatApproveAttendanceJob")
+    public ReturnT<String> execute() throws Exception {
+        XxlJobLogger.log("--------异常考勤审批数据入库 start ");
+        String initMonth = DateUtils.initDateByMonth();
+        long starttime = DateUtils.timeToStamp(DateUtils.getMonthBefore(DateUtils.NEW_FORMAT, initMonth, -1));
+        long endtime = DateUtils.timeToStamp(initMonth);
+        //更新审批状态表
+        wechatNoListService.getNoDateByNo(String.valueOf(starttime), String.valueOf(endtime));
+        XxlJobLogger.log("--------异常考勤审批数据入库 end ");
+        return ReturnT.SUCCESS;
+    }
+}

+ 43 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/WechatAttendanceJob.java

@@ -0,0 +1,43 @@
+package cn.com.ctop.job.bytedance.handler;
+
+
+import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
+import cn.com.ctop.oa.modules.service.IWechatUserListService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Component
+public class WechatAttendanceJob {
+    @Autowired
+    private IWechatCheckinDataService wechatCheckinDataService;
+    @Autowired
+    private IWechatUserListService wechatUserInfoService;
+
+    /**
+     * 考勤数据入库
+     * 员工打卡明细表 每日凌晨2点统计前一天的考勤数据 cron:0 0 2 * * ?
+     * <p>
+     * 人员信息表 每日凌晨2点统计前一天的人员数据 cron:0 0 2 * * ?
+     *
+     * @author ZHAOXA
+     */
+    @XxlJob("wechatAttendanceJob")
+    public ReturnT<String> execute(String params) throws Exception {
+        XxlJobLogger.log("--------考勤数据入库 start ");
+        String beforeDay = DateUtils.getLastDay(DateUtils.formatDate(new Date()));
+        long starttime = DateUtils.timeToStamp(beforeDay + " 00:00:00");
+        long endtime = DateUtils.timeToStamp(beforeDay + " 23:59:59");
+        //更新员工打卡明细表
+        wechatCheckinDataService.getCheckinData(String.valueOf(starttime), String.valueOf(endtime));
+        //更新人员信息表
+        wechatUserInfoService.getUserList();
+        XxlJobLogger.log("--------考勤数据入库 end ");
+        return ReturnT.SUCCESS;
+    }
+}

+ 0 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.job.kuaishou.handler;
 package cn.com.ctop.job.kuaishou.handler;
 
 
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;
 import com.xxl.job.core.log.XxlJobLogger;

+ 99 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouRealTimeController.java

@@ -0,0 +1,99 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouRealTimeDataService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description: 广告组-app信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-23
+ * @Version: V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/kuaishou/realTime")
+public class KuaiShouRealTimeController {
+    @Autowired
+    private IKuaishouRealTimeDataService realTimeDataService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
+
+    @PostMapping(value = "/getCampaignDate")
+    public Result<JSONArray> getCampaignDate(@RequestBody JSONObject requestJson) {
+        Result<JSONArray> result = new Result<>();
+        try {
+            Long accountId = requestJson.getLong("accountId");
+            if (Check.isNull(accountId)) {
+                throw new Exception("请传入账户id");
+            }
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+            Long campaignId = requestJson.getLong("campaignId");
+            if (Check.isNull(campaignId)) {
+                throw new Exception("请传入计划id");
+            }
+            String startDate = requestJson.getString("startDate");
+            String endDate = requestJson.getString("endDate");
+            if (Check.isNull(startDate) || Check.isNull(endDate)) {
+                throw new Exception("请选择开始、结束查询时间");
+            }
+            JSONArray campaignDate = realTimeDataService.getCampaignDate(accountId, oauthToken.getAccessToken(), campaignId, startDate, endDate);
+            result.setSuccess(true);
+            result.setResult(campaignDate);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    @PostMapping(value = "/getUnitDate")
+    public Result<JSONArray> getUnitDate(@RequestBody JSONObject requestJson) {
+        Result<JSONArray> result = new Result<>();
+        try {
+            Long accountId = requestJson.getLong("accountId");
+            if (Check.isNull(accountId)) {
+                throw new Exception("请传入账户id");
+            }
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+            Long unitId = requestJson.getLong("unitId");
+            if (Check.isNull(unitId)) {
+                throw new Exception("请传入组id");
+            }
+            String startDate = requestJson.getString("startDate");
+            String endDate = requestJson.getString("endDate");
+            if (Check.isNull(startDate) || Check.isNull(endDate)) {
+                throw new Exception("请选择开始、结束查询时间");
+            }
+            JSONArray unitData = realTimeDataService.getUnitDate(accountId, oauthToken.getAccessToken(), unitId, startDate, endDate);
+            result.setSuccess(true);
+            result.setResult(unitData);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+}

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

@@ -0,0 +1,9 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import com.alibaba.fastjson.JSONArray;
+
+public interface IKuaishouRealTimeDataService {
+    JSONArray getCampaignDate(Long accountId, String token, Long campaignId, String startDate, String endDate);
+
+    JSONArray getUnitDate(Long accountId, String token, Long unitId, String startDate, String endDate);
+}

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java

@@ -154,7 +154,7 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
 
 
                     };
                     };
                     thread.start();
                     thread.start();
-
+                }else if(task.getViewType() == 7){
 
 
                 }
                 }
             }
             }

+ 17 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java

@@ -12,10 +12,7 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskServ
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
 import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -159,6 +156,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     public void getTaskList() {
     public void getTaskList() {
         log.info("开始历史数据文件检查下载");
         log.info("开始历史数据文件检查下载");
         QueryWrapper<KuaiShouHistoryReportTask> taskQueryWrapper = new QueryWrapper<>();
         QueryWrapper<KuaiShouHistoryReportTask> taskQueryWrapper = new QueryWrapper<>();
+        taskQueryWrapper.eq("view_type",7);
         taskQueryWrapper.eq("task_status", 0);
         taskQueryWrapper.eq("task_status", 0);
         taskQueryWrapper.orderByDesc("create_time");
         taskQueryWrapper.orderByDesc("create_time");
         List<KuaiShouHistoryReportTask> taskList = this.list(taskQueryWrapper);
         List<KuaiShouHistoryReportTask> taskList = this.list(taskQueryWrapper);
@@ -251,6 +249,9 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
 
                     };
                     };
                     thread.start();
                     thread.start();
+                }else if (task.getViewType() == 7){
+                    //封面报表
+                    kuaishouReportDailyImageMapper.loadImageDailyReport(task.getAccountId(),localPath);
                 }
                 }
 
 
 
 
@@ -265,27 +266,32 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
 
     }
     }
 
 
+    @Autowired
+    private KuaishouReportDailyImageMapper kuaishouReportDailyImageMapper;
+
 
 
     private void getHistoryTypeList() {
     private void getHistoryTypeList() {
 
 
         historyTypeList = new ArrayList<>();
         historyTypeList = new ArrayList<>();
-        historyTypeList.add(5);
+       /* historyTypeList.add(5);
         historyTypeList.add(1);
         historyTypeList.add(1);
         historyTypeList.add(2);
         historyTypeList.add(2);
         historyTypeList.add(3);
         historyTypeList.add(3);
         historyTypeList.add(10);
         historyTypeList.add(10);
-        historyTypeList.add(4);
+        historyTypeList.add(4);*/
+        historyTypeList.add(7);
 
 
 
 
     }
     }
 
 
     private void getDailyTypeList() {
     private void getDailyTypeList() {
         dailyTypeList = new ArrayList<>();
         dailyTypeList = new ArrayList<>();
-        dailyTypeList.add(2);
-        dailyTypeList.add(3);
-        dailyTypeList.add(4);
-        dailyTypeList.add(5);
-        dailyTypeList.add(10);
+//        dailyTypeList.add(2);
+//        dailyTypeList.add(3);
+//        dailyTypeList.add(4);
+//        dailyTypeList.add(5);
+//        dailyTypeList.add(10);
+        historyTypeList.add(7);
     }
     }
 
 
 
 

+ 110 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouRealTimeDataServiceImpl.java

@@ -0,0 +1,110 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouRealTimeDataService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class KuaishouRealTimeDataServiceImpl implements IKuaishouRealTimeDataService {
+    /**
+     * 获取计划实时数据
+     *
+     * @param accountId
+     * @param token
+     * @param campaignId
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    @Override
+    public JSONArray getCampaignDate(Long accountId, String token, Long campaignId, String startDate, String endDate) {
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_REPORT;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", token);
+        Map<String, Object> param = new HashMap<>();
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        param.put("advertiser_id", accountId);
+        param.put("temporal_granularity", "DAILY");
+        param.put("page_size", 2000);
+        param.put("page", 1);
+
+        JSONArray array = new JSONArray();
+        array.add(campaignId);
+        param.put("campaign_ids", array);
+        try {
+            String result = HttpUtils.httpPostRequest(url, param, headers);
+            System.err.println(result);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if (!Check.isNull(jsonObject)) {
+                Integer code = jsonObject.getInteger("code");
+                if (code == 0) {
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    if (!Check.isNull(data)) {
+                        return data.getJSONArray("details");
+                    }
+
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 获取组实时数据
+     *
+     * @param accountId
+     * @param token
+     * @param unitId
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    @Override
+    public JSONArray getUnitDate(Long accountId, String token, Long unitId, String startDate, String endDate) {
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", token);
+        Map<String, Object> param = new HashMap<>();
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        param.put("advertiser_id", accountId);
+        param.put("temporal_granularity", "DAILY");
+        param.put("page_size", 2000);
+        param.put("page", 1);
+
+        JSONArray array = new JSONArray();
+        array.add(unitId);
+        param.put("unit_ids", array);
+        try {
+            String result = HttpUtils.httpPostRequest(url, param, headers);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if (!Check.isNull(jsonObject)) {
+                Integer code = jsonObject.getInteger("code");
+                if (code == 0) {
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    if (!Check.isNull(data)) {
+                        return data.getJSONArray("details");
+                    }
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouCleanMaterialReportController.java

@@ -1,8 +1,8 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 package cn.com.ctop.kuaishou.modules.report.controller;
 
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

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

@@ -0,0 +1,290 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手图片报表
+ * @author jeecg-boot
+ * @date   2020-09-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_report_daily_image")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_kuaishou_report_daily_image对象", description="快手图片报表")
+public class KuaishouReportDailyImage {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**账户ID*/
+	@Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+	private Integer coverId;
+	/**计划ID*/
+	@Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+	private Integer photoId;
+	/**channelType*/
+	@Excel(name = "channelType", width = 15)
+    @ApiModelProperty(value = "channelType")
+	private Integer channelType;
+	/**signature*/
+	@Excel(name = "signature", width = 15)
+    @ApiModelProperty(value = "signature")
+	private String signature;
+	/**封面token*/
+	@Excel(name = "封面token", width = 15)
+    @ApiModelProperty(value = "封面token")
+	private String imageToken;
+	/**封面url*/
+	@Excel(name = "封面url", width = 15)
+    @ApiModelProperty(value = "封面url")
+	private String coverUrl;
+	/**视频uel*/
+	@Excel(name = "视频uel", width = 15)
+    @ApiModelProperty(value = "视频uel")
+	private String photoUrl;
+	/**素材类型*/
+	@Excel(name = "素材类型", width = 15)
+    @ApiModelProperty(value = "素材类型")
+	private String creativeMaterialTypeString;
+	/**场景*/
+	@Excel(name = "场景", width = 15)
+    @ApiModelProperty(value = "场景")
+	private String adScene;
+	/**花费(元)*/
+	@Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+	private java.math.BigDecimal charge;
+	/**曝光数*/
+	@Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+	private Integer photoShow;
+	/**素材曝光数*/
+	@Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+	private Integer aclick;
+	/**行为数*/
+	@Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+	private Integer bclick;
+	/**分享数*/
+	@Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+	private Integer photoShare;
+	/**评论数*/
+	@Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+	private Integer photoComment;
+	/**点赞数*/
+	@Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+	private Integer photoLike;
+	/**新增关注数*/
+	@Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+	private Integer follow;
+	/**取消关注数*/
+	@Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+	private Integer cancelFollow;
+	/**举报数*/
+	@Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+	private Integer report;
+	/**拉黑数*/
+	@Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+	private Integer block;
+	/**减少此类作品数*/
+	@Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+	private Integer negative;
+	/**应用下载数据-安卓下载开始数*/
+	@Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+	private Integer downloadStarted;
+	/**应用下载数据-安卓下载完成数*/
+	@Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+	private Integer downloadCompleted;
+	/**应用下载数据-激活数*/
+	@Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+	private Integer activation;
+	/**提交按钮点击数*/
+	@Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+	private Integer submit;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+	private String statDate;
+	/**封面点击数*/
+	@Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+	private Integer photoClick;
+	/**封面点击率*/
+	@Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+	private Double photoClickRatio;
+	/**行为率*/
+	@Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+	private Double actionRatio;
+	/**平均千次曝光花费(元)*/
+	@Excel(name = "平均千次曝光花费(元)", width = 15)
+    @ApiModelProperty(value = "平均千次曝光花费(元)")
+	private java.math.BigDecimal impression1kCost;
+	/**平均点击单价(元)*/
+	@Excel(name = "平均点击单价(元)", width = 15)
+    @ApiModelProperty(value = "平均点击单价(元)")
+	private java.math.BigDecimal photoClickCost;
+	/**平均行为单价(元)*/
+	@Excel(name = "平均行为单价(元)", width = 15)
+    @ApiModelProperty(value = "平均行为单价(元)")
+	private java.math.BigDecimal actionCost;
+	/**应用下载数据-首日付费次数*/
+	@Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+	private Integer eventPayFirstDay;
+	/**应用下载数据-首日付费金额*/
+	@Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+	private java.math.BigDecimal eventPayPurchaseAmountFirstDay;
+	/**应用下载数据-首日ROI*/
+	@Excel(name = "应用下载数据-首日ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日ROI")
+	private Double eventPayFirstDayRoi;
+	/**应用下载数据-付费次数*/
+	@Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+	private Integer eventPay;
+	/**应用下载数据-付费金额*/
+	@Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+	private java.math.BigDecimal eventPayPurchaseAmount;
+	/**应用下载数据-ROI*/
+	@Excel(name = "应用下载数据-ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-ROI")
+	private Double eventPayRoi;
+	/**应用下载数据-注册数*/
+	@Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+	private Integer eventRegister;
+	/**应用下载数据-注册成本*/
+	@Excel(name = "应用下载数据-注册成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册成本")
+	private java.math.BigDecimal eventRegisterCost;
+	/**应用下载数据-注册率*/
+	@Excel(name = "应用下载数据-注册率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册率")
+	private Double eventRegisterRatio;
+	/**应用下载数据-完件数*/
+	@Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+	private Integer eventJinJianApp;
+	/**应用下载数据-完件成本*/
+	@Excel(name = "应用下载数据-完件成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件成本")
+	private java.math.BigDecimal eventJinJianAppCost;
+	/**应用下载数据-授信数*/
+	@Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+	private Integer eventCreditGrantApp;
+	/**应用下载数据-授信成本*/
+	@Excel(name = "应用下载数据-授信成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信成本")
+	private java.math.BigDecimal eventCreditGrantAppCost;
+	/**应用下载数据-授信率*/
+	@Excel(name = "应用下载数据-授信率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信率")
+	private Double eventCreditGrantAppRatio;
+	/**应用下载数据-付款成功数*/
+	@Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+	private Integer eventOrderPaid;
+	/**应用下载数据-付款成功金额*/
+	@Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+	private java.math.BigDecimal eventOrderPaidPurchaseAmount;
+	/**落地页数据-落地页完件数*/
+	@Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+	private Integer eventJinJianLandingPage;
+	/**落地页数据-落地页完件成本*/
+	@Excel(name = "落地页数据-落地页完件成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件成本")
+	private java.math.BigDecimal eventJinJianLandingPageCost;
+	/**落地页数据-落地页授信数*/
+	@Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+	private Integer eventCreditGrantLandingPage;
+	/**落地页数据-落地页授信成本*/
+	@Excel(name = "落地页数据-落地页授信成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信成本")
+	private java.math.BigDecimal eventCreditGrantLandingPageCost;
+	/**落地页数据-落地页授信率*/
+	@Excel(name = "落地页数据-落地页授信率", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信率")
+	private Double eventCreditGrantLandingRatio;
+	/**应用下载数据-次留成本(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留成本(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留成本(仅支持分日查询)")
+	private java.math.BigDecimal eventNextDayStayCost;
+	/**应用下载数据-次留率(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留率(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留率(仅支持分日查询)")
+	private Integer eventNextDayStayRatio;
+	/**落地页数据-表单提交点击率*/
+	@Excel(name = "落地页数据-表单提交点击率", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交点击率")
+	private Double formActionRatio;
+	/**应用下载数据-单次付款成本*/
+	@Excel(name = "应用下载数据-单次付款成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-单次付款成本")
+	private java.math.BigDecimal eventOrderPaidCost;
+	/**应用下载数据-次留数(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+	private Integer eventNextDayStay;
+	/**落地页数据-表单提交单价*/
+	@Excel(name = "落地页数据-表单提交单价", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交单价")
+	private java.math.BigDecimal formCost;
+	/**落地页数据-表单提交数*/
+	@Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+	private Integer formCount;
+	/**3s播放率*/
+	@Excel(name = "3s播放率", width = 15)
+    @ApiModelProperty(value = "3s播放率")
+	private Double play3sRatio;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+}

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeMapper.java

@@ -1,6 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyImageMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyImage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手图片报表
+ * @author: jeecg-boot
+ * @date:   2020-09-28
+ * @cersion: V1.0
+ */
+public interface KuaishouReportDailyImageMapper extends BaseMapper<KuaishouReportDailyImage> {
+
+    void loadImageDailyReport(Long accountId, String localPath);
+}

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml

@@ -266,7 +266,7 @@
     </select>
     </select>
 
 
     <select id="calculationMaterialReport"
     <select id="calculationMaterialReport"
-            resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport">
+            resultType="cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport">
         select
         select
         signature id,
         signature id,
         sum(charge) charge,
         sum(charge) charge,

+ 106 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyImageMapper.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyImageMapper">
+
+    <insert id="loadImageDailyReport">
+        LOAD DATA local INFILE  #{localPath}
+	    REPLACE INTO TABLE ctop_kuaishou_report_daily_image CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(cover_id,
+		image_token,
+		cover_url,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        @click_1k_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost,
+        @ad_product_cnt,
+        @event_goods_view,
+        @merchant_reco_fans,
+        @event_order_amount_roi,
+        @event_goods_view_cost,
+        @merchant_reco_fans_cost,
+        @event_new_user_pay,
+        @event_new_user_pay_cost,
+        @event_new_user_pay_ratio,
+        @event_button_click,
+        @event_button_click_cost,
+        @event_button_click_ratio,
+        @play_5s_ratio,
+        @play_end_ratio,
+        @event_order_paid_roi,
+        @event_new_user_jinjian_app,
+        @event_new_user_jinjian_app_cost,
+        @event_new_user_jinjian_app_roi,
+        @event_new_user_credit_grant_app,
+        @event_new_user_credit_grant_app_cost,
+        @event_new_user_credit_grant_app_roi,
+        @event_new_user_jinjian_page,
+        @event_new_user_jinjian_page_cost,
+        @event_new_user_jinjian_page_roi,
+        @event_new_user_credit_grant_page,
+        @event_new_user_credit_grant_page_cost,
+        @event_new_user_credit_grant_page_roi,
+        @event_appoint_form,
+        @event_appoint_form_cost,
+        @event_appoint_form_ratio,
+        @event_appoint_jump_click,
+        @event_appoint_jump_click_cost,
+        @event_appoint_jump_click_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+</mapper>

+ 0 - 29
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaiShouCleanMaterialReportService.java

@@ -1,29 +0,0 @@
-package cn.com.ctop.kuaishou.modules.report.service;
-
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * 快手素材清洗数据
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-24
- */
-public interface IKuaiShouCleanMaterialReportService extends IService<KuaiShouCleanMaterialReport> {
-    /**
-     * 快手 唯一素材MD5标识
-     *
-     * @return
-     */
-    List<String> getSignature();
-
-    /**
-     * 计算快手素材报表
-     *
-     * @param signature
-     */
-    void calculationReport(String signature);
-}

+ 10 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyCreativeService.java

@@ -3,5 +3,15 @@ package cn.com.ctop.kuaishou.modules.report.service;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
+import java.util.List;
+
 public interface IKuaishouReportDailyCreativeService extends IService<KuaishouReportDailyCreative> {
 public interface IKuaishouReportDailyCreativeService extends IService<KuaishouReportDailyCreative> {
+    List<String> getSignature();
+
+    /**
+     * 计算快手素材报表
+     *
+     * @param signature
+     */
+    void calculationReport(String signature);
 }
 }

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyImageService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyImage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 快手图片报表
+ * @Author: jeecg-boot
+ * @Date:   2020-09-28
+ * @Version: V1.0
+ */
+public interface IKuaishouReportDailyImageService extends IService<KuaishouReportDailyImage> {
+
+}

+ 0 - 41
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouCleanMaterialReportServiceImpl.java

@@ -1,41 +0,0 @@
-package cn.com.ctop.kuaishou.modules.report.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouCleanMaterialReportMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 快手素材清洗数据
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-24
- */
-@Service
-public class KuaiShouCleanMaterialReportServiceImpl extends ServiceImpl<KuaiShouCleanMaterialReportMapper, KuaiShouCleanMaterialReport> implements IKuaiShouCleanMaterialReportService {
-    @Autowired
-    private KuaishouReportDailyCreativeMapper kuaishouReportDailyCreativeMapper;
-
-    @Override
-    public List<String> getSignature() {
-        return kuaishouReportDailyCreativeMapper.getSignatureList();
-    }
-
-    @Override
-    public void calculationReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        KuaiShouCleanMaterialReport calculationMaterialReport = kuaishouReportDailyCreativeMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            this.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

+ 27 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyCreativeServiceImpl.java

@@ -1,11 +1,38 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
 
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyCreativeService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyCreativeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
+
 @Service
 @Service
 public class KuaishouReportDailyCreativeServiceImpl extends ServiceImpl<KuaishouReportDailyCreativeMapper, KuaishouReportDailyCreative> implements IKuaishouReportDailyCreativeService {
 public class KuaishouReportDailyCreativeServiceImpl extends ServiceImpl<KuaishouReportDailyCreativeMapper, KuaishouReportDailyCreative> implements IKuaishouReportDailyCreativeService {
+    @Autowired
+    private KuaishouReportDailyCreativeMapper kuaishouReportDailyCreativeMapper;
+    @Autowired
+    private IKuaiShouCleanMaterialReportService cleanMaterialReportService;
+
+    @Override
+    public List<String> getSignature() {
+        return kuaishouReportDailyCreativeMapper.getSignatureList();
+    }
+
+    @Override
+    public void calculationReport(String signature) {
+        if (Check.isNull(signature)) {
+            return;
+        }
+        KuaiShouCleanMaterialReport calculationMaterialReport = kuaishouReportDailyCreativeMapper.calculationMaterialReport(signature);
+        if (!Check.isNull(calculationMaterialReport)) {
+            cleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
+        }
+    }
+
 }
 }

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyImageServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyImage;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyImageMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手图片报表
+ * @author jeecg-boot
+ * @date   2020-09-28
+ * @version V1.0
+ */
+@Service
+public class KuaishouReportDailyImageServiceImpl extends ServiceImpl<KuaishouReportDailyImageMapper, KuaishouReportDailyImage> implements IKuaishouReportDailyImageService {
+
+}

+ 3 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/constant/QYWxConstant.java

@@ -8,6 +8,7 @@ public class QYWxConstant {
 
 
     public static final Integer QYWX_OA_AGENT_ID = 3010011;
     public static final Integer QYWX_OA_AGENT_ID = 3010011;
     public static final String QYWX_OA_CORP_SECRET = "MDeiFSCwIlcmcR1zrYvmjNlsoYFGl8I770uuUezWgGE";
     public static final String QYWX_OA_CORP_SECRET = "MDeiFSCwIlcmcR1zrYvmjNlsoYFGl8I770uuUezWgGE";
+    public static final String QYWX_APPROVA_CORP_SECRET = "qlk4nSc1vjxy0AHyX1f5bnGh7y2WtqN9lR__0WJA6zM";
 
 
 
 
     public static final String QYWX_API_URL = "https://qyapi.weixin.qq.com";  //企业微信api域名
     public static final String QYWX_API_URL = "https://qyapi.weixin.qq.com";  //企业微信api域名
@@ -15,6 +16,8 @@ public class QYWxConstant {
     public static final String QYWX_GET_TOKEN = "/cgi-bin/gettoken";  //获取token
     public static final String QYWX_GET_TOKEN = "/cgi-bin/gettoken";  //获取token
     public static final String QYWX_USER_SIMPLELIST = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist";  //获取部门下员工简单信息
     public static final String QYWX_USER_SIMPLELIST = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist";  //获取部门下员工简单信息
     public static final String QYWX_CHECKIN_DATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata";  //获取部门下员工简单信息
     public static final String QYWX_CHECKIN_DATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata";  //获取部门下员工简单信息
+    public static final String APP_ROVAL_INFO = "https://qyapi.weixin.qq.com/cgi-bin/oa/getapprovalinfo";  //批量获取审批单号
+    public static final String APP_ROVAL_DETAIL = "https://qyapi.weixin.qq.com/cgi-bin/oa/getapprovaldetail";  //获取审批申请详情
 
 
 
 
 }
 }

+ 27 - 16
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatCheckinDataController.java

@@ -1,12 +1,12 @@
 package cn.com.ctop.oa.modules.controller;
 package cn.com.ctop.oa.modules.controller;
 
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -19,7 +19,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.ModelAndView;
@@ -57,22 +65,25 @@ public class WechatCheckinDataController {
      * @param req
      * @param req
      * @return
      * @return
      */
      */
-    @AutoLog(value = "企业微信用户-分页列表查询")
-    @ApiOperation(value = "企业微信用户-分页列表查询", notes = "企业微信用户-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<WechatCheckinData>> queryPageList(WechatCheckinData wechatCheckinData,
-                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                          HttpServletRequest req) {
-        Result<IPage<WechatCheckinData>> result = new Result<>();
-        QueryWrapper<WechatCheckinData> queryWrapper = QueryGenerator.initQueryWrapper(wechatCheckinData, req.getParameterMap());
-        Page<WechatCheckinData> page = new Page<WechatCheckinData>(pageNo, pageSize);
-        IPage<WechatCheckinData> pageList = wechatCheckinDataService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
+    @AutoLog(value = "考勤打卡明细-分页列表查询")
+    @ApiOperation(value = "考勤打卡明细-分页列表查询", notes = "考勤打卡明细-分页列表查询")
+    @PostMapping(value = "/queryPageList")
+    public Result<PageInfo<WechatCheckinData>> queryPageList(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatCheckinData>> result = new Result<>();
+        try {
+            PageInfo<WechatCheckinData> pageData = wechatCheckinDataService.selectPageList(paramsMap);
+            if (!Check.isNull(pageData)) {
+                result.setResult(pageData);
+                result.setSuccess(true);
+            }
+        } catch (Exception e) {
+            log.error("考勤打卡明细-分页列表查询 error ", e);
+            result.error500("操作失败");
+        }
         return result;
         return result;
     }
     }
 
 
+
     /**
     /**
      * 添加
      * 添加
      *
      *

+ 28 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatDepartmentController.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.oa.modules.controller;
 package cn.com.ctop.oa.modules.controller;
 
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
 import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
@@ -19,7 +20,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.ModelAndView;
@@ -73,6 +82,24 @@ public class WechatDepartmentController {
         return result;
         return result;
     }
     }
 
 
+    @AutoLog(value = "部门列表List-列表查询")
+    @ApiOperation(value = "部门列表List-列表查询", notes = "部门列表List-列表查询")
+    @PostMapping(value = "/queryList")
+    public Result<List<WechatDepartment>> queryList() {
+        Result<List<WechatDepartment>> result = new Result<>();
+        try {
+            List<WechatDepartment> pageList = wechatDepartmentService.queryList();
+            if (!Check.isNull(pageList)) {
+                result.setResult(pageList);
+                result.setSuccess(true);
+            }
+        } catch (Exception e) {
+            log.error("部门列表List-列表查询 error ", e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
     /**
     /**
      * 添加
      * 添加
      *
      *

+ 368 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatNoListController.java

@@ -0,0 +1,368 @@
+package cn.com.ctop.oa.modules.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.oa.modules.entity.WechatAttendance;
+import cn.com.ctop.oa.modules.entity.WechatNoList;
+import cn.com.ctop.oa.modules.service.IWechatNoListService;
+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 com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 审批信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-23
+ */
+@Slf4j
+@Api(tags = "审批信息")
+@RestController
+@RequestMapping("/oa/wechatNoList")
+public class WechatNoListController {
+    @Autowired
+    private IWechatNoListService wechatNoListService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param wechatNoList
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "审批信息-分页列表查询")
+    @ApiOperation(value = "审批信息-分页列表查询", notes = "审批信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<WechatNoList>> queryPageList(WechatNoList wechatNoList,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                     HttpServletRequest req) {
+        Result<IPage<WechatNoList>> result = new Result<>();
+        QueryWrapper<WechatNoList> queryWrapper = QueryGenerator.initQueryWrapper(wechatNoList, req.getParameterMap());
+        Page<WechatNoList> page = new Page<WechatNoList>(pageNo, pageSize);
+        IPage<WechatNoList> pageList = wechatNoListService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param wechatNoList
+     * @return
+     */
+    @AutoLog(value = "审批信息-添加")
+    @ApiOperation(value = "审批信息-添加", notes = "审批信息-添加")
+    @PostMapping(value = "/add")
+    public Result<WechatNoList> add(@RequestBody WechatNoList wechatNoList) {
+        Result<WechatNoList> result = new Result<>();
+        try {
+            wechatNoListService.save(wechatNoList);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param wechatNoList
+     * @return
+     */
+    @AutoLog(value = "审批信息-编辑")
+    @ApiOperation(value = "审批信息-编辑", notes = "审批信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<WechatNoList> edit(@RequestBody WechatNoList wechatNoList) {
+        Result<WechatNoList> result = new Result<WechatNoList>();
+        WechatNoList wechatNoListEntity = wechatNoListService.getById(wechatNoList.getId());
+        if (wechatNoListEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = wechatNoListService.updateById(wechatNoList);
+            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 {
+            wechatNoListService.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<WechatNoList> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<WechatNoList> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.wechatNoListService.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<WechatNoList> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<WechatNoList> result = new Result<>();
+        WechatNoList wechatNoList = wechatNoListService.getById(id);
+        if (wechatNoList == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(wechatNoList);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<WechatNoList> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                WechatNoList wechatNoList = JSON.parseObject(deString, WechatNoList.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(wechatNoList, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<WechatNoList> pageList = wechatNoListService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "审批信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, WechatNoList.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("审批信息列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return AbnormalAttendance
+     */
+    @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<WechatNoList> listWechatNoLists = ExcelImportUtil.importExcel(file.getInputStream(), WechatNoList.class, params);
+                wechatNoListService.saveBatch(listWechatNoLists);
+                return Result.ok("文件导入成功!数据行数:" + listWechatNoLists.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("文件导入失败!");
+    }
+
+    /**
+     * 考勤异常记录 导出数据
+     *
+     * @param requestBody
+     * @param response
+     */
+    @PostMapping("/excel")
+    public void getExcelReport(HttpServletResponse response, @RequestBody Map<String, Object> paramsMap) {
+
+        List<WechatAttendance> excelData = wechatNoListService.queryAttendanceData(paramsMap);
+        List<WechatAttendance> overtimeData = wechatNoListService.queryOverTimeData(paramsMap);
+        try {
+            List<List<Object>> excelList = new ArrayList<>();
+            List<List<Object>> overtimeExcelList = new ArrayList<>();
+            if (!excelData.isEmpty()) {
+                excelData.forEach(data -> {
+                    List<Object> temp = new ArrayList<>();
+                    temp.add(data.getUserName());
+                    temp.add(data.getDepartName());
+                    temp.add(data.getCheckinDate());
+                    temp.add(data.getCheckinType());
+                    temp.add(data.getExceptionType());
+                    temp.add(data.getCheckinTime());
+                    temp.add(data.getType());
+                    temp.add(data.getStateDuration());
+                    if (!Check.isNull(data.getStatus())) {
+                        temp.add("1".equals(data.getStatus()) ? "审批中" : "已通过");
+                    } else {
+                        temp.add("");
+                    }
+                    excelList.add(temp);
+                });
+            }
+            if (!overtimeData.isEmpty()) {
+                overtimeData.forEach(data -> {
+                    List<Object> temp = new ArrayList<>();
+                    temp.add(data.getUserName());
+                    temp.add(data.getDepartName());
+                    temp.add(data.getCheckinDate());
+                    temp.add(data.getOvertime());
+                    overtimeExcelList.add(temp);
+                });
+            }
+            OutputStream os = response.getOutputStream();
+            ExportExcelUtils eeu = new ExportExcelUtils();
+            XSSFWorkbook workbook = new XSSFWorkbook();
+            String[] titles = {"姓名", "部门", "考勤日期", "考勤类型", "考勤状态", "考勤时间", "审核状态", "状态时长", "审批状态"};
+            String[] overtimeTitles = {"姓名", "部门", "加班日期", "加班时长"};
+            eeu.exportExcelForAttendance(workbook, 0, "异常考勤", titles, excelList);
+            eeu.exportExcel(workbook, 1, "加班考勤", overtimeTitles, overtimeExcelList);
+            HttpUtils.setResponseHeader(response, "考勤记录.xlsx");
+            workbook.write(os);
+            os.flush();
+            os.close();
+        } catch (IOException e) {
+            log.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 考勤异常数据查询(分页)
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "异常考勤数据-分页列表查询")
+    @PostMapping(value = "/selectNoListPage")
+    public Result<PageInfo<WechatAttendance>> selectNoListPage(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatAttendance>> result = new Result<>();
+        try {
+            PageInfo<WechatAttendance> pageData = wechatNoListService.selectNoListPage(paramsMap);
+            if (!Check.isNull(pageData)) {
+                result.setResult(pageData);
+                result.setSuccess(true);
+            }
+        } catch (Exception e) {
+            log.error("异常考勤数据-分页列表查询 error ", e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 加班考勤数据查询(分页)
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "加班考勤数据-分页列表查询")
+    @PostMapping(value = "/selectOverTimePage")
+    public Result<PageInfo<WechatAttendance>> selectOverTimePage(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatAttendance>> result = new Result<>();
+        try {
+            PageInfo<WechatAttendance> pageData = wechatNoListService.selectOverTimePage(paramsMap);
+            if (!Check.isNull(pageData)) {
+                result.setResult(pageData);
+                result.setSuccess(true);
+            }
+        } catch (Exception e) {
+            log.error("加班考勤数据-分页列表查询 error ", e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+}

+ 65 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatAttendance.java

@@ -0,0 +1,65 @@
+package cn.com.ctop.oa.modules.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 考勤异常统计数据
+ *
+ * @ClassName WechatAttendance
+ * @Author ZHAOXA
+ * @date 2020-09-24 21:00
+ */
+@Data
+public class WechatAttendance {
+    /**
+     * 员工Id
+     */
+    private String userId;
+    /**
+     * 员工名
+     */
+    private String userName;
+    /**
+     * 部门名
+     */
+    private String departName;
+    /**
+     * 审批状态 1-审批中;2-已通过;
+     */
+    private String status;
+    /**
+     * 部门编号
+     */
+    private String departId;
+    /**
+     * 签到日期
+     */
+    private String checkinDate;
+    /**
+     * 打卡类型
+     */
+    private String checkinType;
+    /**
+     * 异常打卡状态
+     */
+    private String exceptionType;
+    /**
+     * 考勤时间
+     */
+    private String checkinTime;
+    /**
+     * 异常考勤状态
+     */
+    private String type;
+    /**
+     * 状态时长
+     */
+    private String stateDuration;
+    /**
+     * 加班时长
+     */
+    private String overtime;
+
+}

+ 9 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinData.java

@@ -137,4 +137,13 @@ public class WechatCheckinData {
      */
      */
     @ApiModelProperty(value = "updateTime")
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
     private Date updateTime;
+
+    /**
+     * 员工名
+     */
+    private String userName;
+    /**
+     * 部门名
+     */
+    private String departName;
 }
 }

+ 67 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatNoList.java

@@ -0,0 +1,67 @@
+package cn.com.ctop.oa.modules.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 审批信息
+ * @author jeecg-boot
+ * @date   2020-09-23
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_wechat_no_list")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_wechat_no_list对象", description="审批信息")
+public class WechatNoList {
+    
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private String id;
+	/**单号*/
+	@Excel(name = "单号", width = 15)
+    @ApiModelProperty(value = "单号")
+	private String spNo;
+	/**单号*/
+	@Excel(name = "1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付", width = 15)
+    @ApiModelProperty(value = "1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付")
+	private String status;
+	/**成员id*/
+	@Excel(name = "成员id", width = 15)
+    @ApiModelProperty(value = "成员id")
+	private String userId;
+	/**type时长*/
+	@Excel(name = "type时长", width = 15)
+    @ApiModelProperty(value = "type时长")
+	private String newDuration;
+	/**1-请假;2-补卡;3-出差;4-外出;5-加班*/
+	@Excel(name = "1-请假;2-补卡;3-出差;4-外出;5-加班", width = 15)
+    @ApiModelProperty(value = "1-请假;2-补卡;3-出差;4-外出;5-加班")
+	private String type;
+	/**开始时间*/
+    @ApiModelProperty(value = "开始时间")
+	private Date newBegin;
+	/**结束时间*/
+    @ApiModelProperty(value = "结束时间")
+	private Date newEnd;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 63 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/enums/SpNoEnum.java

@@ -0,0 +1,63 @@
+package cn.com.ctop.oa.modules.enums;
+
+
+import cn.com.ctop.common.module.utils.Check;
+
+public enum SpNoEnum {
+
+
+    control1("Attendance", "假勤"),
+    control2("Vacation", "请假"),
+    control3("PunchCorrection", "补卡"),
+    type1("1", "请假"),
+    type2("2", "补卡"),
+    type3("3", "出差"),
+    type4("4", "外出"),
+    type5("5", "加班"),
+    vacation1("101","年假"),
+    vacation2("102","事假"),
+    vacation3("103","病假"),
+    vacation4("104","调休"),
+    vacation5("105","婚假"),
+    vacation6("106","产假"),
+    vacation7("107","陪产假"),
+    vacation8("108","其他"),
+    vacation9("109","丧假");
+    private String code;
+    private String name;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public static SpNoEnum getSpNoEnum(String code) {
+        if (Check.isNull(code)) {
+            return null;
+        }
+        for (SpNoEnum value : SpNoEnum.values()) {
+            if (value.code.equals(code)) {
+                return value;
+            }
+        }
+        return null;
+    }
+
+
+    private SpNoEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+
+    }
+}

+ 6 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java

@@ -3,6 +3,9 @@ package cn.com.ctop.oa.modules.mapper;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 
+import java.util.List;
+import java.util.Map;
+
 /**
 /**
  * 企业微信用户
  * 企业微信用户
  *
  *
@@ -12,4 +15,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
  */
 public interface WechatCheckinDataMapper extends BaseMapper<WechatCheckinData> {
 public interface WechatCheckinDataMapper extends BaseMapper<WechatCheckinData> {
 
 
+    WechatCheckinData queryEntityByMap(Map<String, Object> paramsMap);
+
+    List<WechatCheckinData> selectPageList(Map<String, Object> paramsMap);
 }
 }

+ 3 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatDepartmentMapper.java

@@ -3,6 +3,8 @@ package cn.com.ctop.oa.modules.mapper;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 
+import java.util.List;
+
 /**
 /**
  * 部门列表
  * 部门列表
  *
  *
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
  */
 public interface WechatDepartmentMapper extends BaseMapper<WechatDepartment> {
 public interface WechatDepartmentMapper extends BaseMapper<WechatDepartment> {
 
 
+    List<WechatDepartment> queryList();
 }
 }

+ 23 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatNoListMapper.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.oa.modules.mapper;
+
+import cn.com.ctop.oa.modules.entity.WechatAttendance;
+import cn.com.ctop.oa.modules.entity.WechatNoList;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 审批信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-23
+ * @cersion: V1.0
+ */
+public interface WechatNoListMapper extends BaseMapper<WechatNoList> {
+
+    List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap);
+
+    List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap);
+
+}

+ 65 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml

@@ -1,5 +1,70 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper">
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper">
+    <select id="queryEntityByMap" resultType="cn.com.ctop.oa.modules.entity.WechatCheckinData">
+        SELECT
+        *
+        FROM ctop_wechat_checkin_data
+        <where>
+            <if test="userId != null and userId != '' ">
+                and user_id = #{userId}
+            </if>
+            <if test="departId != null and departId != '' ">
+                and depart_id = #{departId}
+            </if>
+            <if test="checkinType != null">
+                and checkin_type = #{checkinType}
+            </if>
+            <if test="checkinDate != null ">
+                and checkin_time like concat(#{checkinDate},"%")
+            </if>
+        </where>
+    </select>
 
 
+
+    <select id="selectPageList" resultType="cn.com.ctop.oa.modules.entity.WechatCheckinData">
+        SELECT
+        ck.id,
+        ck.depart_id,
+        ck.user_id,
+        us.user_name,
+        dpt.depart_name,
+        ck.group_name,
+        ck.checkin_type,
+        ck.exception_type,
+        ck.checkin_time,
+        ck.location_title,
+        ck.location_detail,
+        ck.wifiname,
+        ck.notes,
+        ck.wifimac,
+        ck.mediaids,
+        ck.lat,
+        ck.lng,
+        ck.deviceid,
+        ck.overtime_or_not,
+        ck.overtime,
+        ck.create_time,
+        ck.update_time
+        FROM ctop_wechat_checkin_data as ck
+        LEFT JOIN ctop_wechat_user_list as us ON ck.user_id = us.user_id
+        LEFT JOIN ctop_wechat_department as dpt ON dpt.depart_id = us.depart_id
+        <where>
+            <if test="userId != null and userId != '' ">
+                and ck.user_id = #{userId}
+            </if>
+            <if test="departId != null and departId != '' ">
+                and ck.depart_id = #{departId}
+            </if>
+            <if test="userName != null ">
+                and us.user_name like concat(#{userName},"%")
+            </if>
+            <if test="startTime != null">
+                and ck.checkin_time &gt;= #{startTime}
+            </if>
+            <if test="stopTime != null ">
+                and ck.checkin_time &lt;= #{stopTime}
+            </if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 6 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatDepartmentMapper.xml

@@ -2,4 +2,10 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatDepartmentMapper">
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatDepartmentMapper">
 
 
+
+    <select id="queryList" resultType="cn.com.ctop.oa.modules.entity.WechatDepartment">
+        SELECT
+            *
+        FROM ctop_wechat_department
+    </select>
 </mapper>
 </mapper>

+ 89 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatNoListMapper.xml

@@ -0,0 +1,89 @@
+<?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.oa.modules.mapper.WechatNoListMapper">
+
+    <select id="queryAttendanceData" resultType="cn.com.ctop.oa.modules.entity.WechatAttendance">
+        SELECT DISTINCT
+        us.user_id AS userId,
+        us.user_name AS userName,
+        dpt.depart_id AS departId,
+        dpt.depart_name AS departName,
+        DATE_FORMAT(ck.checkin_time,'%Y-%m-%d') AS checkinDate,
+        ck.checkin_type AS checkinType,
+        ck.exception_type AS exceptionType,
+        nl.status as status,
+        DATE_FORMAT(ck.checkin_time, '%Y-%m-%d %H:%i:%s') AS checkinTime,
+        case when nl.type !='' THEN nl.type
+        when ck.checkin_type ='上班打卡' AND exception_type ='时间异常' then '迟到'
+        when ck.checkin_type ='下班打卡' AND exception_type ='时间异常' then '早退'
+        end AS type,
+        case when nl.type!=''and nl.type !='补卡' then CONCAT(nl.new_duration,' h')
+        when ck.checkin_type ='上班打卡'and ck.exception_type ='时间异常' then
+        CONCAT(TIMESTAMPDIFF(MINUTE,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d '),'09:30:00'),'%Y-%m-%d
+        %H:%i:%s'),ck.checkin_time),' min')
+        when ck.checkin_type ='下班打卡'and ck.exception_type ='时间异常' then
+        CONCAT(TIMESTAMPDIFF(MINUTE,ck.checkin_time,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d
+        '),'19:00:00'),'%Y-%m-%d %H:%i:%s')),' min')
+        end AS stateDuration
+        FROM ctop_wechat_user_list AS us
+        LEFT JOIN ctop_wechat_department AS dpt ON us.depart_id = dpt.depart_id
+        LEFT JOIN ctop_wechat_checkin_data AS ck ON ck.user_id = us.user_id
+        LEFT JOIN ctop_wechat_no_list AS nl ON nl.user_id = us.user_id and
+        nl.new_begin Like CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d'),'%')
+        WHERE ck.exception_type!='' and ISNULL(ck.exception_type)= 0
+        <if test="userId != null and userId != '' ">
+            and us.user_id = #{userId}
+        </if>
+        <if test="userName != null and userName != '' ">
+            and us.user_Name LIKE CONCAT("%",#{userName},"%")
+        </if>
+        <if test="departId != null and departId != '' ">
+            and dpt.depart_id = #{departId}
+        </if>
+        <if test="departName != null and departName != '' ">
+            and dpt.depart_name LIKE CONCAT("%",#{departName},"%")
+        </if>
+        <if test="startTime != null">
+            and ck.checkin_time &gt;= #{startTime}
+        </if>
+        <if test="stopTime != null ">
+            and ck.checkin_time &lt;= #{stopTime}
+        </if>
+        order by us.depart_id,us.user_name ,ck.checkin_time
+    </select>
+
+
+    <select id="queryOverTimeData" resultType="cn.com.ctop.oa.modules.entity.WechatAttendance">
+        SELECT
+        us.user_id AS userId,
+        us.user_name AS userName,
+        dpt.depart_id AS departId,
+        dpt.depart_name AS departName,
+        DATE_FORMAT(ck.checkin_time,'%Y-%m-%d') AS checkinDate,
+        CONCAT(ck.overtime,' h') AS overtime
+        FROM ctop_wechat_checkin_data as ck
+        LEFT JOIN ctop_wechat_user_list as us ON ck.user_id = us.user_id
+        LEFT JOIN ctop_wechat_department as dpt ON dpt.depart_id = us.depart_id
+        WHERE ck.overtime_or_not = 1
+        <if test="userId != null and userId != '' ">
+            and us.user_id = #{userId}
+        </if>
+        <if test="userName != null and userName != '' ">
+            and us.user_Name LIKE CONCAT("%",#{userName},"%")
+        </if>
+        <if test="departId != null and departId != '' ">
+            and dpt.depart_id = #{departId}
+        </if>
+        <if test="departName != null and departName != '' ">
+            and dpt.depart_name LIKE CONCAT("%",#{departName},"%")
+        </if>
+        <if test="startTime != null">
+            and ck.checkin_time &gt;= #{startTime}
+        </if>
+        <if test="stopTime != null ">
+            and ck.checkin_time &lt;= #{stopTime}
+        </if>
+        order by us.depart_id,us.user_name ,ck.checkin_time
+    </select>
+
+</mapper>

+ 5 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatCheckinDataService.java

@@ -2,6 +2,9 @@ package cn.com.ctop.oa.modules.service;
 
 
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+
+import java.util.Map;
 
 
 /**
 /**
  * @Description: 企业微信用户
  * @Description: 企业微信用户
@@ -10,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  * @Version: V1.0
  */
  */
 public interface IWechatCheckinDataService extends IService<WechatCheckinData> {
 public interface IWechatCheckinDataService extends IService<WechatCheckinData> {
-    void getCheckinData();
+    void getCheckinData(String starttime, String endtime);
 
 
+    PageInfo<WechatCheckinData> selectPageList(Map<String, Object> paramsMap);
 }
 }

+ 4 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatDepartmentService.java

@@ -3,6 +3,8 @@ package cn.com.ctop.oa.modules.service;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import cn.com.ctop.oa.modules.entity.WechatDepartment;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
+import java.util.List;
+
 /**
 /**
  * @Description: 部门列表
  * @Description: 部门列表
  * @Author: jeecg-boot
  * @Author: jeecg-boot
@@ -11,4 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface IWechatDepartmentService extends IService<WechatDepartment> {
 public interface IWechatDepartmentService extends IService<WechatDepartment> {
     void getDepartment();
     void getDepartment();
+
+    List<WechatDepartment> queryList();
 }
 }

+ 49 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatNoListService.java

@@ -0,0 +1,49 @@
+package cn.com.ctop.oa.modules.service;
+
+import cn.com.ctop.oa.modules.entity.WechatAttendance;
+import cn.com.ctop.oa.modules.entity.WechatNoList;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 审批信息
+ * @Author: jeecg-boot
+ * @Date: 2020-09-23
+ * @Version: V1.0
+ */
+public interface IWechatNoListService extends IService<WechatNoList> {
+    /**
+     * 批量获取审批单号,单号!
+     *
+     * @param page      查询起始数,分页查询游标,默认为0
+     * @param starttime 审批单提交的时间范围,开始时间,UNix时间戳
+     * @param endtime   批单提交的时间范围,结束时间,Unix时间戳
+     * @return com.alibaba.fastjson.JSONObject
+     * @throws
+     * @author ZHAOXA
+     */
+    JSONObject getNoList(Integer page, String starttime, String endtime);
+
+    /**
+     * 审批申请数据入库
+     *
+     * @param starttime 审批单提交的时间范围,开始时间,UNix时间戳
+     * @param endtime   批单提交的时间范围,结束时间,Unix时间戳
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    void getNoDateByNo(String starttime, String endtime);
+
+    List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap);
+
+    List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap);
+
+    PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap);
+
+    PageInfo<WechatAttendance> selectOverTimePage(Map<String, Object> paramsMap);
+}

+ 11 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatTokenService.java

@@ -4,5 +4,16 @@ import java.util.Map;
 
 
 public interface IWechatTokenService {
 public interface IWechatTokenService {
     Map<String, Object> getQYWXAccessToken();
     Map<String, Object> getQYWXAccessToken();
+
     Map<String, Object> getOAAccessToken();
     Map<String, Object> getOAAccessToken();
+
+    /**
+     * 审批token
+     *
+     * @return java.util.Map<java.lang.String, java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     * @Param []
+     */
+    Map<String, Object> getApprovaAccessToken();
 }
 }

+ 0 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatUserListService.java

@@ -11,5 +11,4 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface IWechatUserListService extends IService<WechatUserList> {
 public interface IWechatUserListService extends IService<WechatUserList> {
     void getUserList();
     void getUserList();
-
 }
 }

+ 62 - 22
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java

@@ -12,16 +12,22 @@ import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.xxl.job.core.enums.NoEn;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import static org.jeecg.common.constant.GeneralConstant.*;
+
 /**
 /**
- * 企业微信用户
+ * 员工考勤
  *
  *
  * @author jeecg-boot
  * @author jeecg-boot
  * @version V1.0
  * @version V1.0
@@ -34,20 +40,21 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
     private IWechatTokenService tokenService;
     private IWechatTokenService tokenService;
     @Autowired
     @Autowired
     private IWechatUserListService userListService;
     private IWechatUserListService userListService;
+    @Autowired
+    private WechatCheckinDataMapper wechatCheckinDataMapper;
 
 
     @Override
     @Override
-    public void getCheckinData() {
+    public void getCheckinData(String starttime, String endtime) {
         try {
         try {
             Map<String, Object> qywxAccessToken = tokenService.getOAAccessToken();
             Map<String, Object> qywxAccessToken = tokenService.getOAAccessToken();
-            if ((Integer) qywxAccessToken.get("code") != 0) {
-                log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
-                throw new Exception("企业微信获取token失败");
+            if ((Integer) qywxAccessToken.get(CODE) != 0) {
+                log.error("员工考勤获取token失败,返回信息:{}", qywxAccessToken.get(MESSAGE));
+                throw new Exception("员工考勤获取token失败");
             }
             }
             List<WechatUserList> list = userListService.list();
             List<WechatUserList> list = userListService.list();
             if (Check.isNull(list)) {
             if (Check.isNull(list)) {
                 return;
                 return;
             }
             }
-
             for (WechatUserList userList : list) {
             for (WechatUserList userList : list) {
                 JSONObject params = new JSONObject();
                 JSONObject params = new JSONObject();
                 String userId = userList.getUserId();
                 String userId = userList.getUserId();
@@ -56,26 +63,39 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                 JSONArray userArr = new JSONArray();
                 JSONArray userArr = new JSONArray();
                 userArr.add(userId);
                 userArr.add(userId);
                 params.put("useridlist", userArr);
                 params.put("useridlist", userArr);
-                params.put("starttime", 1598889600);
-                params.put("endtime", 1600099200);
-                String resultStr = HttpUtils.httpPostRequestTest(QYWxConstant.QYWX_CHECKIN_DATA + "?access_token=" + qywxAccessToken.get("accessToken"), params.toJSONString(), null);
+                params.put(API_START_TIME, starttime);
+                params.put(API_END_TIME, endtime);
+                String resultStr = HttpUtils.httpPostRequestTest(QYWxConstant.QYWX_CHECKIN_DATA + "?access_token=" + qywxAccessToken.get(ACCESS_TOKEN), params.toJSONString(), null);
                 JSONObject resultJson = JSONObject.parseObject(resultStr);
                 JSONObject resultJson = JSONObject.parseObject(resultStr);
-                Integer errcode = resultJson.getInteger("errcode");
-                if (errcode == 0) {
+                if (resultJson.getInteger(ERR_CODE) == 0) {
                     JSONArray checkindata = resultJson.getJSONArray("checkindata");
                     JSONArray checkindata = resultJson.getJSONArray("checkindata");
                     if (!Check.isNull(checkindata)) {
                     if (!Check.isNull(checkindata)) {
+                        StringBuffer buf = null;
+                        String checkinType = "";
+                        String checkinTypeCode = "";
                         for (int i = 0; i < checkindata.size(); i++) {
                         for (int i = 0; i < checkindata.size(); i++) {
                             JSONObject jsonObject = checkindata.getJSONObject(i);
                             JSONObject jsonObject = checkindata.getJSONObject(i);
+                            if ("JiLei".equals(userId)) {
+                                System.out.println(jsonObject);
+                            }
                             if (!Check.isNull(jsonObject)) {
                             if (!Check.isNull(jsonObject)) {
                                 WechatCheckinData checkinData = new WechatCheckinData();
                                 WechatCheckinData checkinData = new WechatCheckinData();
+                                checkinType = jsonObject.getString("checkin_type");
+                                //1上班,2下班
+                                checkinTypeCode = "上班打卡".equals(checkinType) ? NoEn.NO1.valueStr() : NoEn.NO2.valueStr();
+                                //下班打卡时间
+                                Long checkinTimeStamp = jsonObject.getLong("checkin_time");
+                                Date checkDate = DateUtils.stampToTime(checkinTimeStamp);
+                                String dateStr = DateUtils.formatDate(checkDate);
+                                long dateLong = DateUtils.timeToStamp(dateStr + DAY_BEGIN);
+                                buf = new StringBuffer();
+                                String id = buf.append(userId).append("_").append(checkinTypeCode).append("_").append(dateLong).toString();
+                                checkinData.setId(id);
                                 checkinData.setDepartId(departId);
                                 checkinData.setDepartId(departId);
                                 checkinData.setUserId(userId);
                                 checkinData.setUserId(userId);
-                                checkinData.setCheckinType(jsonObject.getString("checkin_type"));
-                                Long checkinTimeStamp = jsonObject.getLong("checkin_time"); //下班打卡时间
-                                java.util.Date checkDate = DateUtils.stampToTime(checkinTimeStamp);
+                                checkinData.setCheckinType(checkinType);
                                 checkinData.setCheckinTime(checkDate);
                                 checkinData.setCheckinTime(checkDate);
-                                String dateStr = DateUtils.formatDate(checkDate) + " 21:30:00";
-                                Long dateStamp = DateUtils.timeToStamp(dateStr); // 每天九点半时间戳
+                                Long dateStamp = DateUtils.timeToStamp(dateStr + " 21:30:00"); // 每天九点半时间戳
                                 if (checkinTimeStamp >= dateStamp) {
                                 if (checkinTimeStamp >= dateStamp) {
                                     checkinData.setOvertimeOrNot(1);
                                     checkinData.setOvertimeOrNot(1);
                                     String overtimeStr = DateUtils.formatDate(checkDate) + " 19:00:00";
                                     String overtimeStr = DateUtils.formatDate(checkDate) + " 19:00:00";
@@ -94,21 +114,41 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                                 checkinData.setWifimac(jsonObject.getString("wifimac"));
                                 checkinData.setWifimac(jsonObject.getString("wifimac"));
                                 checkinData.setMediaids(jsonObject.getJSONArray("mediaids").toJSONString());
                                 checkinData.setMediaids(jsonObject.getJSONArray("mediaids").toJSONString());
                                 checkinData.setLat(jsonObject.getString("lat"));
                                 checkinData.setLat(jsonObject.getString("lat"));
-                                this.save(checkinData);
+                                this.saveOrUpdate(checkinData);
                             }
                             }
                         }
                         }
                     }
                     }
-
                 } else {
                 } else {
                     log.error("获取打卡数据异常");
                     log.error("获取打卡数据异常");
                 }
                 }
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("员工考勤入库异常,", e);
         }
         }
-
-
     }
     }
 
 
-
+    @Override
+    public PageInfo<WechatCheckinData> selectPageList(Map<String, Object> paramsMap) {
+        Integer pageNo = (Integer) paramsMap.get(PAGE_NO);
+        if (null == pageNo || pageNo == 0) {
+            pageNo = 1;
+        }
+        Integer pageSize = (Integer) paramsMap.get(PAGE_SIZE);
+        if (null == pageSize || pageSize == 0) {
+            pageSize = 10;
+        }
+        String startTime = (String) paramsMap.get(START_TIME);
+        if (!Check.isNull(startTime)) {
+            startTime += DAY_BEGIN;
+            paramsMap.put(START_TIME, startTime);
+        }
+        String stopTime = (String) paramsMap.get(STOP_TIME);
+        if (!Check.isNull(stopTime)) {
+            stopTime += DAY_END;
+            paramsMap.put(STOP_TIME, stopTime);
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        List<WechatCheckinData> list = wechatCheckinDataMapper.selectPageList(paramsMap);
+        return new PageInfo<>(list);
+    }
 }
 }

+ 5 - 11
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatDepartmentServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.TreeMap;
 
 
@@ -34,7 +35,6 @@ public class WechatDepartmentServiceImpl extends ServiceImpl<WechatDepartmentMap
     @Autowired
     @Autowired
     private WechatDepartmentMapper wechatDepartmentMapper;
     private WechatDepartmentMapper wechatDepartmentMapper;
 
 
-
     @Override
     @Override
     public void getDepartment() {
     public void getDepartment() {
         try {
         try {
@@ -43,11 +43,8 @@ public class WechatDepartmentServiceImpl extends ServiceImpl<WechatDepartmentMap
                 log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
                 log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
                 throw new Exception("企业微信获取token失败");
                 throw new Exception("企业微信获取token失败");
             }
             }
-
-
             TreeMap<String, Object> params = new TreeMap<>();
             TreeMap<String, Object> params = new TreeMap<>();
             params.put("access_token", qywxAccessToken.get("accessToken"));
             params.put("access_token", qywxAccessToken.get("accessToken"));
-
             String resultStr = HttpUtils.httpGetRequest(QYWxConstant.QYWX_DEPART_LIST, null, params);
             String resultStr = HttpUtils.httpGetRequest(QYWxConstant.QYWX_DEPART_LIST, null, params);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
             System.err.println(resultJson);
             System.err.println(resultJson);
@@ -71,22 +68,19 @@ public class WechatDepartmentServiceImpl extends ServiceImpl<WechatDepartmentMap
                             depart.setParentId(departJson.getString("parentid"));
                             depart.setParentId(departJson.getString("parentid"));
                             depart.setDepartOrder(departJson.getString("order"));
                             depart.setDepartOrder(departJson.getString("order"));
                             wechatDepartmentMapper.insert(depart);
                             wechatDepartmentMapper.insert(depart);
-
                         }
                         }
-
                     }
                     }
-
                 }
                 }
-
-
             } else {
             } else {
                 throw new Exception("企业微信获取部门列表");
                 throw new Exception("企业微信获取部门列表");
-
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
+    }
 
 
-
+    @Override
+    public List<WechatDepartment> queryList() {
+        return wechatDepartmentMapper.queryList();
     }
     }
 }
 }

+ 388 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java

@@ -0,0 +1,388 @@
+package cn.com.ctop.oa.modules.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.oa.modules.constant.QYWxConstant;
+import cn.com.ctop.oa.modules.entity.WechatAttendance;
+import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.entity.WechatNoList;
+import cn.com.ctop.oa.modules.enums.SpNoEnum;
+import cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper;
+import cn.com.ctop.oa.modules.mapper.WechatNoListMapper;
+import cn.com.ctop.oa.modules.service.IWechatNoListService;
+import cn.com.ctop.oa.modules.service.IWechatTokenService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.xxl.job.core.enums.NoEn;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.jeecg.common.constant.GeneralConstant.*;
+
+/**
+ * 审批信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-23
+ */
+@Service
+@Slf4j
+public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, WechatNoList> implements IWechatNoListService {
+    @Autowired
+    private IWechatTokenService tokenService;
+    @Autowired
+    private WechatNoListMapper wechatNoListMapper;
+    @Autowired
+    private WechatCheckinDataMapper wechatCheckinDataMapper;
+
+    /**
+     * 获取审批token
+     *
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     * @Param []
+     */
+    private String getToken() throws Exception {
+        Map<String, Object> approvaAccessToken = tokenService.getApprovaAccessToken();
+        if ((Integer) approvaAccessToken.get("code") != 0) {
+            log.error("企业微信获取token失败,返回信息:{}", approvaAccessToken.get("message"));
+            throw new Exception("企业微信获取token失败");
+        }
+        return approvaAccessToken.get("accessToken").toString();
+    }
+
+    @Override
+    public JSONObject getNoList(Integer page, String starttime, String endtime) {
+        try {
+            JSONObject params = new JSONObject();
+            params.put("starttime", starttime);
+            params.put("endtime", endtime);
+            params.put("cursor", page);
+            params.put("size", 100);
+            StringBuffer buf = new StringBuffer();
+            //批量获取审批单号 URL
+            buf.append(QYWxConstant.APP_ROVAL_INFO).append("?access_token=").append(getToken());
+            System.err.println(buf.toString());
+            String resultStr = HttpUtils.httpPostRequestTest(buf.toString(), params.toJSONString(), null);
+            JSONObject resultJson = JSONObject.parseObject(resultStr);
+            System.err.println(resultJson);
+            Integer errcode = resultJson.getInteger("errcode");
+            if (errcode == 0) {
+                return resultJson;
+            } else {
+                throw new Exception("批量获取审批单号");
+            }
+        } catch (Exception e) {
+            log.error("批量获取审批单号异常", e);
+        }
+        return new JSONObject();
+    }
+
+    //递归获取审批数据
+    private JSONArray getAllNoList(Integer page, JSONArray spNoList, String starttime, String endtime) {
+        JSONObject data = getNoList(page, starttime, endtime);
+        spNoList.addAll(data.getJSONArray("sp_no_list"));
+        Integer nextCursor = data.getInteger("next_cursor");
+        if (!Check.isNull(nextCursor)) {
+            return getAllNoList(nextCursor, spNoList, starttime, endtime);
+        }
+        return spNoList;
+    }
+
+    @Override
+    public void getNoDateByNo(String starttime, String endtime) {
+        Map<String, Object> returnMap = new HashMap<>();
+        try {
+            Integer page = 0;
+            JSONArray noList = getAllNoList(page, new JSONArray(), starttime, endtime);
+            boolean sleep = false;
+            if (noList.size() > 600) {
+                sleep = true;
+            }
+            if (!Check.isNull(noList)) {
+                StringBuffer buf = new StringBuffer();
+                //获取审批申请详情 URL;
+                buf.append(QYWxConstant.APP_ROVAL_DETAIL).append("?access_token=").append(getToken());
+                String userId = null;
+                Map<String, String> parameterMap = null;
+                for (Object spNo : noList) {
+                    parameterMap = new HashMap<>();
+                    //接口频率限制 600次/分钟
+                    if (sleep) {
+                        Thread.sleep(100);
+                    }
+                    JSONObject params = new JSONObject();
+                    params.put("sp_no", spNo);
+                    String resultStr = HttpUtils.httpPostRequestTest(buf.toString(), params.toJSONString(), null);
+                    JSONObject resultJson = JSONObject.parseObject(resultStr);
+                    Integer errcode = resultJson.getInteger("errcode");
+                    if (errcode == 0) {
+                        JSONObject info = resultJson.getJSONObject("info");
+                        String spStatus = info.getString("sp_status");
+                        String spName = info.getString("sp_name");
+                        /**申请单状态:1-审批中;2-已通过,只记录这两种状态数据
+                         * 而且只记录请假、打卡补卡类型
+                         **/
+                        boolean statusisOK = "2".equals(spStatus) || "1".equals(spStatus);
+                        boolean typeisOK = spName.contains("打卡补卡") || spName.contains("请假") || spName.contains("外出") || spName.contains("出差");
+                        if (statusisOK && typeisOK) {
+                            JSONObject applyer = info.getJSONObject("applyer");
+                            if (!Check.isNull(applyer)) {
+                                userId = applyer.getString("userid");
+                                if ("LiuJing".equals(userId)) {
+                                    System.out.println(info);
+                                }
+                            }
+                            //审批申请数据
+                            JSONObject applyData = info.getJSONObject("apply_data");
+                            //获取审批状态数据
+                            getParameterMap(applyData, parameterMap);
+                            WechatNoList noEntity = new WechatNoList();
+                            noEntity.setUserId(userId);
+                            noEntity.setSpNo(spNo.toString());
+                            noEntity.setStatus(spStatus);
+                            if (!Check.isNull(parameterMap.get("newBegin"))) {
+                                noEntity.setNewBegin(DateUtils.stampToTime(Long.valueOf(parameterMap.get("newBegin"))));
+                            }
+                            if (!Check.isNull(parameterMap.get("newEnd"))) {
+                                noEntity.setNewEnd(DateUtils.stampToTime(Long.valueOf(parameterMap.get("newEnd"))));
+                            }
+                            noEntity.setType(parameterMap.get(TYPE));
+                            noEntity.setNewDuration(parameterMap.get("newDuration"));
+                            wechatNoListMapper.insert(noEntity);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            returnMap.put("code", -1);
+            returnMap.put("message", "系统错误");
+            log.error("审批异常", e);
+        }
+    }
+
+    /**
+     * 获取审批状态数据
+     *
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     * @Param [applyData, parameterMap]
+     */
+    private void getParameterMap(JSONObject applyData, Map<String, String> parameterMap) {
+        String control = null;
+        if (!Check.isNull(applyData)) {
+            //审批申请详情,由多个表单控件及其内容组成
+            JSONArray contents = applyData.getJSONArray("contents");
+            if (!Check.isNull(contents)) {
+                for (int i = 0; i < contents.size(); i++) {
+                    //获取content 对象数据
+                    JSONObject contentEntity = contents.getJSONObject(i);
+                    if (!Check.isNull(contentEntity)) {
+                        control = contentEntity.getString("control");
+                        //如果补卡组件为PunchCorrection,直接判断为补卡
+                        if (SpNoEnum.control3.getCode().equals(control)) {
+                            JSONObject value = contentEntity.getJSONObject(VALUE);
+                            if (!Check.isNull(value)) {
+                                JSONObject punch = value.getJSONObject("punch_correction");
+                                if (!Check.isNull(punch)) {
+                                    parameterMap.put(TYPE, SpNoEnum.type2.getName());
+                                    parameterMap.put("newBegin", punch.getString("time"));
+                                    parameterMap.put("newEnd", punch.getString("time"));
+                                }
+                            }
+                            //假勤组件-请假组件 Vacation
+                        } else if (SpNoEnum.control2.getCode().equals(control)) {
+                            JSONObject value = contentEntity.getJSONObject(VALUE);
+                            if (!Check.isNull(value)) {
+                                JSONObject vacation = value.getJSONObject("vacation");
+                                if (!Check.isNull(vacation)) {
+                                    JSONObject selector = vacation.getJSONObject("selector");
+                                    if (!Check.isNull(selector)) {
+                                        getVacation(selector, parameterMap);
+                                    }
+                                    JSONObject attendance = vacation.getJSONObject("attendance");
+                                    if (!Check.isNull(attendance)) {
+                                        getTimeData(attendance, parameterMap);
+                                    }
+                                }
+                            }
+                            //假勤组件-出差/外出/加班组件Attendance
+                        } else if (SpNoEnum.control1.getCode().equals(control)) {
+                            JSONObject value = contentEntity.getJSONObject(VALUE);
+                            if (!Check.isNull(value)) {
+                                JSONObject attendance = value.getJSONObject("attendance");
+                                if (!Check.isNull(attendance)) {
+                                    getTimeData(attendance, parameterMap);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 获取组件中的假勤类型,假勤开始、结束时间以及时长。
+     *
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     * @Param [attendance, parameterMap]
+     */
+    private void getTimeData(JSONObject attendance, Map<String, String> parameterMap) {
+        String type = attendance.getString(TYPE);
+        //假勤类型,排除类型为1的请假,因为有具体的请假类型,例如:年假,事假等具体类型
+        if (!NoEn.NO1.valueStr().equals(type)) {
+            parameterMap.put(TYPE, SpNoEnum.getSpNoEnum(type).getName());
+        }
+        JSONObject dateRange = attendance.getJSONObject("date_range");
+        if (!Check.isNull(dateRange)) {
+            parameterMap.put("newBegin", dateRange.getString("new_begin"));
+            parameterMap.put("newEnd", dateRange.getString("new_end"));
+            BigDecimal duration = dateRange.getBigDecimal("new_duration");
+            if (!Check.isNull(duration)) {
+                //除以3600,取小时数
+                BigDecimal second = new BigDecimal(3600);
+                parameterMap.put("newDuration", String.valueOf(duration.divide(second, 1, 4)));
+            }
+        }
+    }
+
+    /**
+     * 获取假期类型
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void getVacation(JSONObject selector, Map<String, String> parameterMap) {
+        JSONArray options = selector.getJSONArray("options");
+        if (!Check.isNull(options)) {
+            for (int j = 0; j < options.size(); j++) {
+                JSONObject option = options.getJSONObject(j);
+                JSONArray values = option.getJSONArray(VALUE);
+                if (!Check.isNull(values)) {
+                    for (int k = 0; k < values.size(); k++) {
+                        JSONObject val = values.getJSONObject(k);
+                        parameterMap.put(TYPE, val.getString("text"));
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap) {
+        finishingTime(paramsMap);
+        List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
+        if (!Check.isNull(list)) {
+            checkOverTimeData(list);
+        }
+        return list;
+    }
+
+    /**
+     * 整理时间
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void finishingTime(Map<String, Object> paramsMap) {
+        String startTime = (String) paramsMap.get(START_TIME);
+        if (!Check.isNull(startTime)) {
+            startTime += DAY_BEGIN;
+            paramsMap.put(START_TIME, startTime);
+        }
+        String stopTime = (String) paramsMap.get(STOP_TIME);
+        if (!Check.isNull(stopTime)) {
+            stopTime += DAY_END;
+            paramsMap.put(STOP_TIME, stopTime);
+        }
+    }
+
+    @Override
+    public List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap) {
+        finishingTime(paramsMap);
+        return wechatNoListMapper.queryOverTimeData(paramsMap);
+    }
+
+    @Override
+    public PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap) {
+        finishingTime(paramsMap);
+        Integer pageNo = (Integer) paramsMap.get(PAGE_NO);
+        if (null == pageNo || pageNo == 0) {
+            pageNo = NoEn.NO1.valueInt();
+        }
+        Integer pageSize = (Integer) paramsMap.get(PAGE_SIZE);
+        if (null == pageSize || pageSize == 0) {
+            pageSize = NoEn.NO10.valueInt();
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
+        if (!Check.isNull(list)) {
+            checkOverTimeData(list);
+        }
+        return new PageInfo<>(list);
+    }
+
+    /**
+     * 筛选10:30以后打卡的迟到数据,判断前一天是否加班,更新迟到时长
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void checkOverTimeData(List<WechatAttendance> list) {
+        for (WechatAttendance attendance : list) {
+            if ("迟到".equals(attendance.getType())) {
+                Integer dur = Integer.valueOf(attendance.getStateDuration().replace(" min", ""));
+                if (dur - 60 >= 0) {
+                    String checkinDate = attendance.getCheckinDate();
+                    String lastDay = DateUtils.getLastDay(checkinDate);
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("userId", attendance.getUserId());
+                    map.put("checkinDate", lastDay);
+                    map.put("checkinType", "下班打卡");
+                    WechatCheckinData data = wechatCheckinDataMapper.queryEntityByMap(map);
+                    if (!Check.isNull(data) && 1 == data.getOvertimeOrNot()) {
+                        attendance.setStateDuration((dur - 60) + " min");
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public PageInfo<WechatAttendance> selectOverTimePage(Map<String, Object> paramsMap) {
+        finishingTime(paramsMap);
+        Integer pageNo = (Integer) paramsMap.get("pageNo");
+        if (null == pageNo || pageNo == 0) {
+            pageNo = 1;
+        }
+        Integer pageSize = (Integer) paramsMap.get("pageSize");
+        if (null == pageSize || pageSize == 0) {
+            pageSize = 10;
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        List<WechatAttendance> list = wechatNoListMapper.queryOverTimeData(paramsMap);
+        return new PageInfo<>(list);
+    }
+}

+ 30 - 7
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatTokenServiceImpl.java

@@ -14,7 +14,6 @@ import java.util.TreeMap;
 public class WechatTokenServiceImpl implements IWechatTokenService {
 public class WechatTokenServiceImpl implements IWechatTokenService {
     public Map<String, Object> getQYWXAccessToken() {
     public Map<String, Object> getQYWXAccessToken() {
         Map<String, Object> returnMap = new HashMap<>();
         Map<String, Object> returnMap = new HashMap<>();
-
         try {
         try {
             TreeMap<String, Object> params = new TreeMap<>();
             TreeMap<String, Object> params = new TreeMap<>();
             params.put("corpid", QYWxConstant.QYWX_CORP_ID);
             params.put("corpid", QYWxConstant.QYWX_CORP_ID);
@@ -26,8 +25,6 @@ public class WechatTokenServiceImpl implements IWechatTokenService {
             if (errcode == 0) {
             if (errcode == 0) {
                 returnMap.put("code", 0);
                 returnMap.put("code", 0);
                 returnMap.put("accessToken", resultJson.getString("access_token"));
                 returnMap.put("accessToken", resultJson.getString("access_token"));
-
-
             } else {
             } else {
                 returnMap.put("code", errcode);
                 returnMap.put("code", errcode);
                 returnMap.put("message", resultJson.getString("errmsg"));
                 returnMap.put("message", resultJson.getString("errmsg"));
@@ -36,13 +33,11 @@ public class WechatTokenServiceImpl implements IWechatTokenService {
             returnMap.put("code", -1);
             returnMap.put("code", -1);
             returnMap.put("message", "系统错误");
             returnMap.put("message", "系统错误");
         }
         }
-
         return returnMap;
         return returnMap;
     }
     }
 
 
     public Map<String, Object> getOAAccessToken() {
     public Map<String, Object> getOAAccessToken() {
         Map<String, Object> returnMap = new HashMap<>();
         Map<String, Object> returnMap = new HashMap<>();
-
         try {
         try {
             TreeMap<String, Object> params = new TreeMap<>();
             TreeMap<String, Object> params = new TreeMap<>();
             params.put("corpid", QYWxConstant.QYWX_CORP_ID);
             params.put("corpid", QYWxConstant.QYWX_CORP_ID);
@@ -54,8 +49,6 @@ public class WechatTokenServiceImpl implements IWechatTokenService {
             if (errcode == 0) {
             if (errcode == 0) {
                 returnMap.put("code", 0);
                 returnMap.put("code", 0);
                 returnMap.put("accessToken", resultJson.getString("access_token"));
                 returnMap.put("accessToken", resultJson.getString("access_token"));
-
-
             } else {
             } else {
                 returnMap.put("code", errcode);
                 returnMap.put("code", errcode);
                 returnMap.put("message", resultJson.getString("errmsg"));
                 returnMap.put("message", resultJson.getString("errmsg"));
@@ -64,7 +57,37 @@ public class WechatTokenServiceImpl implements IWechatTokenService {
             returnMap.put("code", -1);
             returnMap.put("code", -1);
             returnMap.put("message", "系统错误");
             returnMap.put("message", "系统错误");
         }
         }
+        return returnMap;
+    }
 
 
+    /**
+     * @return java.util.Map<java.lang.String, java.lang.Object>
+     * @throws 获取审批
+     * @author ZHAOXA
+     * @Param []
+     */
+    @Override
+    public Map<String, Object> getApprovaAccessToken() {
+        Map<String, Object> returnMap = new HashMap<>();
+        try {
+            TreeMap<String, Object> params = new TreeMap<>();
+            params.put("corpid", QYWxConstant.QYWX_CORP_ID);
+            params.put("corpsecret", QYWxConstant.QYWX_APPROVA_CORP_SECRET);
+            String resultStr = HttpUtils.httpGetRequest(QYWxConstant.QYWX_API_URL + QYWxConstant.QYWX_GET_TOKEN, null, params);
+            //System.out.println(resultStr);
+            JSONObject resultJson = JSONObject.parseObject(resultStr);
+            Integer errcode = resultJson.getInteger("errcode");
+            if (errcode == 0) {
+                returnMap.put("code", 0);
+                returnMap.put("accessToken", resultJson.getString("access_token"));
+            } else {
+                returnMap.put("code", errcode);
+                returnMap.put("message", resultJson.getString("errmsg"));
+            }
+        } catch (Exception e) {
+            returnMap.put("code", -1);
+            returnMap.put("message", "系统错误");
+        }
         return returnMap;
         return returnMap;
     }
     }
 
 

+ 0 - 14
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatUserListServiceImpl.java

@@ -30,7 +30,6 @@ import java.util.TreeMap;
 @Service
 @Service
 @Slf4j
 @Slf4j
 public class WechatUserListServiceImpl extends ServiceImpl<WechatUserListMapper, WechatUserList> implements IWechatUserListService {
 public class WechatUserListServiceImpl extends ServiceImpl<WechatUserListMapper, WechatUserList> implements IWechatUserListService {
-
     @Autowired
     @Autowired
     private IWechatTokenService tokenService;
     private IWechatTokenService tokenService;
     @Autowired
     @Autowired
@@ -44,17 +43,12 @@ public class WechatUserListServiceImpl extends ServiceImpl<WechatUserListMapper,
                 log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
                 log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
                 throw new Exception("企业微信获取token失败");
                 throw new Exception("企业微信获取token失败");
             }
             }
-
-
             TreeMap<String, Object> params = new TreeMap<>();
             TreeMap<String, Object> params = new TreeMap<>();
             params.put("access_token", qywxAccessToken.get("accessToken"));
             params.put("access_token", qywxAccessToken.get("accessToken"));
-
-
             List<WechatDepartment> list = departmentService.list();
             List<WechatDepartment> list = departmentService.list();
             if (Check.isNull(list)) {
             if (Check.isNull(list)) {
                 return;
                 return;
             }
             }
-
             for (WechatDepartment department : list) {
             for (WechatDepartment department : list) {
                 params.remove("department_id");
                 params.remove("department_id");
                 String departId = department.getDepartId();
                 String departId = department.getDepartId();
@@ -77,20 +71,12 @@ public class WechatUserListServiceImpl extends ServiceImpl<WechatUserListMapper,
                                 userList.setUserName(userJson.getString("name"));
                                 userList.setUserName(userJson.getString("name"));
                                 this.saveOrUpdate(userList);
                                 this.saveOrUpdate(userList);
                             }
                             }
-
                         }
                         }
-
                     }
                     }
-
-
                 } else {
                 } else {
                     throw new Exception("企业微信获取用户列表失败");
                     throw new Exception("企业微信获取用户列表失败");
-
                 }
                 }
-
             }
             }
-
-
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }

+ 0 - 23
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceCleanMaterialService.java

@@ -1,23 +0,0 @@
-package cn.com.ctop.toutiao.modules.material.service;
-
-import java.util.List;
-
-/**
- * @author 宋英豪
- * @date 2020年5月9日09:52:48
- */
-public interface IBytedanceCleanMaterialService {
-    /**
-     * 头条 唯一素材MD5标识
-     *
-     * @return
-     */
-    List<String> getSignature();
-
-    /**
-     * 计算头条素材报表
-     *
-     * @param signature
-     */
-    void calculationMaterialReport(String signature);
-}

+ 0 - 46
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceCleanMaterialServiceImpl.java

@@ -1,46 +0,0 @@
-package cn.com.ctop.toutiao.modules.material.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.material.service.IBytedanceCleanMaterialService;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class BytedanceCleanMaterialServiceImpl implements IBytedanceCleanMaterialService {
-    @Autowired
-    private BytedanceCreativeDailyReportMapper bytedanceCreativeDailyReportMapper;
-    @Autowired
-    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
-
-    /**
-     * MD5 集合
-     *
-     * @return
-     */
-    @Override
-    public List<String> getSignature() {
-        return bytedanceCreativeDailyReportMapper.getSignatureList();
-    }
-
-    /**
-     * 头条素材报表
-     *
-     * @param signature
-     */
-    @Override
-    public void calculationMaterialReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            byteDanceCleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java

@@ -15,4 +15,6 @@ public class ImageCostVO implements Serializable {
     private Long click;
     private Long click;
     private Long showNum;
     private Long showNum;
     private Long convert;
     private Long convert;
+    private String userId;
+    private String userName;
 }
 }

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/ByteDanceCleanMaterialReportController.java

@@ -1,9 +1,9 @@
 package cn.com.ctop.toutiao.modules.report.controller;
 package cn.com.ctop.toutiao.modules.report.controller;
 
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.common.module.utils.StringUtils;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceCreativeDailyReportMapper.java

@@ -1,6 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 package cn.com.ctop.toutiao.modules.report.mapper;
 
 
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceCreativeDailyReportMapper.xml

@@ -233,7 +233,7 @@
       WHERE signature !=''
       WHERE signature !=''
     </select>
     </select>
     <select id="calculationMaterialReport"
     <select id="calculationMaterialReport"
-            resultType="cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport">
+            resultType="cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport">
         select
         select
         signature id,
         signature id,
         sum(cost) cost,
         sum(cost) cost,

+ 2 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml

@@ -245,10 +245,9 @@
         sum(report.convert_material)                                  as 'convert',
         sum(report.convert_material)                                  as 'convert',
         imageInfo.image_url                                           as 'imageUrl',
         imageInfo.image_url                                           as 'imageUrl',
         imageInfo.signature                                           as 'signature',
         imageInfo.signature                                           as 'signature',
-        group_concat(distinct allocation.project_name)                as 'projectName',
+        group_concat(distinct report.project_name)                as 'projectName',
         report.stat_datetime                                          as 'statDate'
         report.stat_datetime                                          as 'statDate'
-            from ctop_bytedance_report_material_daily report
-            left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+            from ctop_bytedance_report_image_daily report
             left join ctop_bytedance_image_info imageInfo on imageInfo.material_id = report.material_id
             left join ctop_bytedance_image_info imageInfo on imageInfo.material_id = report.material_id
         where
         where
         1=1
         1=1

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceCreativeDailyReportService.java

@@ -18,6 +18,9 @@ public interface IBytedanceCreativeDailyReportService extends IService<Bytedance
 
 
     List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReportList(JSONObject json);
     List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReportList(JSONObject json);
 
 
+    List<String> getSignatureList();
 
 
     void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports);
     void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports);
+
+    void calculationMaterialReport(String signature);
 }
 }

+ 0 - 5
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceReportMaterialDailyService.java

@@ -2,11 +2,9 @@ package cn.com.ctop.toutiao.modules.report.service;
 
 
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * 素材报表
  * 素材报表
@@ -15,9 +13,6 @@ import java.util.Map;
  * @version V1.0
  * @version V1.0
  */
  */
 public interface IBytedanceReportMaterialDailyService extends IService<BytedanceReportMaterialDaily> {
 public interface IBytedanceReportMaterialDailyService extends IService<BytedanceReportMaterialDaily> {
-
     List<BytedanceReportMaterialDaily> getListByParams(String date);
     List<BytedanceReportMaterialDaily> getListByParams(String date);
     List<BytedanceVideoVo> getVideoVoByDate(String date);
     List<BytedanceVideoVo> getVideoVoByDate(String date);
-
-    Map<String,Object> bytedanceImageCost(JSONObject data);
 }
 }

+ 0 - 54
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceCleanMaterialReportServiceImpl.java

@@ -1,54 +0,0 @@
-package cn.com.ctop.toutiao.modules.report.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.mapper.ByteDanceCleanMaterialReportMapper;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 头条-数据清洗
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-25
- */
-@Service
-@Primary
-
-public class ByteDanceCleanMaterialReportServiceImpl extends ServiceImpl<ByteDanceCleanMaterialReportMapper, ByteDanceCleanMaterialReport> implements IByteDanceCleanMaterialReportService {
-    @Autowired
-    private BytedanceCreativeDailyReportMapper bytedanceCreativeDailyReportMapper;
-
-    /**
-     * 头条MD5 集合
-     *
-     * @return
-     */
-    @Override
-    public List<String> getSignature() {
-        return bytedanceCreativeDailyReportMapper.getSignatureList();
-    }
-
-    /**
-     * 头条素材报表
-     *
-     * @param signature
-     */
-    @Override
-    public void calculationMaterialReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            this.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

+ 20 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceCreativeDailyReportServiceImpl.java

@@ -1,6 +1,8 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
 
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import cn.com.ctop.common.module.mapper.SysRoleExtMapper;
 import cn.com.ctop.common.module.mapper.SysRoleExtMapper;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
@@ -64,8 +66,26 @@ public class BytedanceCreativeDailyReportServiceImpl extends ServiceImpl<Bytedan
     }
     }
 
 
     @Override
     @Override
+    public List<String> getSignatureList() {
+        return bytedanceCreativeDailyReportMapper.getSignatureList();
+    }
+
+    @Override
     public void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports) {
     public void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports) {
         bytedanceCreativeDailyReportMapper.replaceBatch(dailyReports);
         bytedanceCreativeDailyReportMapper.replaceBatch(dailyReports);
     }
     }
 
 
+    @Override
+    public void calculationMaterialReport(String signature) {
+        if (Check.isNull(signature)) {
+            return;
+        }
+        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
+        if (!Check.isNull(calculationMaterialReport)) {
+            byteDanceCleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
+        }
+    }
+    @Autowired
+    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+
 }
 }

+ 0 - 45
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java

@@ -1,25 +1,16 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
 
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
-import cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * 素材报表
  * 素材报表
@@ -48,41 +39,5 @@ public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<Bytedan
         return bytedanceReportMaterialDailyMapper.getVideoVoByDate(date);
         return bytedanceReportMaterialDailyMapper.getVideoVoByDate(date);
     }
     }
 
 
-    @Override
-    public Map<String,Object> bytedanceImageCost(JSONObject data) {
-        Map<String,Object>result = new HashMap<>();
-        String startDate = data.getString("startDate");
-        if(null == startDate||startDate.trim().equals("")){
-            startDate = null;
-        }
-        String endDate = data.getString("endDate");
-        if(null == endDate||endDate.trim().equals("")){
-            endDate = null;
-        }
-        JSONArray accountList = data.getJSONArray("accountList");
-        if(null==accountList||accountList.isEmpty()){
-            accountList = null;
-        }
-        String code = data.getString("code");
-        if(null == code||code.trim().equals("")){
-            code = null;
-        }
-        Integer pageSize = data.getInteger("pageSize");
-        Integer pageNumber = data.getInteger("pageNumber");
-        if(null == pageNumber||pageNumber ==0){
-            pageNumber = 1;
-        }
-        if(null == pageSize||pageSize ==0){
-            pageSize = 10;
-        }
-        PageHelper.startPage(pageNumber,pageSize);
-        List<ImageCostVO>vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
-        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
-        result.put("data",pageInfo);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-
-    }
-
 
 
 }
 }

+ 3 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

@@ -915,7 +915,9 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
                         daily.setInAppUv(metrics.getInteger("in_app_uv"));
                         daily.setInAppUv(metrics.getInteger("in_app_uv"));
                         daily.setRegister(metrics.getInteger("register"));
                         daily.setRegister(metrics.getInteger("register"));
                         daily.setConvertCost(metrics.getBigDecimal("convert_cost"));
                         daily.setConvertCost(metrics.getBigDecimal("convert_cost"));
-
+//                        if(){
+//
+//                        }
                         bytedanceReportMaterialDailyList.add(daily);
                         bytedanceReportMaterialDailyList.add(daily);
                     }
                     }
                 }
                 }