瀏覽代碼

Merge remote-tracking branch 'origin/master'

songyh 4 年之前
父節點
當前提交
a1220fdcf2
共有 27 個文件被更改,包括 865 次插入208 次删除
  1. 22 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  2. 7 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BidWarningServiceImpl.java
  3. 6 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CpaBidWarningServiceImpl.java
  4. 19 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/orderplatform/util/ApprovalNodeNoticeHandler.java
  5. 17 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  6. 27 23
      module-check/src/main/java/cn/com/ctop/notice/handler/SendWeChatHandle.java
  7. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/CtopCorpWexinUser.java
  8. 86 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/WexinConfig.java
  9. 4 3
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MailLogMapper.java
  10. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/WexinConfigMapper.java
  11. 6 6
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MailLogMapper.xml
  12. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/WexinConfigMapper.xml
  13. 16 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IWexinConfigService.java
  14. 7 4
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java
  15. 6 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SendMessageServiceImpl.java
  16. 29 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/WexinConfigServiceImpl.java
  17. 45 31
      module-common/src/main/java/cn/com/ctop/common/module/utils/CorpWexinUtils.java
  18. 36 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java
  19. 9 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java
  20. 451 79
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  21. 4 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml
  22. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java
  23. 7 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/AccountWarningServiceImpl.java
  24. 17 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java
  25. 6 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/KuaishouBidWarningServiceImpl.java
  26. 6 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceBidWarningServiceImpl.java
  27. 7 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceHourlyAccountWarningServiceImpl.java

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
+import cn.com.ctop.common.module.mapper.MailLogMapper;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.*;
@@ -129,6 +130,10 @@ public class TestController {
     private IKuaiShouCreativeService creativeService;
     @Autowired
     private IKuaiShouGroupService groupService;
+    @Autowired
+    private MailLogMapper mailLogMapper;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
     @Autowired
     private IBatchService batchService;
@@ -139,6 +144,18 @@ public class TestController {
     @Value("${xxl-job.requestUrl}")
     private String jobUrl;
 
+    @GetMapping("/testSend")
+    public void testSend(String userId) {
+
+        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
+        if (weChatId.isEmpty()) {
+            log.error(String.format("User WeChat not found. userId =%s", userId));
+            //TODO 通知管理员添加邮箱
+        } else {
+            corpWexinUtils.sendMessageByWeChatId(weChatId, "hahahahahahah");
+        }
+    }
+
     @GetMapping("/uploadVideo")
     public String uploadVideo(Long projectId) {
 
@@ -1135,6 +1152,7 @@ public class TestController {
     @Autowired
     private IKuaishouStrategyService kuaishouStrategyService;
     static ExecutorService executorServic1e = Executors.newFixedThreadPool(5);
+
     /**
      * 勿动勿删,煜一人群报表数据拉取接口。
      *
@@ -1217,6 +1235,7 @@ public class TestController {
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
+
     @Autowired
     private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
 
@@ -1232,9 +1251,9 @@ public class TestController {
     @GetMapping("testCheckCost")
     public Map<String, Object> testCheckCost(String date) throws ParseException {
         Map<String, Object> result = new HashMap<>();
-        List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,"2021-06-01",0);
-        if(null!=taskInfos&&!taskInfos.isEmpty()){
-            for (BytedanceCheckReportTaskInfo taskInfo:taskInfos) {
+        List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, "2021-06-01", 0);
+        if (null != taskInfos && !taskInfos.isEmpty()) {
+            for (BytedanceCheckReportTaskInfo taskInfo : taskInfos) {
                 checkReportTaskInfoService.checkCost(taskInfo);
             }
         }

+ 7 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BidWarningServiceImpl.java

@@ -13,6 +13,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -42,6 +43,8 @@ public class BidWarningServiceImpl implements IBidWarningService {
     private MailLogMapper mailLogMapper;
     @Autowired
     private IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
 
     /**
@@ -62,7 +65,7 @@ public class BidWarningServiceImpl implements IBidWarningService {
                     }
                     Long maxBid = project.getMaxBid();
                     Long projectId = project.getId();
-                    List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+                    List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
                     if (!Check.isNull(userAllocations)) {
                         for (UserAllocation userAllocation : userAllocations) {
                             if (userAllocation.getAccountStatus() == 1) {
@@ -91,6 +94,7 @@ public class BidWarningServiceImpl implements IBidWarningService {
             e.printStackTrace();
         }
     }
+
     private void sendMessage(String mediaId, Long accountId, Long projectId, String projectName, String authName, List<String> unitWarning, Long maxBid) {
         String createTime = DateUtils.getNowDate("yyyy-MM-dd");
         Integer count = mailLogMapper.selectCountByAccountIdAndDate(accountId, createTime, 1);
@@ -125,8 +129,8 @@ public class BidWarningServiceImpl implements IBidWarningService {
             }
         }
 
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
     }
 
 

+ 6 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CpaBidWarningServiceImpl.java

@@ -12,6 +12,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.ICpaBidWarningService;
@@ -37,6 +38,8 @@ public class CpaBidWarningServiceImpl implements ICpaBidWarningService {
     private MailLogMapper mailLogMapper;
     @Autowired
     private IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
     /**
      * 预警
@@ -45,7 +48,7 @@ public class CpaBidWarningServiceImpl implements ICpaBidWarningService {
     public void cpaBidWarning(Project project) {
         try {
             BigDecimal maxDeepCpaBid = project.getMaxDeepCpaBid();
-            List<UserAllocation> userAllocations = userAllocationService.getByParams(project.getId(),null,null);
+            List<UserAllocation> userAllocations = userAllocationService.getByParams(project.getId(), null, null);
             if (!Check.isNull(userAllocations)) {
                 for (UserAllocation userAllocation : userAllocations) {
                     if (userAllocation.getAccountStatus() == 1) {
@@ -109,8 +112,8 @@ public class CpaBidWarningServiceImpl implements ICpaBidWarningService {
             }
         }
 
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
     }
 
 

+ 19 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/orderplatform/util/ApprovalNodeNoticeHandler.java

@@ -21,18 +21,20 @@ public class ApprovalNodeNoticeHandler {
 
     @Autowired
     IPlatformMaterialService platformMaterialService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
     /**
-     *  企业微信通知
+     * 企业微信通知
      */
-    public void NOTICE_WE_CHAT_ORDER(String operate, String orderCode){
-        Map<String, JSONObject> relatePerson=relatePerson(orderCode,null);
-        message(operate,null, relatePerson.get("orderRelatePerson"));
+    public void NOTICE_WE_CHAT_ORDER(String operate, String orderCode) {
+        Map<String, JSONObject> relatePerson = relatePerson(orderCode, null);
+        message(operate, null, relatePerson.get("orderRelatePerson"));
     }
 
-    public void NOTICE_WE_CHAT_MATERIAL(String operate, String materialCode){
-        Map<String, JSONObject> relatePerson=relatePerson(null,materialCode);
-        message(operate,relatePerson.get("materialRelatePerson"),null);
+    public void NOTICE_WE_CHAT_MATERIAL(String operate, String materialCode) {
+        Map<String, JSONObject> relatePerson = relatePerson(null, materialCode);
+        message(operate, relatePerson.get("materialRelatePerson"), null);
     }
 
     /**
@@ -40,7 +42,7 @@ public class ApprovalNodeNoticeHandler {
      */
     private Map<String, JSONObject> relatePerson(String orderCode, String materialCode) {
         Map<String, JSONObject> result = new HashMap<>();
-        if (null==materialCode) {
+        if (null == materialCode) {
             result.put("orderRelatePerson", platformMaterialService.getOrderRelatePersonByMaterialCode(orderCode));
         } else {
             result.put("materialRelatePerson", platformMaterialService.getMaterialRelatePersonByMaterialCode(materialCode));
@@ -166,12 +168,12 @@ public class ApprovalNodeNoticeHandler {
      */
     private void sendWeChat(Set<String> users, String message) {
         users.forEach(userId -> {
-            String weChatId = mailLogMapper.getWChatIdByUserId(userId);
+            JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
             if (weChatId.isEmpty()) {
                 log.error(String.format("User WeChat not found. userId =%s", userId));
                 //TODO 通知管理员添加邮箱
             } else {
-                CorpWexinUtils.sendMessageByWeChatId(weChatId, message);
+                corpWexinUtils.sendMessageByWeChatId(weChatId, message);
             }
         });
     }
@@ -180,12 +182,12 @@ public class ApprovalNodeNoticeHandler {
      * 发送通知消息到多人企业微信
      */
     private void sendWeChat(String userId, String message) {
-            String weChatId = mailLogMapper.getWChatIdByUserId(userId);
-            if (weChatId.isEmpty()) {
-                log.error(String.format("User WeChat not found. userId =%s", userId));
-                //TODO 通知管理员添加邮箱
-            } else {
-                CorpWexinUtils.sendMessageByWeChatId(weChatId, message);
-            }
+        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
+        if (weChatId.isEmpty()) {
+            log.error(String.format("User WeChat not found. userId =%s", userId));
+            //TODO 通知管理员添加邮箱
+        } else {
+            corpWexinUtils.sendMessageByWeChatId(weChatId, message);
+        }
     }
 }

+ 17 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -1,11 +1,9 @@
 package org.jeecg.modules.system.controller;
 
-import cn.com.ctop.common.module.entity.CorpFeishuUser;
-import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.entity.SysUser;
+import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.AesEncryptUtil;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.feishu.provider.AuthProvider;
@@ -69,6 +67,8 @@ public class LoginController {
     private ICorpFeishuUserService corpFeishuUserService;
     @Autowired
     private ICtopCorpWexinUserService ctopCorpWexinUserService;
+    @Autowired
+    private IWexinConfigService wexinConfigService;
     private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
 
     @GetMapping("feishu/url")
@@ -152,18 +152,23 @@ public class LoginController {
         }
     }
 
+
     @RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
     @ApiOperation("企业微信登录接口")
-    public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code) throws Exception {
+    public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code, @RequestParam(name = "corpId") String corpId) throws Exception {
         Result<JSONObject> result = new Result<>();
+        WexinConfig wexinConfig = wexinConfigService.getInfoByCorpId(corpId);
+        if (Check.isNull(wexinConfig)) {
+            result.error500("未找到用户配置,请联系管理员");
+            return result;
+        }
         val configStorage = new WxCpDefaultConfigImpl();
-        configStorage.setCorpId("ww24b8a47826f5875f");
-        configStorage.setAgentId(1000002);
-        configStorage.setCorpSecret("MJIlySADGPlgvADnkFQPUpfZD4yV-4WN6066OgNnb0s");
-        configStorage.setToken("hcst2019");
-        configStorage.setAesKey("hcst2019");
+        configStorage.setCorpId(wexinConfig.getCorpId());
+        configStorage.setAgentId(wexinConfig.getAgentId());
+        configStorage.setCorpSecret(wexinConfig.getCorpSecret());
+        configStorage.setToken(wexinConfig.getToken());
+        configStorage.setAesKey(wexinConfig.getAesKey());
         val service = new WxCpServiceImpl();
-
         service.setWxCpConfigStorage(configStorage);
         WxCpOAuth2Service wxCpOAuth2Service = service.getOauth2Service();
         try {
@@ -193,6 +198,7 @@ public class LoginController {
                 CtopCorpWexinUser ctopCorpWexinUser = ctopCorpWexinUserService.getById(sysUser.getId());
                 if (ctopCorpWexinUser == null) {
                     ctopCorpWexinUser = new CtopCorpWexinUser();
+                    ctopCorpWexinUser.setCorpId(corpId);
                     ctopCorpWexinUser.setUserId(sysUser.getId());
                     ctopCorpWexinUser.setWexinEmail(user.getEmail());
                     ctopCorpWexinUser.setWexinGender(user.getGender().getGenderName());

+ 27 - 23
module-check/src/main/java/cn/com/ctop/notice/handler/SendWeChatHandle.java

@@ -2,6 +2,7 @@ package cn.com.ctop.notice.handler;
 
 import cn.com.ctop.common.module.mapper.MailLogMapper;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -16,43 +17,46 @@ public class SendWeChatHandle {
 
     @Autowired
     MailLogMapper mailLogMapper;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
-    public void sendWeChatByMail(String mail,String message){
-        String weChatId=mailLogMapper.getWeChatByMail(mail);
-        if(weChatId.isEmpty()){
-        log.error(String.format("mail's WeChat not found. mail =%s", mail));
-        //TODO 通知管理员添加邮箱
-    }else{
-        List<String> messageList= splitMessage(message);
-        messageList.forEach(it->CorpWexinUtils.sendMessageByWeChatId(weChatId,it));
+    public void sendWeChatByMail(String mail, String message) {
+        JSONObject weChatId = mailLogMapper.getWeChatByMail(mail);
+        if (weChatId.isEmpty()) {
+            log.error(String.format("mail's WeChat not found. mail =%s", mail));
+            //TODO 通知管理员添加邮箱
+        } else {
+            List<String> messageList = splitMessage(message);
+            messageList.forEach(it -> corpWexinUtils.sendMessageByWeChatId(weChatId, it));
+        }
     }
-}
 
     /**
      * 发送多人,邮箱逗号隔开
+     *
      * @param mails
      * @param message
      */
-    public void sendWeChatByMails(String mails,String message){
-        List<String> mail= Arrays.asList(mails.split(","));
-        mail.forEach(m-> this.sendWeChatByMail(m,message));
+    public void sendWeChatByMails(String mails, String message) {
+        List<String> mail = Arrays.asList(mails.split(","));
+        mail.forEach(m -> this.sendWeChatByMail(m, message));
     }
 
     /**
-     *  消息切割
+     * 消息切割
      */
-    private List<String> splitMessage(String message){
-        List<String> messageList=new ArrayList<>();
-        if(message.length()>1006){
-            int number=message.length()/1006;
-            for(int i=0;i<number;i++){
-                if(i!=number-1){
-                    messageList.add(message.substring(i*1006,(i+1)*1006-1));
-                }else {
-                    messageList.add(message.substring((i+1)*1006));
+    private List<String> splitMessage(String message) {
+        List<String> messageList = new ArrayList<>();
+        if (message.length() > 1006) {
+            int number = message.length() / 1006;
+            for (int i = 0; i < number; i++) {
+                if (i != number - 1) {
+                    messageList.add(message.substring(i * 1006, (i + 1) * 1006 - 1));
+                } else {
+                    messageList.add(message.substring((i + 1) * 1006));
                 }
             }
-        }else {
+        } else {
             messageList.add(message);
         }
         return messageList;

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/CtopCorpWexinUser.java

@@ -37,6 +37,7 @@ public class CtopCorpWexinUser {
     @Excel(name = "userId", width = 15)
     @ApiModelProperty(value = "userId")
     private String userId;
+
     /**
      * wexinId
      */
@@ -67,6 +68,7 @@ public class CtopCorpWexinUser {
     @Excel(name = "wexinGender", width = 15)
     @ApiModelProperty(value = "wexinGender")
     private String wexinGender;
+    private String corpId;
     /**
      * createTime
      */

+ 86 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/WexinConfig.java

@@ -0,0 +1,86 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.api.WxCpService;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 企业微信配置信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-06-17
+ */
+@Data
+@TableName("ctop_wexin_config")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_wexin_config对象", description = "企业微信配置信息")
+public class WexinConfig {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * corpId
+     */
+    @Excel(name = "corpId", width = 15)
+    @ApiModelProperty(value = "corpId")
+    private String corpId;
+    /**
+     * agentId
+     */
+    @Excel(name = "agentId", width = 15)
+    @ApiModelProperty(value = "agentId")
+    private Integer agentId;
+    /**
+     * corpSecret
+     */
+    @Excel(name = "corpSecret", width = 15)
+    @ApiModelProperty(value = "corpSecret")
+    private String corpSecret;
+    /**
+     * aesKey
+     */
+    @Excel(name = "aesKey", width = 15)
+    @ApiModelProperty(value = "aesKey")
+    private String aesKey;
+    /**
+     * token
+     */
+    @Excel(name = "token", width = 15)
+    @ApiModelProperty(value = "token")
+    private String token;
+    /**
+     * remarks
+     */
+    @Excel(name = "remarks", width = 15)
+    @ApiModelProperty(value = "remarks")
+    private String remarks;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private WxCpService wxCpService;
+}

+ 4 - 3
module-common/src/main/java/cn/com/ctop/common/module/mapper/MailLogMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.MailLog;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,11 +20,11 @@ public interface MailLogMapper extends BaseMapper<MailLog> {
 
     List<String> selectMailList(@Param("projectId") Long projectId);
 
-    List<String> selectWeiXinIdList(@Param("projectId") Long projectId);
+    List<JSONObject> selectWeiXinIdList(@Param("projectId") Long projectId);
 
-    String getWChatIdByUserId(@Param("userId") String responsibleId);
+    JSONObject getWChatIdByUserId(@Param("userId") String responsibleId);
 
     String getUserNameByUserId(@Param("userId") String transferor);
 
-    String getWeChatByMail(@Param("mail") String mail);
+    JSONObject getWeChatByMail(@Param("mail") String mail);
 }

+ 15 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/WexinConfigMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.WexinConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 企业微信配置信息
+ *
+ * @author jeecg-boot
+ * 2021-06-17
+ * @version V1.0
+ */
+public interface WexinConfigMapper extends BaseMapper<WexinConfig> {
+
+}

+ 6 - 6
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MailLogMapper.xml

@@ -27,9 +27,9 @@
     </select>
 
 
-    <select id="selectWeiXinIdList" resultType="java.lang.String">
+    <select id="selectWeiXinIdList" resultType="com.alibaba.fastjson.JSONObject">
      select
-     t2.wexin_id
+     t2.wexin_id,t2.corp_id
      from
      ctop_project_member t1
      left join ctop_corp_wexin_user t2
@@ -41,8 +41,8 @@
      and t2.wexin_id != ''
     </select>
 
-    <select id="getWChatIdByUserId" resultType="java.lang.String">
-    select t1.wexin_id
+    <select id="getWChatIdByUserId" resultType="com.alibaba.fastjson.JSONObject">
+    select t1.wexin_id,corp_id
     from ctop_corp_wexin_user t1
     left join  sys_user t2
     on  t1.user_id = t2.id
@@ -58,9 +58,9 @@
     where id = #{userId}
     </select>
 
-    <select id="getWeChatByMail" resultType="java.lang.String">
+    <select id="getWeChatByMail" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-            wexin_id
+            wexin_id,corp_id
         FROM
             ctop_corp_wexin_user
         WHERE

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/WexinConfigMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.module.mapper.WexinConfigMapper">
+
+</mapper>

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

@@ -0,0 +1,16 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.WexinConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 企业微信配置信息
+ *
+ * @author jeecg-boot
+ * 2021-06-17
+ * @version V1.0
+ */
+public interface IWexinConfigService extends IService<WexinConfig> {
+
+    WexinConfig getInfoByCorpId(String corpId);
+}

+ 7 - 4
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import cn.com.feishu.provider.MessageProvider;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
@@ -25,11 +26,13 @@ import org.springframework.stereotype.Service;
 public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
     @Autowired
     private MailLogMapper mailLogMapper;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
 
     @Override
     public void sendWeChat(String responsibleId, Long accountId, String projectName, String transferor, String assignee) {
-        String weChatId = mailLogMapper.getWChatIdByUserId(responsibleId);
+        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(responsibleId);
         if (!Check.isNull(weChatId)) {
             String transferorName = mailLogMapper.getUserNameByUserId(transferor); // 转让人姓名
             String assigneeName = mailLogMapper.getUserNameByUserId(assignee); // 转让人姓名
@@ -39,7 +42,7 @@ public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> impl
                     .append("账号:" + accountId).append(",申请由:" + transferorName + "转户于:" + assigneeName).append("<br/>")
                     .append("等待您的审核,请您及时处理!");
 
-            CorpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
+            corpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
         }
 
         CorpFeishuUser user = corpFeishuUserService.getByUserId(responsibleId);
@@ -74,7 +77,7 @@ public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> impl
     @Override
     public void sendWeChatByStatus(String projectName, Integer status, String userId, Long accountId) {
 
-        String weChatId = mailLogMapper.getWChatIdByUserId(userId);
+        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
         if (!Check.isNull(weChatId)) {
             String statusName = "";
 
@@ -91,7 +94,7 @@ public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> impl
                     .append("申请的转户操作已:" + statusName).append("<br/>")
                     .append("请您前往验证,谢谢!");
 
-            CorpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
+            corpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
         }
 
         CorpFeishuUser user = corpFeishuUserService.getByUserId(userId);

+ 6 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/SendMessageServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.mapper.MailLogMapper;
 import cn.com.ctop.common.module.service.ISendMessageService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -13,11 +14,14 @@ import org.springframework.stereotype.Service;
 public class SendMessageServiceImpl implements ISendMessageService {
     @Autowired
     private MailLogMapper mailLogMapper;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
+
     @Override
     public void sendMessage(String userId, String text) {
-        String weChatId = mailLogMapper.getWChatIdByUserId(userId);
+        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
         if (!Check.isNull(weChatId)) {
-            CorpWexinUtils.sendMessageByWeChatId(weChatId, text);
+            corpWexinUtils.sendMessageByWeChatId(weChatId, text);
             log.info("消息发送成功,userId:{}", userId);
         }
     }

+ 29 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/WexinConfigServiceImpl.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.WexinConfig;
+import cn.com.ctop.common.module.mapper.WexinConfigMapper;
+import cn.com.ctop.common.module.service.IWexinConfigService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 企业微信配置信息
+ *
+ * @author jeecg-boot
+ * 2021-06-17
+ * @version V1.0
+ */
+@Service
+public class WexinConfigServiceImpl extends ServiceImpl<WexinConfigMapper, WexinConfig> implements IWexinConfigService {
+
+    @Override
+    public WexinConfig getInfoByCorpId(String corpId) {
+        QueryWrapper<WexinConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("corp_id", corpId);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        WexinConfig config = this.getOne(queryWrapper);
+        return config;
+    }
+}

+ 45 - 31
module-common/src/main/java/cn/com/ctop/common/module/utils/CorpWexinUtils.java

@@ -1,5 +1,9 @@
 package cn.com.ctop.common.module.utils;
 
+import cn.com.ctop.common.module.entity.WexinConfig;
+import cn.com.ctop.common.module.service.IWexinConfigService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.val;
 import me.chanjar.weixin.common.error.WxErrorException;
@@ -7,69 +11,79 @@ import me.chanjar.weixin.cp.api.WxCpService;
 import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
 import me.chanjar.weixin.cp.bean.WxCpMessage;
 import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+@Service
 @Slf4j
 public class CorpWexinUtils {
-    private static WxCpService wxCpService;
+    @Autowired
+    private IWexinConfigService wexinConfigService;
+    private static Map<String, WexinConfig> configMap = new HashMap<>();
 
-    {
-        initService();
-    }
-
-    public static void initService() {
-        val configStorage = new WxCpDefaultConfigImpl();
-        configStorage.setCorpId("ww24b8a47826f5875f");
-        configStorage.setAgentId(1000002);
-        configStorage.setCorpSecret("MJIlySADGPlgvADnkFQPUpfZD4yV-4WN6066OgNnb0s");
-        configStorage.setToken("hcst2019");
-        configStorage.setAesKey("hcst2019");
-        wxCpService = new WxCpServiceImpl();
-        wxCpService.setWxCpConfigStorage(configStorage);
+    private Map<String, WexinConfig> getConfigMap() {
+        QueryWrapper<WexinConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.orderByDesc("create_time");
+        List<WexinConfig> list = wexinConfigService.list(queryWrapper);
+        for (WexinConfig config : list) {
+            WxCpService wxCpService = new WxCpServiceImpl();
+            val configStorage = new WxCpDefaultConfigImpl();
+            configStorage.setCorpId(config.getCorpId());
+            configStorage.setAgentId(config.getAgentId());
+            configStorage.setCorpSecret(config.getCorpSecret());
+            configStorage.setToken(config.getToken());
+            configStorage.setAesKey(config.getAesKey());
+            wxCpService.setWxCpConfigStorage(configStorage);
+            config.setWxCpService(wxCpService);
+            configMap.put(config.getCorpId(), config);
+        }
+        return configMap;
     }
 
-    public static void sendMessage(List<String> wxUserList, String content) {
-        if (wxCpService == null) {
-            initService();
+    public void sendMessage(List<JSONObject> wxUserList, String content) {
+        if (Check.isNullMap(configMap)) {
+            getConfigMap();
         }
         if (wxUserList != null && wxUserList.size() > 0) {
-            for (String userId : wxUserList) {
+            for (JSONObject userInfo : wxUserList) {
                 WxCpMessage message = new WxCpMessage();
                 message.setMsgType("text");
                 message.setContent(content);
                 message.setAgentId(1000002);
-                message.setToUser(userId);
+                message.setToUser(userInfo.getString("wexin_id"));
                 try {
+                    WexinConfig config = configMap.get(userInfo.getString("corp_id"));
+                    WxCpService wxCpService = config.getWxCpService();
                     wxCpService.messageSend(message);
                 } catch (WxErrorException e) {
-                    log.error("发送信息失败,userId:{}", userId);
+                    log.error("发送信息失败,userId:{}", userInfo.getString("wexin_id"));
                     e.printStackTrace();
                 }
             }
         }
     }
-
-    public synchronized static void sendMessageByWeChatId(String weChatId, String content) {
-        if (wxCpService == null) {
-            initService();
+    public void sendMessageByWeChatId(JSONObject weChatInfo, String content) {
+        if (Check.isNullMap(configMap)) {
+            this.getConfigMap();
         }
-        if (!Check.isNull(weChatId)) {
+        if (!Check.isNull(weChatInfo)) {
             WxCpMessage message = new WxCpMessage();
             message.setMsgType("text");
             message.setContent(content);
             message.setAgentId(1000002);
-            message.setToUser(weChatId);
+            message.setToUser(weChatInfo.getString("wexin_id"));
             try {
+                WexinConfig config = configMap.get(weChatInfo.getString("corp_id"));
+                WxCpService wxCpService = config.getWxCpService();
                 wxCpService.messageSend(message);
             } catch (WxErrorException e) {
-                log.error("发送信息失败,userId:{}", weChatId);
+                log.error("发送信息失败,userId:{}", weChatInfo.getString("wexin_id"));
                 e.printStackTrace();
             }
-
         }
-
-
     }
-
 }

+ 36 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java

@@ -27,7 +27,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.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;
@@ -37,7 +45,12 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 快手-获取视频接口
@@ -80,6 +93,25 @@ public class KuaiShouVideoGetController {
         return result;
     }
 
+    /**
+     * 真人、制作标签素材统计报表
+     *
+     * @return
+     */
+    @GetMapping(value = "/labelMaterialList")
+    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        try {
+            if (Check.isNull(startTime) || Check.isNull(endTime)) {
+                return Result.error("请选择查询日期");
+            }
+            return kuaiShouReportDailyMaterialService.labelMaterialList(realname, roleCode, startTime, endTime, pageNo, pageSize);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+
+    }
+
 
     @GetMapping(value = "/getVideoList")
     public Result<PageInfo<KuaiShouVideoGetVo>> getVideoList(Long accountId,
@@ -116,8 +148,8 @@ public class KuaiShouVideoGetController {
             requestMap.put("orderBy", orderBy);
             requestMap.put("materialType", materialType);
             requestMap.put("channelType", channelType);
-            if(!Check.isNull(signatures)){
-                String[] signatureArray =  signatures.split(",");
+            if (!Check.isNull(signatures)) {
+                String[] signatureArray = signatures.split(",");
                 requestMap.put("signatureList", signatureArray);
             }
             if ("time".equals(orderBy)) {

+ 9 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java

@@ -31,11 +31,17 @@ public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouRe
 
     void batchReplace(@Param("addList") List<KuaiShouReportDailyMaterial> addList);
 
-    KuaiShouReportDailyMaterial getEtlDataByParams(@Param("signature")String signature, @Param("date") String date,@Param("projectId")Long projectId);
+    KuaiShouReportDailyMaterial getEtlDataByParams(@Param("signature") String signature, @Param("date") String date, @Param("projectId") Long projectId);
 
-    List<KuaiShouReportDailyMaterial> getSignatureByDate(@Param("date")String date);
+    List<KuaiShouReportDailyMaterial> getSignatureByDate(@Param("date") String date);
 
-    List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(@Param("date")String date);
+    List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(@Param("date") String date);
 
     List<JSONObject> getVideoInfoByList(@Param("photoIdList") List<Long> photoIdList);
+
+    Long labelMaterialListTotal(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<JSONObject> labelMaterialList(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    JSONObject labelMaterialAll(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 451 - 79
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -136,17 +136,37 @@
 
 
     <insert id="loadMaterialDailyReport">
-		LOAD DATA local INFILE  #{localPath}
-	    INTO TABLE ctop_kuaishou_report_daily_material
-		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
-		IGNORE 1 LINES
-		(photo_id,
-		image_token,
-		cover_url,
-		photo_url,
-		@photo_caption,
-		@creative_material_type_string,
-        @ad_scene,
+        LOAD
+        DATA local INFILE
+        #{localPath}
+        INTO
+        TABLE
+        ctop_kuaishou_report_daily_material
+        FIELDS
+        TERMINATED
+        BY
+        ','
+        enclosed
+        by
+        '"'
+        LINES
+        TERMINATED
+        BY
+        '\n'
+        IGNORE
+        1
+        LINES
+        (
+        photo_id,
+        image_token,
+        cover_url,
+        photo_url,
+        @
+        photo_caption,
+        @
+        creative_material_type_string,
+        @
+        ad_scene,
         charge,
         photo_show,
         aclick,
@@ -164,13 +184,15 @@
         activation,
         submit,
         stat_date,
-        @stat_hour,
+        @
+        stat_hour,
         photo_click,
         photo_click_ratio,
         action_ratio,
         impression_1k_cost,
         photo_click_cost,
-        @click_1k_cost,
+        @
+        click_1k_cost,
         action_cost,
         event_pay_first_day,
         event_pay_purchase_amount_first_day,
@@ -201,43 +223,81 @@
         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
+        @
+        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}
+        set
+        account_id
+        =
+        #{accountId}
     </insert>
 
     <select id="getPhotoList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
@@ -256,24 +316,19 @@
 
     <select id="getPhotoListByDate"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
-        select
-        id as id,
-        photo_id as photoId
-        from
-        ctop_kuaishou_report_daily_material
+        select id       as id,
+               photo_id as photoId
+        from ctop_kuaishou_report_daily_material
         WHERE stat_date = #{statDate}
-        and signature is null
+          and signature is null
         group by photo_id
     </select>
 
     <select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
-      select
-      signature as 'signature',
-      channel_type as 'channelType'
-      from ctop_kuaishou_video_get
-      where photo_id = #{photoId}
-      and signature is not null
-      limit 1
+        select signature as 'signature', channel_type as 'channelType'
+        from ctop_kuaishou_video_get
+        where photo_id = #{photoId}
+          and signature is not null limit 1
     </select>
 
 
@@ -348,28 +403,21 @@
     </select>
     <select id="getSignatureByDate"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
-        select
-            distinct signature
-        from
-        ctop_kuaishou_report_daily_material
-        where
-            signature is not null
-        and
-            signature != ''
+        select distinct signature
+        from ctop_kuaishou_report_daily_material
+        where signature is not null
+          and signature != ''
         and
             stat_date = #{date}
     </select>
     <select id="getSignatureByDateGroupByProjectId"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
-        select
-    distinct signature,project_id
-from
-    ctop_kuaishou_report_daily_material report
-    left join ctop_user_allocation allocation on report.account_id = allocation.account_id
-where
-    signature is not null
-    and
-    signature != ''
+        select distinct signature,
+                        project_id
+        from ctop_kuaishou_report_daily_material report
+                 left join ctop_user_allocation allocation on report.account_id = allocation.account_id
+        where signature is not null
+          and signature != ''
     and
     stat_date = #{date}
     </select>
@@ -387,5 +435,329 @@ where
         and signature is not null
         group by photo_id
     </select>
+
+    <select id="labelMaterialListTotal" resultType="java.lang.Long">
+        SELECT IFNULL(COUNT(1),0) FROM
+        (
+        SELECT
+        t1.user_id
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;= #{startTime}
+        AND t4.stat_date &lt;= concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) t
+    </select>
+
+    <select id="labelMaterialList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        k.user_id,
+        k.realname,
+        k.role_name 'roleName',
+        IFNULL(k1.zhenren_charge,0)as 'zhenrenCharge',
+        IFNULL(k2.zhenren_number,0)as 'zhenrenNumber',
+        IFNULL(ROUND(k1.zhenren_charge/k2.zhenren_number,2),0) as 'zhenrenCost',
+        IFNULL(k3.zhizuo_charge,0)as 'zhizuoCharge',
+        IFNULL(k4.zhizuo_number,0)as 'zhizuoNumber',
+        IFNULL(ROUND(k3.zhizuo_charge/k4.zhizuo_number,2),0) as 'zhizuoCost'
+        FROM
+        (SELECT
+        t1.user_id,
+        t3.realname,
+        t3.role_name
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) k
+        LEFT JOIN
+        (
+            SELECT
+        t1.user_id, SUM(t5.charge) 'zhenren_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id
+        ) k1 ON k1.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k2 ON k.user_id = k2.user_id
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhizuo_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id
+        )k3 ON k3.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k4 ON k4.user_id = k.user_id
+        ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
+
+    </select>
+
+    <select id="labelMaterialAll" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        '总计' as 'realname',
+        '-' as 'roleName',
+        IFNULL(SUM(t.zhenren_charge),0) as 'zhenrenCharge',
+        IFNULL(SUM(t.zhenren_number),0) as 'zhenrenNumber',
+        IFNULL(ROUND(SUM(t.zhenren_charge)/SUM(t.zhenren_number),2),0) as 'zhenrenCost',
+        IFNULL(SUM(t.zhizuo_charge),0) as 'zhizuoCharge',
+        IFNULL(SUM(t.zhizuo_number),0) as 'zhizuoNumber',
+        IFNULL(ROUND(SUM(t.zhizuo_charge)/SUM(t.zhizuo_number),2),0) as 'zhizuoCost'
+        FROM
+        (SELECT
+        IFNULL(k1.zhenren_charge,0)as 'zhenren_charge',
+        IFNULL(k2.zhenren_number,0)as 'zhenren_number',
+        IFNULL(k3.zhizuo_charge,0)as 'zhizuo_charge',
+        IFNULL(k4.zhizuo_number,0)as 'zhizuo_number'
+        FROM
+        (SELECT
+        t1.user_id,
+        t3.realname,
+        t3.role_name
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) k
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhenren_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id
+        )k1 ON k1.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k2 ON k.user_id = k2.user_id
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhizuo_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id
+        )k3 ON k3.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k4 ON k4.user_id = k.user_id
+        ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
+        )t
+    </select>
 </mapper>
 

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml

@@ -202,10 +202,12 @@
                IFNULL(ROUND(SUM(t1.charge) / SUM(t1.photo_click), 2), 0) 'photoClickCost',
                IFNULL(ROUND(SUM(t1.charge) / SUM(t1.bclick), 2), 0) 'actionCost'
         FROM  ctop_kuaishou_video_get t0
-                  LEFT JOIN ctop_kuaishou_report_daily_material t1 ON t0.signature = t1.signature
+                  LEFT JOIN ctop_kuaishou_report_daily_material t1 ON t0.account_id = t1.account_id
                   LEFT JOIN ctop_user_allocation t2 ON t0.account_id = t2.account_id
                   LEFT JOIN (
-            SELECT COUNT(1) 'rejectCount',account_id FROM ctop_kuaishou_creative WHERE `status` = 42 GROUP BY account_id
+            SELECT IFNULL(COUNT(1),0) 'rejectCount',account_id FROM ctop_kuaishou_creative WHERE `status` = 42
+            and account_id IN (SELECT account_id FROM ctop_user_allocation where project_id = #{projectId})
+            GROUP BY account_id
         ) t3 ON t0.account_id = t3.account_id
         WHERE t2.project_id = #{projectId}
           AND t0.signature = #{signature}

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

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.batch.service;
 import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
 import java.util.Map;
@@ -26,4 +27,6 @@ public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouRe
     List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(String date);
 
     List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList);
+
+    Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize);
 }

+ 7 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/AccountWarningServiceImpl.java

@@ -12,6 +12,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.kuaishou.modules.batch.service.IAccountWarningService;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportHourlyAccountMapper;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +33,8 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
     private MailLogMapper mailLogMapper;
     @Autowired
     private IProjectService projectService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
 
     /**
@@ -127,8 +130,8 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-            CorpWexinUtils.sendMessage(wexinIds, text.toString());
+            List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+            corpWexinUtils.sendMessage(wexinIds, text.toString());
         }
     }
 
@@ -167,8 +170,8 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
                 e.printStackTrace();
             }
         }
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
 
     }
 

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

@@ -10,7 +10,10 @@ import cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouReportHourlyMaterialMa
 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 lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -124,6 +127,20 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
     }
 
     @Override
+    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize) {
+        Long total = dailyMaterialMapper.labelMaterialListTotal(realname, roleCode, startTime, endTime);
+        PageHelper.startPage(pageNo, pageSize, false);
+        PageInfo pageInfo = new PageInfo(dailyMaterialMapper.labelMaterialList(realname, roleCode, startTime, endTime));
+        pageInfo.setTotal(total);
+        JSONObject data = new JSONObject();
+        data.put("pageInfo", pageInfo);
+        if (total > 0) {
+            data.put("total", dailyMaterialMapper.labelMaterialAll(realname, roleCode, startTime, endTime));
+        }
+        return Result.ok(data);
+    }
+
+    @Override
     public List<KuaiShouReportDailyMaterial> getSignatureByDate(String date) {
         return dailyMaterialMapper.getSignatureByDate(date);
     }

+ 6 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/KuaishouBidWarningServiceImpl.java

@@ -12,6 +12,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.kuaishou.modules.material.service.IKuaishouBidWarningService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.context.XxlJobHelper;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,8 @@ public class KuaishouBidWarningServiceImpl implements IKuaishouBidWarningService
     private KuaiShouGroupMapper groupMapper;
     @Autowired
     private MailLogMapper mailLogMapper;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
 
     /**
@@ -51,7 +54,7 @@ public class KuaishouBidWarningServiceImpl implements IKuaishouBidWarningService
                 }
                 Long maxBid = project.getMaxBid();
                 Long projectId = project.getId();
-                List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+                List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
                 if (!Check.isNull(userAllocations)) {
                     for (UserAllocation userAllocation : userAllocations) {
                         if (userAllocation.getAccountStatus() == 1) {
@@ -108,7 +111,7 @@ public class KuaishouBidWarningServiceImpl implements IKuaishouBidWarningService
             }
         }
 
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
     }
 }

+ 6 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceBidWarningServiceImpl.java

@@ -13,6 +13,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceBidWarningService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -34,6 +35,8 @@ public class BytedanceBidWarningServiceImpl implements IBytedanceBidWarningServi
     private MailLogMapper mailLogMapper;
     @Autowired
     private IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
     @Override
     public void bidWarning() {
@@ -48,7 +51,7 @@ public class BytedanceBidWarningServiceImpl implements IBytedanceBidWarningServi
                     }
                     Long maxBid = project.getMaxBid();
                     Long projectId = project.getId();
-                    List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+                    List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
                     if (!Check.isNull(userAllocations)) {
                         for (UserAllocation userAllocation : userAllocations) {
                             if (userAllocation.getAccountStatus() == 1) {
@@ -108,7 +111,7 @@ public class BytedanceBidWarningServiceImpl implements IBytedanceBidWarningServi
             }
         }
 
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
     }
 }

+ 7 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceHourlyAccountWarningServiceImpl.java

@@ -12,6 +12,7 @@ import cn.com.ctop.common.module.utils.SendMailUtil;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceAdvertiserHourlyReportMapper;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceHourlyAccountWarningService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +36,8 @@ public class ByteDanceHourlyAccountWarningServiceImpl implements IByteDanceHourl
     private MailLogMapper mailLogMapper;
     @Autowired
     private IProjectService projectService;
+    @Autowired
+    private CorpWexinUtils corpWexinUtils;
 
     /**
      * 头条账户 出价预警
@@ -123,8 +126,8 @@ public class ByteDanceHourlyAccountWarningServiceImpl implements IByteDanceHourl
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-            CorpWexinUtils.sendMessage(wexinIds, text.toString());
+            List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+            corpWexinUtils.sendMessage(wexinIds, text.toString());
         }
     }
 
@@ -162,8 +165,8 @@ public class ByteDanceHourlyAccountWarningServiceImpl implements IByteDanceHourl
                 e.printStackTrace();
             }
         }
-        List<String> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
-        CorpWexinUtils.sendMessage(wexinIds, text.toString());
+        List<JSONObject> wexinIds = mailLogMapper.selectWeiXinIdList(projectId);
+        corpWexinUtils.sendMessage(wexinIds, text.toString());
     }