提交 9a109186 作者: gh

token实体、客服实体

上级 ae416894
......@@ -4,8 +4,6 @@ import com.yaoyaozw.customer.common.BaseResult;
import com.yaoyaozw.customer.common.GenericsResult;
import com.yaoyaozw.customer.dto.customer.DelayCustomerQueryDTO;
import com.yaoyaozw.customer.dto.customer.DelayCustomerSaveDTO;
import com.yaoyaozw.customer.entity.DelayCustomer;
import com.yaoyaozw.customer.service.DelayCustomerService;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -24,8 +22,6 @@ import java.util.List;
@RequestMapping("/delay-customer-service")
public class DelayCustomerController {
@Autowired
private DelayCustomerService delayCustomerService;
@ApiOperation("新增")
......
package com.yaoyaozw.customer.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 java.io.Serializable;
import lombok.Data;
@Data
@TableName(value = "authorizer_token")
public class AuthorizerToken implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField(value = "authorizer_access_token")
private String authorizerAccessToken;
@TableField(value = "authorizer_appid")
private String authorizerAppid;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_AUTHORIZER_ACCESS_TOKEN = "authorizer_access_token";
public static final String COL_AUTHORIZER_APPID = "authorizer_appid";
}
\ No newline at end of file
package com.yaoyaozw.customer.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 java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "customer_graphics")
public class CustomerGraphics implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 人群包id
*/
@TableField(value = "pack_id")
private Long packId;
/**
* 发送时间
*/
@TableField(value = "post_time")
private Date postTime;
/**
* 创建人
*/
@TableField(value = "create_user")
private Long createUser;
/**
* 创建时间
*/
@TableField(value = "gmt_create")
private Date gmtCreate;
/**
* 更新人
*/
@TableField(value = "modified_user")
private Long modifiedUser;
/**
* 更新时间
*/
@TableField(value = "gmt_modified")
private Date gmtModified;
/**
* 逻辑删除
*/
@TableField(value = "is_deleted")
private Boolean isDeleted;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_PACK_ID = "pack_id";
public static final String COL_POST_TIME = "post_time";
public static final String COL_CREATE_USER = "create_user";
public static final String COL_GMT_CREATE = "gmt_create";
public static final String COL_MODIFIED_USER = "modified_user";
public static final String COL_GMT_MODIFIED = "gmt_modified";
public static final String COL_IS_DELETED = "is_deleted";
}
\ No newline at end of file
package com.yaoyaozw.customer.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 java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "customer_graphics_delay")
public class CustomerGraphicsDelay implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* appid
*/
@TableField(value = "app_id")
private String appId;
/**
* 发送序列
*/
@TableField(value = "post_sort")
private Integer postSort;
/**
* 间隔时间
*/
@TableField(value = "time_interval")
private Long timeInterval;
/**
* 创建人
*/
@TableField(value = "create_user")
private Long createUser;
/**
* 创建时间
*/
@TableField(value = "gmt_create")
private Date gmtCreate;
/**
* 更新人
*/
@TableField(value = "modified_user")
private Long modifiedUser;
/**
* 更新时间
*/
@TableField(value = "gmt_modified")
private Date gmtModified;
/**
* 逻辑删除
*/
@TableField(value = "is_deleted")
private Boolean isDeleted;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_APP_ID = "app_id";
public static final String COL_POST_SORT = "post_sort";
public static final String COL_TIME_INTERVAL = "time_interval";
public static final String COL_CREATE_USER = "create_user";
public static final String COL_GMT_CREATE = "gmt_create";
public static final String COL_MODIFIED_USER = "modified_user";
public static final String COL_GMT_MODIFIED = "gmt_modified";
public static final String COL_IS_DELETED = "is_deleted";
}
\ No newline at end of file
package com.yaoyaozw.customer.entity;
import lombok.Data;
import java.io.Serializable;
/**
* @author darker
* @date 2022/9/16 10:42
*/
@Data
public class DelayCustomer implements Serializable {
}
package com.yaoyaozw.customer.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.AuthorizerToken;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AuthorizerTokenMapper extends BaseMapper<AuthorizerToken> {
}
\ No newline at end of file
package com.yaoyaozw.customer.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
@DS("material")
@Mapper
public interface CustomerGraphicsDelayMapper extends BaseMapper<CustomerGraphicsDelay> {
/**
* 根据appid找延时客服
* @param appidList
* @return
*/
List<DelayCustomerListVO> findAllDelayCustomerMessage(@Param("appidList") Set<String> appidList);
}
\ No newline at end of file
package com.yaoyaozw.customer.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerGraphicsMapper extends BaseMapper<CustomerGraphics> {
}
\ No newline at end of file
package com.yaoyaozw.customer.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoyaozw.customer.entity.DelayCustomer;
import org.springframework.stereotype.Repository;
/**
* @author darker
* @date 2022/9/16 10:43
*/
@DS("material")
@Repository
public interface MaterialDelayCustomerMapper extends BaseMapper<DelayCustomer> {
}
......@@ -47,4 +47,13 @@ public class SchedulingTask {
accountOrderService.calculateAvgMonth(integrationRequestDTO);
}
/**
* 每段时间扫描一次正常客服
*/
public void publishCustomerMessage(){
}
}
package com.yaoyaozw.customer.service;
import com.yaoyaozw.customer.entity.AuthorizerToken;
import com.baomidou.mybatisplus.extension.service.IService;
public interface AuthorizerTokenService extends IService<AuthorizerToken>{
}
package com.yaoyaozw.customer.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yaoyaozw.customer.entity.DelayCustomer;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import java.util.List;
import java.util.Set;
/**
* @author darker
* @date 2022/9/15 11:13
*/
public interface DelayCustomerService extends IService<DelayCustomer> {
public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsDelay> {
List<DelayCustomerListVO> findAllDelayCustomerMessage(Set<String> appidList);
}
package com.yaoyaozw.customer.service;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.baomidou.mybatisplus.extension.service.IService;
public interface CustomerGraphicsService extends IService<CustomerGraphics> {
}
package com.yaoyaozw.customer.service;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.entity.RegisterUserEntity;
import com.baomidou.mybatisplus.extension.service.IService;
public interface RegisterUserEntityService extends IService<RegisterUserEntity>{
void sendCustomerMessage(IntegrationRequestDTO integrationRequestDTO);
void sendCustomerDelayMessage(IntegrationRequestDTO integrationRequestDTO);
}
package com.yaoyaozw.customer.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.entity.AuthorizerToken;
import com.yaoyaozw.customer.mapper.AuthorizerTokenMapper;
import com.yaoyaozw.customer.service.AuthorizerTokenService;
@Service
public class AuthorizerTokenServiceImpl extends ServiceImpl<AuthorizerTokenMapper, AuthorizerToken> implements AuthorizerTokenService{
}
package com.yaoyaozw.customer.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.entity.DelayCustomer;
import com.yaoyaozw.customer.mapper.MaterialDelayCustomerMapper;
import com.yaoyaozw.customer.service.DelayCustomerService;
import com.yaoyaozw.customer.entity.CustomerGraphicsDelay;
import com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper;
import com.yaoyaozw.customer.service.CustomerGraphicsDelayService;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
/**
* @author darker
* @date 2022/9/15 11:13
*/
@Service
public class DelayCustomerServiceImpl extends ServiceImpl<MaterialDelayCustomerMapper, DelayCustomer> implements DelayCustomerService {
public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphicsDelayMapper, CustomerGraphicsDelay> implements CustomerGraphicsDelayService {
@Override
public List<DelayCustomerListVO> findAllDelayCustomerMessage(Set<String> appidList) {
return baseMapper.findAllDelayCustomerMessage(appidList);
}
}
package com.yaoyaozw.customer.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.yaoyaozw.customer.mapper.CustomerGraphicsMapper;
import com.yaoyaozw.customer.service.CustomerGraphicsService;
@Service
public class CustomerGraphicsServiceImpl extends ServiceImpl<CustomerGraphicsMapper, CustomerGraphics> implements CustomerGraphicsService {
}
package com.yaoyaozw.customer.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yaoyaozw.customer.dto.integration.IntegrationRequestDTO;
import com.yaoyaozw.customer.entity.AuthorizerToken;
import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.yaoyaozw.customer.service.AuthorizerTokenService;
import com.yaoyaozw.customer.service.CustomerGraphicsDelayService;
import com.yaoyaozw.customer.service.CustomerGraphicsService;
import com.yaoyaozw.customer.vo.customer.DelayCustomerListVO;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yaoyaozw.customer.mapper.RegisterUserEntityMapper;
import com.yaoyaozw.customer.entity.RegisterUserEntity;
import com.yaoyaozw.customer.service.RegisterUserEntityService;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service
public class RegisterUserEntityServiceImpl extends ServiceImpl<RegisterUserEntityMapper, RegisterUserEntity> implements RegisterUserEntityService{
@Autowired
private CustomerGraphicsService customerGraphicsService;
@Autowired
private CustomerGraphicsDelayService customerGraphicsDelayService;
@Autowired
private AuthorizerTokenService authorizerTokenService;
@Override
public void sendCustomerMessage(IntegrationRequestDTO integrationRequestDTO) {
//1.读取人群包
List<RegisterUserEntity> list = list();
//2.发送客服消息
}
@Override
public void sendCustomerDelayMessage(IntegrationRequestDTO integrationRequestDTO) {
//1.读取延时客服排期人
List<RegisterUserEntity> allPostUser = list(new QueryWrapper<RegisterUserEntity>().eq(RegisterUserEntity.COL_CUSTOMER_PUBLISH,integrationRequestDTO.getRequestDate()));
//涉及的appid
Set<String> appidSet = allPostUser.stream().map(RegisterUserEntity::getAppId).collect(Collectors.toSet());
if (!allPostUser.isEmpty()){
//号-发送序列-用户
Map<String, Map<Integer, List<RegisterUserEntity>>> userMap = allPostUser.stream().collect(Collectors.groupingBy(RegisterUserEntity::getAppId, Collectors.groupingBy(RegisterUserEntity::getCustomerSort)));
List<DelayCustomerListVO> allDelayCustomerMessage = customerGraphicsDelayService.findAllDelayCustomerMessage(appidSet);
//号-发送序列-客服id
Map<String, Map<Byte, List<DelayCustomerListVO>>> customerMap = allDelayCustomerMessage.stream().collect(Collectors.groupingBy(DelayCustomerListVO::getAppId, Collectors.groupingBy(DelayCustomerListVO::getPostSort)));
//找token
List<AuthorizerToken> tokenList = authorizerTokenService.list();
Map<String, String> tokenMap = tokenList.stream().collect(Collectors.toMap(AuthorizerToken::getAuthorizerAppid, AuthorizerToken::getAuthorizerAccessToken));
for (Map.Entry<String, Map<Integer, List<RegisterUserEntity>>> userEntry : userMap.entrySet()) {
String appid = userEntry.getKey();
Map<Byte, List<DelayCustomerListVO>> byteListMap = customerMap.get(appid);
Map<Integer, List<RegisterUserEntity>> value = userEntry.getValue();
}
}
//2.发送延时客服
}
}
package com.yaoyaozw.customer.service.wechat.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class WeChatServiceImpl implements WeChatService{
@Autowired
private WeChatRestService weChatRestService;
@Override
public void sendCustomerServiceMessage() {
//根据人群包发送客服
}
}
package com.yaoyaozw.customer.vo.customer;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
......@@ -10,4 +11,25 @@ import java.io.Serializable;
*/
@Data
public class DelayCustomerListVO implements Serializable {
/**
* appid
*/
private String appId;
/**
* 客服消息id
*/
private Long customerInfoId;
/**
* 发送序列
*/
private Byte postSort;
/**
* 间隔时间
*/
private Long timeInterval;
}
<?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="com.yaoyaozw.customer.mapper.AuthorizerTokenMapper">
<resultMap id="BaseResultMap" type="com.yaoyaozw.customer.entity.AuthorizerToken">
<!--@mbg.generated-->
<!--@Table authorizer_token-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="authorizer_access_token" jdbcType="VARCHAR" property="authorizerAccessToken" />
<result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, authorizer_access_token, authorizer_appid
</sql>
</mapper>
\ No newline at end of file
<?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="com.yaoyaozw.customer.mapper.CustomerGraphicsDelayMapper">
<resultMap id="BaseResultMap" type="com.yaoyaozw.customer.entity.CustomerGraphicsDelay">
<!--@mbg.generated-->
<!--@Table customer_graphics_delay-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="post_sort" jdbcType="TINYINT" property="postSort" />
<result column="time_interval" jdbcType="BIGINT" property="timeInterval" />
<result column="create_user" jdbcType="BIGINT" property="createUser" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="modified_user" jdbcType="BIGINT" property="modifiedUser" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, app_id, post_sort, time_interval, create_user, gmt_create, modified_user, gmt_modified,
is_deleted
</sql>
<select id="findAllDelayCustomerMessage" resultType="com.yaoyaozw.customer.vo.customer.DelayCustomerListVO">
select * from customer_graphics_delay
</select>
</mapper>
\ No newline at end of file
<?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="com.yaoyaozw.customer.mapper.CustomerGraphicsMapper">
<resultMap id="BaseResultMap" type="com.yaoyaozw.customer.entity.CustomerGraphics">
<!--@mbg.generated-->
<!--@Table customer_graphics-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="pack_id" jdbcType="BIGINT" property="packId" />
<result column="post_time" jdbcType="TIMESTAMP" property="postTime" />
<result column="create_user" jdbcType="BIGINT" property="createUser" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="modified_user" jdbcType="BIGINT" property="modifiedUser" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, pack_id, post_time, create_user, gmt_create, modified_user, gmt_modified, is_deleted
</sql>
</mapper>
\ No newline at end of file
<?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="com.yaoyaozw.customer.mapper.MaterialDelayCustomerMapper">
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论