package com.zkj.wecom.marketing.customer.server.service.impl;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.primitives.Ints;
import com.zkj.wecom.marketing.base.service.*;
import com.zkj.wecom.marketing.common.constant.BaseSettingConstant;
import com.zkj.wecom.marketing.common.enums.DeleteFlagEnum;
import com.zkj.wecom.marketing.common.result.JsonResult;
import com.zkj.wecom.marketing.common.util.RedisUtil;
import com.zkj.wecom.marketing.customer.core.service.pullnew.CustomerPullNewCustomerService;
import com.zkj.wecom.marketing.customer.core.service.pullnew.CustomerPullNewGroupService;
import com.zkj.wecom.marketing.customer.core.service.pullnew.CustomerPullNewService;
import com.zkj.wecom.marketing.customer.core.service.pullnew.CustomerPullNewStaffService;
import com.zkj.wecom.marketing.customer.model.domain.entity.pullnew.CustomerPullNewCustomerEntity;
import com.zkj.wecom.marketing.customer.model.domain.entity.pullnew.CustomerPullNewEntity;
import com.zkj.wecom.marketing.customer.model.domain.entity.pullnew.CustomerPullNewGroupEntity;
import com.zkj.wecom.marketing.customer.model.domain.entity.pullnew.CustomerPullNewStaffEntity;
import com.zkj.wecom.marketing.customer.model.domain.req.pullnew.*;
import com.zkj.wecom.marketing.customer.model.domain.vo.CustomerCountVO;
import com.zkj.wecom.marketing.customer.model.domain.vo.pullnew.*;
import com.zkj.wecom.marketing.customer.model.enums.WeComCustomerHandleTypeEnum;
import com.zkj.wecom.marketing.customer.server.handle.config.CompanyConfigHandle;
import com.zkj.wecom.marketing.customer.server.service.CloudCustomerPullNewService;
import com.zkj.wecom.marketing.system.core.service.SysCompanyConfigService;
import com.zkj.wecom.marketing.system.model.domain.entity.base.*;
import com.zkj.wecom.marketing.system.model.domain.entity.tenant.SysCompanyConfig;
import com.zkj.wecom.marketing.wechat.api.feign.WeChatAppMessageFeign;
import com.zkj.wecom.marketing.wechat.model.app.MessageSendRequest;
import com.zkj.wecom.marketing.wechat.model.app.MessageSendResponse;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
@Slf4j
@Service
public class CloudCustomerPullNewServiceImpl implements CloudCustomerPullNewService {
@Resource
private BaseMemberService baseMemberService;
@Resource
private BaseCustomerService baseCustomerService;
@Resource
private BaseCustomerGroupService baseCustomerGroupService;
@Resource
private BaseDepartmentService baseDepartmentService;
@Resource
private BaseCustomerFollowService baseCustomerFollowService;
@Resource
private CustomerPullNewService pullNewService;
@Resource
private CustomerPullNewStaffService pullNewStaffService;
@Resource
private CustomerPullNewGroupService pullNewGroupService;
@Resource
private CustomerPullNewCustomerService pullNewCustomerService;
@Resource
private SysCompanyConfigService sysCompanyConfigService;
@Resource
private WeChatAppMessageFeign weChatAppMessageFeign;
@Resource
private CompanyConfigHandle configHandle;
@Resource
private RedisUtil redisUtil;
/**
* 定时更新拉新排行活动状态redisKey
*/
private String redisSyncLock = "cover:pullnew:schedule";
/**
* 拉新排行活动 - h5详情页
*/
public static String PULL_NEW_H5_DETAIL = "/pages/operational_tools/staff_rank_detail";
/**
* 活动开始消息内容
*/
public static String PULL_NEW_START_MESSAGE = "【排行榜活动开始提醒】\n新的排行榜活动开始啦,快去看看吧~\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 活动结束消息内容
*/
public static String PULL_NEW_END_MESSAGE = "【排行榜活动结束提醒】\n您参加的排行榜活动结束啦,快去看看活动的最终排名吧~\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n您的最终排名∶ %s\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 每日播报消息内容
*/
public static String PULL_NEW_DAY_MESSAGE = "【排行榜活动每日播报】\n您的今日排名为第%s名\n距上一名∶ 差%s位客户\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 上榜消息内容
*/
public static String PULL_NEW_UP_MESSAGE = "【排行榜上榜提醒】\n恭喜您上榜啦,距上一名差∶%s位客户,请乘势而上,再创新高哦~\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n您的当前排名∶ %s\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 落榜消息内容
*/
public static String PULL_NEW_DOWN_MESSAGE = "【排行榜落榜提醒】\n您已经落榜啦,距上榜差∶%s位客户,请不要气馁,继续加油哦~\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n您的当前排名∶ %s\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 即将上榜消息内容
*/
public static String PULL_NEW_RANKING_MESSAGE = "【排行榜提醒】排行榜日报来啦\n活动名称∶ %s\n排行指标∶ %s\n结束时间∶ %s\n上榜名次∶ %s\n今日排名∶ %s\n距上一名∶ 差%s位客户\n继续加油哦\n<a href=%s>点击查看此排行榜活动</a>";
/**
* 拉新排行类型
*/
public static final Map<Integer, String> PULL_NEW_TYPE_MAP = new HashMap();
/**
* status标识
*/
public static final Map<Integer, String> STATUS_MAP = new HashMap();
/**
* flag标识
*/
public static final Map<Integer, String> FLAG_MAP = new HashMap();
static {
/** 拉新排行类型 **/
PULL_NEW_TYPE_MAP.put(0, "邀请成为企微客户");
PULL_NEW_TYPE_MAP.put(1, "邀请加入群聊");
/** status标识 **/
STATUS_MAP.put(0, "未开始");
STATUS_MAP.put(1, "进行中");
STATUS_MAP.put(2, "已结束");
/** flag标识 **/
FLAG_MAP.put(0, "否");
FLAG_MAP.put(1, "是");
}
@Override
@Transactional
public JsonResult add(Integer tenantId, Integer currentMemberId, PullNewAddReq req) {
log.info("add.tenantId:{}, currentMemberId:{}, req:{}", tenantId, currentMemberId, req);
try {
//参数校验
this.checkAddParams(req);
//拉新排行榜保存
CustomerPullNewEntity pullNewEntity = new CustomerPullNewEntity();
BeanUtils.copyProperties(req, pullNewEntity);
pullNewEntity.setTenantId(tenantId);
pullNewEntity.setStartTime(req.getStartTimeInt());
pullNewEntity.setEndTime(req.getEndTimeInt());
pullNewEntity.setCreateBy(String.valueOf(curren
没有合适的资源?快使用搜索试试~ 我知道了~
sc-11111111111
共13076个文件
class:4563个
java:4461个
xml:426个
需积分: 0 0 下载量 52 浏览量
2023-03-09
18:10:14
上传
评论
收藏 73.71MB ZIP 举报
温馨提示
sc-11111111111
资源推荐
资源详情
资源评论
收起资源包目录
sc-11111111111 (13076个子文件)
scrm3.0-chenn 3KB
scrm3.0-dev-auto-build-group 816B
scrm3.0-dev-caoyunxiao 1020B
scrm3.0-form 5KB
scrm3.0-fqx 1KB
scrm3.0-gc 408B
scrm3.0-heyu 9KB
scrm3.0-hs-khq 2KB
scrm3.0-hshuai 2KB
scrm3.0-material 0B
scrm3.0-okr 3KB
scrm3.0-songmingxu 9KB
scrm3.0-sop 0B
scrm3.0-sop-zww 0B
scrm3.0-sop-zww 0B
0000eea76863155610ac809c712fb657f4d60ba0 0B
000e770e926645c4c20269c4b16f05a27c13ac14 0B
00110e3e4f91cef4e6f95c0796c5840981b37408 0B
00338608c43b863ed38747917e68936475809a41 0B
00373f443547873320b64fe7f7a27687d074cf 47B
00585ee71b0c17e2581bd2a09c9dd9d9d0f5d6 46B
007e76ffedceb58f25167103465dbb038834af 51B
008694c7c43af52bbc7dfa231cb7f42ea7947075 0B
008c920a0293221ce6ede94f5f8a527359f3c5ea 0B
008e26d01a7169d3b694a8f296ae7acab300e7 2KB
008faadd5d218bd65fc70acbdebf56af473a1cc8 83B
00acda0f3c8b52380ffbca3767595f6266c96e 574B
00c859bef6906aeeb070705774c3de057daa4707 2KB
00e34200c3ef1d53f854d6e891770f50d65b1baf 58B
0105355993509aca4b4c4959ff62800e14e2aa 46B
010ad686ec88899bba4a41e74e5ecd54f842f9 222B
0131cad7bf653aded04cee324b29a5f72be8c03b 0B
01468abaf2b81945ebd643e131f455957c35ec04 584B
0147bfed3fd5c468751c037b98ad7d45aee878de 0B
01495a86b753321c2f3a91ab464fb7d4d6a39f42 0B
014a2fde5c6e32746f41f88412a50da9067597 81B
015897fdc9cb3783335ac074a8eca73782aa4947 111B
017022a2766c5c1bcdcb8326401d97e3aac84d 198B
018e1f137a378ba0c759a347698bbd1fad088a88 502B
018f3961185c27e2eaa3d186063fd267eb1d6614 0B
01a94455941ebbc4c3ad5216b21526771fccb008 0B
01b62abca3195a05ebf6d4b3cab4327453b4743b 68B
01bcc82f6ec71875f22101515afa84ef72c730e8 0B
01f7dd3cf99af90de8aa3ea68f1161e8409a4c 45B
020598c51f1f31aa1a986a464cb15a7a1e0f00e5 0B
024166554e362b2fe1cffab6e0ddb4cefc368e 47B
0255f7ee67b158b5b891bac135fda9b3549bd8 205B
028d794056c8809f27f5a93b3dd3200efaa6e7de 79B
02939bee2d2f5fca7cc7ad2d3241239e596c2e56 0B
02a0331c961b84c192f704b5fed8343b09938f 46B
02b4ef5b44968a724c39a83aefd01bb13b7a8670 0B
02b6a850851666ad119c888e69c201b851fbe607 0B
02c650d3455fe360fb427b283838fadc5b6be277 607B
02d7218eff528d07f63b0158767b84a5eaed81fb 0B
02e0a63de1b87c8ea628d7983d836929441653 229B
02f11f579fbe3fb059707bc9e96e419aa11996fe 0B
02f2a476e9eae951bddb8b219bc3821dc89cf314 0B
0336b7e383f2859def054ae4f8f079d6ad0d5a 503B
0345d6975cd544bfbbdbece4d8d5a260e2679b 81B
0364f139d519c399a6501745d87026c39c2a25 74B
0370046b30d8d3eae5523466a7f1787d4c56021b 294B
037dd753e7899565c853339c2c19bb7deb141c31 0B
038eecf3ef0492e279d432cdff04bc9c8d6dc0 1KB
0392af8a050e9669a15ce7f8ab1e3ae5974b9d53 0B
039d780b6a14377c952332d9136708f951f58290 0B
03cdea4325dde1ef80e6d6d950022bd0f73061 13KB
03d3e4d04179506b0ce51c1a8356717bcbc407 5KB
03e8c63f0c04a0d85d79180936ff3c57c45d39 79B
04525ac5118e8134e2214da4c71d86d5c3976a 46B
0463da03556170b53988b2e74fad0fd26e0f1e 3KB
046792cd2b909019c28cbd6e637f8af8feb73c89 0B
0474f26dac833c0ed186ca2e0974cb99164519be 0B
0486923e05bee41d48ac14ae15797fcd923e6a9a 0B
04c9704d0df5b0efd3745295891f43121bdd44a0 300B
04e7f1b5c76366a53baf27d70dad8417b5da151f 111B
04ebf40967ec7c88210a55c6f34245ac7e404749 166B
04f9b645ab504903df7c22a30a05d9b0fc4c4bd0 0B
050efc47b30ce9883818f37e48ba270936d873 577B
052118666e4aa46d735daa1da9ee375c696132f7 83B
05212a3e5c2cadb6d56482d0b83119a587091600 0B
053c22654f740149e2933d4d68a11d02a85ee8 916B
053f32cd6af33986931904261233aa7b089d579e 0B
0543c1dddadaf4f867a153f019ea4071cb50c6 3KB
0559bce8952d8778f746d338d2a50676df3a0e 51B
056224833bedde202c695872a3401dfeb619de 225B
056dc95c3e0abb77a0459dd48fcc15bd8e1e0d00 0B
05a35ada510110a63913d9cc03a2a0604bace5ad 74B
05a498529c6e1c7e2841cec71496d12fbb9c91ee 166B
05b0149c240bfff6dfbcb07249721b5a56a63aad 0B
05c7231e10b9b691dcd9ac97be01caacbe0afe33 0B
05d4a7f7668b6f49e221525094de3e469ae8bc90 0B
05dd861b5c005547c93ef739ccb3d348c518185f 64B
05eb62f961dbcb15f77a75a69367e1ea6856520d 175B
0605ccab9d85f2e1436758d6a9b1ebc7283fc8bb 0B
0627819d4faa637d6eb841cad04c7aa7f8a78d 14KB
062a03c2a63cfcc3dd2da6e1158e496ca939d9 576B
064ccc0e17a2507c1baba645939b8ea92eff3d6c 0B
0667dcb8633507a7b3b28bf4fec1d604d79607 80B
066a539f0014221b494eb227e1d54806881bfd 577B
067358e019cb5f6216df68441f691a0ddc7fb6 144B
共 13076 条
- 1
- 2
- 3
- 4
- 5
- 6
- 131
资源评论
逸海云天
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功