新增邀请码来源标识
This commit is contained in:
@@ -31,4 +31,6 @@ public class FlowTeamInviteUserVO {
|
||||
private String memberName;
|
||||
private String inviteCode;
|
||||
private Date inviteTime;
|
||||
|
||||
private Integer source;
|
||||
}
|
||||
|
@@ -65,4 +65,9 @@ public class FlowTeamStatisticUserDetailVO {
|
||||
* 转赠金额
|
||||
*/
|
||||
private Double giveMoney = 0D;
|
||||
|
||||
/**
|
||||
* 邀请码填写类型
|
||||
*/
|
||||
private String sourceName;
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ public class FlowTeamGroupAdminService {
|
||||
}
|
||||
PageHelper.startPage(page, pageSize);
|
||||
QueryWrapper<FlowTeamInfo> query = new QueryWrapper<>();
|
||||
query.lambda().eq(FlowTeamInfo::getGroupId, groupId).ne(FlowTeamInfo :: getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_DELETED);
|
||||
query.lambda().eq(FlowTeamInfo::getGroupId, groupId).ne(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_DELETED);
|
||||
List<FlowTeamInfo> teams = flowTeamInfoService.list(query);
|
||||
List<FlowTeamInfoAdminVO> teamList = new ArrayList<>();
|
||||
teams.forEach(
|
||||
@@ -173,7 +173,7 @@ public class FlowTeamGroupAdminService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
public void delTeam (String teamId) {
|
||||
public void delTeam(String teamId) {
|
||||
if (StringUtils.isBlank(teamId)) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public class FlowTeamGroupAdminService {
|
||||
QueryWrapper<FlowTeamMember> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamMember::getMemberPhone, phone)
|
||||
.in(FlowTeamMember::getTeamRole, Arrays.asList(FlowTeamConstant.TeamRole.LEADER, FlowTeamConstant.TeamRole.GROUP_LEADER))
|
||||
.eq(FlowTeamMember:: getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
.eq(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
List<FlowTeamMember> teamList = flowTeamMemberService.list(queryWrapper);
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(teamList)) {
|
||||
return null;
|
||||
@@ -244,8 +244,8 @@ public class FlowTeamGroupAdminService {
|
||||
Date now = new Date();
|
||||
String dataStr = com.accompany.common.utils.DateTimeUtil.convertDate(now, com.accompany.common.utils.DateTimeUtil.DEFAULT_DATE_PATTERN_);
|
||||
Long seq = jedisService.incr(RedisKey.flow_team_id_seq.getKey(dataStr));
|
||||
long expireTime = com.accompany.common.utils.DateTimeUtil.getNextDay2(now,1).getTime() - 1;
|
||||
jedisService.expireAt(RedisKey.flow_team_id_seq.getKey(dataStr),expireTime);
|
||||
long expireTime = com.accompany.common.utils.DateTimeUtil.getNextDay2(now, 1).getTime() - 1;
|
||||
jedisService.expireAt(RedisKey.flow_team_id_seq.getKey(dataStr), expireTime);
|
||||
|
||||
return dataStr + String.format("%04d", seq);
|
||||
}
|
||||
@@ -262,12 +262,12 @@ public class FlowTeamGroupAdminService {
|
||||
|
||||
private void checkTeamName(String teamName, String teamId) {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getTeamName, teamName).eq(FlowTeamInfo :: getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getTeamName, teamName).eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
FlowTeamInfo flowTeamInfo = flowTeamInfoService.getOne(queryWrapper);
|
||||
if (null != teamId && flowTeamInfo != null && !flowTeamInfo.getTeamId().equals(teamId)) {
|
||||
if (null != teamId && flowTeamInfo != null && !flowTeamInfo.getTeamId().equals(teamId)) {
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY, "小组名称已存在");
|
||||
}
|
||||
if (null == teamId && null != flowTeamInfo) {
|
||||
if (null == teamId && null != flowTeamInfo) {
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY, "小组名称已存在");
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ public class FlowTeamGroupAdminService {
|
||||
private List<FlowTeamMember> listTeamLeader(String teamId) {
|
||||
QueryWrapper<FlowTeamMember> query = new QueryWrapper<>();
|
||||
query.lambda().eq(FlowTeamMember::getTeamId, teamId)
|
||||
.eq(FlowTeamMember :: getTeamRole, FlowTeamConstant.TeamRole.LEADER)
|
||||
.eq(FlowTeamMember::getTeamRole, FlowTeamConstant.TeamRole.LEADER)
|
||||
.ne(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_DELETED);
|
||||
return flowTeamMemberService.list(query);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ public class FlowTeamGroupAdminService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
private Integer countGroupValidTeam (Long groupId) {
|
||||
private Integer countGroupValidTeam(Long groupId) {
|
||||
QueryWrapper<FlowTeamInfo> query = new QueryWrapper<>();
|
||||
query.lambda().eq(FlowTeamInfo::getGroupId, groupId)
|
||||
.eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
@@ -385,16 +385,17 @@ public class FlowTeamGroupAdminService {
|
||||
|
||||
/**
|
||||
* 获取邀请用户的引流团队信息
|
||||
*
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @param erbanNo
|
||||
* @return
|
||||
*/
|
||||
public Pagination listFlowTeamInfoWithUser(Integer page, Integer pageSize, String erbanNo) {
|
||||
public Pagination<FlowTeamInviteUserVO> listFlowTeamInfoWithUser(Integer page, Integer pageSize, String erbanNo) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
List<FlowTeamInviteUserVO> flowTeamInviteUserVOS = flowTeamGroupAdminMapper.listFlowTeamInfoWithUser(erbanNo);
|
||||
PageInfo<FlowTeamInviteUserVO> pageInfo = new PageInfo<>(flowTeamInviteUserVOS);
|
||||
return new Pagination(pageInfo);
|
||||
return new Pagination<>(pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -202,7 +202,7 @@ public class FlowTeamService {
|
||||
}
|
||||
// 校验当前手机号是否加入其它团队
|
||||
Long joinGroupIdByPhone = flowTeamGroupAdminMapper.getJoinGroupIdByPhone(params.getMemberPhone());
|
||||
if (joinGroupIdByPhone != null && !joinGroupIdByPhone.equals(params.getGroupId())) {
|
||||
if (joinGroupIdByPhone != null && !joinGroupIdByPhone.equals(params.getGroupId())) {
|
||||
throw new ServiceException(BusiStatus.BUSIERROR, "该手机号已被其他团队使用,无法添加成员");
|
||||
}
|
||||
// 小组最大成员上限
|
||||
@@ -226,7 +226,7 @@ public class FlowTeamService {
|
||||
List<FlowTeamMemberInviteCode> memberInviteCodes = flowTeamMemberInviteCodeMapper.selectList(queryWrapper);
|
||||
if (memberInviteCodes == null || memberInviteCodes.isEmpty()) {
|
||||
addMemberInviteCode(memberId, inviteCodes);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, FlowTeamMemberInviteCode> memberCodeMap = memberInviteCodes.stream().collect(Collectors.toMap(FlowTeamMemberInviteCode::getInviteCode, memberInviteCode -> memberInviteCode, (k1, k2) -> k1));
|
||||
@@ -307,12 +307,12 @@ public class FlowTeamService {
|
||||
if (memberId != null) {
|
||||
queryWrapper.lambda().ne(FlowTeamMember::getMemberId, memberId);
|
||||
}
|
||||
queryWrapper.lambda().exists("select 1 from flow_team_member_invite_code ic where flow_team_member.member_id = ic.member_id and ic.invite_code = '" + userInviteCode.getInviteCode() +"'");
|
||||
queryWrapper.lambda().exists("select 1 from flow_team_member_invite_code ic where flow_team_member.member_id = ic.member_id and ic.invite_code = '" + userInviteCode.getInviteCode() + "'");
|
||||
queryWrapper.lambda().in(FlowTeamMember::getMemberStatus, Arrays.asList(MEMBER_STATUS_VALID, MEMBER_STATUS_INVALID));
|
||||
Integer count = flowTeamMemberMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
duplicateCods.add(userInviteCode.getInviteCode());
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -373,12 +373,12 @@ public class FlowTeamService {
|
||||
queryWrapper.lambda().in(FlowTeamMember::getTeamId, teamIdList);
|
||||
}
|
||||
if (StringUtils.isNotBlank(params.getInviteCode())) {
|
||||
queryWrapper.lambda().exists("select 1 from flow_team_member_invite_code ic where flow_team_member.member_id = ic.member_id and ic.invite_code = '" + params.getInviteCode() +"'");
|
||||
queryWrapper.lambda().exists("select 1 from flow_team_member_invite_code ic where flow_team_member.member_id = ic.member_id and ic.invite_code = '" + params.getInviteCode() + "'");
|
||||
}
|
||||
queryWrapper.lambda().in(FlowTeamMember::getMemberStatus, Arrays.asList(MEMBER_STATUS_VALID, MEMBER_STATUS_INVALID))
|
||||
.orderByDesc(FlowTeamMember::getTeamRole).orderByDesc(FlowTeamMember::getMemberId);
|
||||
|
||||
IPage<FlowTeamMember> iPage = new Page<>(params.getPageNumber(),params.getPageSize());
|
||||
IPage<FlowTeamMember> iPage = new Page<>(params.getPageNumber(), params.getPageSize());
|
||||
IPage<FlowTeamMember> flowTeamMemberIPage = flowTeamMemberMapper.selectPage(iPage, queryWrapper);
|
||||
|
||||
return buildVoPage(flowTeamMemberIPage);
|
||||
@@ -429,7 +429,7 @@ public class FlowTeamService {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID)
|
||||
.in(FlowTeamInfo::getTeamId, teamIds);
|
||||
return flowTeamInfoService.list(queryWrapper);
|
||||
return flowTeamInfoService.list(queryWrapper);
|
||||
}
|
||||
|
||||
private List<FlowTeamMemberInviteCode> listFlowTeamMemberInviteCodes(Collection<Long> memberIds) {
|
||||
@@ -441,6 +441,7 @@ public class FlowTeamService {
|
||||
|
||||
/**
|
||||
* 获取分组统计列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@@ -532,6 +533,7 @@ public class FlowTeamService {
|
||||
|
||||
/**
|
||||
* 分组统计明细
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@@ -555,13 +557,11 @@ public class FlowTeamService {
|
||||
flowTeamStatisticSummaryVO.setMemberStatus(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人统计明细
|
||||
*/
|
||||
public List<FlowTeamStatisticUserDetailVO> listUserStatisticDetails(FlowTeamStatisticParams params) {
|
||||
// if (params.getMemberId() == null) {
|
||||
// throw new ServiceException(BusiStatus.PARAMERROR, "传入的组员Id不能为空");
|
||||
// }
|
||||
return flowTeamStatisticMapper.listUserStatisticDetailsV2(params);
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ public class FlowTeamService {
|
||||
List<FlowTeamInfo> flowTeamInfos = listTeam();
|
||||
List<FlowTeamConfVO.TeamItem> teams = new ArrayList<>();
|
||||
flowTeamInfos.forEach(
|
||||
team ->{
|
||||
team -> {
|
||||
FlowTeamConfVO.TeamItem item = new FlowTeamConfVO.TeamItem();
|
||||
item.setTeamId(team.getTeamId());
|
||||
item.setTeamName(team.getTeamName());
|
||||
@@ -628,7 +628,7 @@ public class FlowTeamService {
|
||||
|
||||
private boolean isInCanRefillInviteCodeTime(Users user) {
|
||||
FlowTeamConfVO flowTeamConfVO = getConfig();
|
||||
if (user.getCreateTime().getTime() < System.currentTimeMillis() - flowTeamConfVO.getCanRefillInterval() * 60 * 1000) {
|
||||
if (user.getCreateTime().getTime() < System.currentTimeMillis() - flowTeamConfVO.getCanRefillInterval() * 60 * 1000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -655,9 +655,7 @@ public class FlowTeamService {
|
||||
if (StringUtils.isBlank(user.getInviteCode())) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR, "请填写邀请码");
|
||||
}
|
||||
|
||||
long inviteUid = checkInviteCodeForRefill(user.getInviteCode());
|
||||
|
||||
Users usersByUid = usersService.getUsersByUid(user.getUid());
|
||||
if (usersByUid == null) {
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
@@ -665,19 +663,18 @@ public class FlowTeamService {
|
||||
if (!isInCanRefillInviteCodeTime(usersByUid)) {
|
||||
throw new ServiceException(BusiStatus.TIME_OUT_TO_REFILL_INVITE_CODE);
|
||||
}
|
||||
|
||||
Users userForUpdate = new Users();
|
||||
userForUpdate.setUid(user.getUid());
|
||||
userForUpdate.setInviteCode(user.getInviteCode());
|
||||
userForUpdate.setInviteUid(inviteUid);
|
||||
|
||||
usersBaseService.updateUser(userForUpdate);
|
||||
// 绑定用户与引流团队成员的邀请关系
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUserAsync(user.getInviteCode(), user.getUid());
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUser(user.getInviteCode(), user.getUid(), FlowTeamConstant.UserSourceType.REPAIR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组长添加组内成员
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
public void addTeamMemberByLeader(TeamMemberEditParams params) {
|
||||
@@ -694,8 +691,9 @@ public class FlowTeamService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验组长操作的邀请码
|
||||
* <p>组长只能操作自己在小组后台生成的邀请码</p>
|
||||
* 校验组长操作的邀请码
|
||||
* <p>组长只能操作自己在小组后台生成的邀请码</p>
|
||||
*
|
||||
* @param inviteCodeList
|
||||
*/
|
||||
private void checkOperateInviteCodeByLeader(List<String> inviteCodeList) {
|
||||
@@ -705,7 +703,7 @@ public class FlowTeamService {
|
||||
.filter(i -> !Constant.InviteCodeGenScene.flow_team.equals(i.getGenScene())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(notFlowTeamGenInviteCodes)) {
|
||||
List<String> codes = new ArrayList<>();
|
||||
notFlowTeamGenInviteCodes.forEach( code -> {
|
||||
notFlowTeamGenInviteCodes.forEach(code -> {
|
||||
codes.add(code.getInviteCode());
|
||||
});
|
||||
String msg = "以下邀请码无权操作:" + StringUtils.join(codes, ",") + "。";
|
||||
@@ -715,6 +713,7 @@ public class FlowTeamService {
|
||||
|
||||
/**
|
||||
* 组长编辑组内成员
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
@@ -728,6 +727,7 @@ public class FlowTeamService {
|
||||
|
||||
/**
|
||||
* 获取小组下的邀请码自动进房列表
|
||||
*
|
||||
* @param teamId 小组id
|
||||
* @return
|
||||
*/
|
||||
@@ -740,10 +740,10 @@ public class FlowTeamService {
|
||||
List<FlowTeamInviteCodeRecord> inviteCodes = flowTeamInviteCodeRecordService.listTeamGenInviteCode(teamIds);
|
||||
List<String> queryErbanNos = StringUtils.isNotBlank(erbanNo) ? convertStringToList(erbanNo) : null;
|
||||
List<Long> queryUidList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(queryErbanNos)){
|
||||
for(String erbanNoStr : queryErbanNos){
|
||||
if (!CollectionUtils.isEmpty(queryErbanNos)) {
|
||||
for (String erbanNoStr : queryErbanNos) {
|
||||
Users users = usersService.getUserByErbanNo(Long.valueOf(erbanNoStr));
|
||||
if(users != null){
|
||||
if (users != null) {
|
||||
queryUidList.add(users.getUid());
|
||||
}
|
||||
}
|
||||
@@ -770,16 +770,16 @@ public class FlowTeamService {
|
||||
}
|
||||
checkTeamRoomInviteCode(teamId, roomInviteCode);
|
||||
RoomInviteCode roomInviteCodeForUpdate = new RoomInviteCode();
|
||||
if(id != null){
|
||||
if (id != null) {
|
||||
roomInviteCodeForUpdate.setId(id);
|
||||
}
|
||||
if(erbanNo != null){
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if(user == null){
|
||||
if (user == null) {
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
Room room = roomService.getRoomByUid(user.getUid());
|
||||
if(room == null){
|
||||
if (room == null) {
|
||||
throw new ServiceException(BusiStatus.ROOMNOTEXIST);
|
||||
}
|
||||
roomInviteCodeForUpdate.setRoomUid(user.getUid());
|
||||
@@ -797,7 +797,7 @@ public class FlowTeamService {
|
||||
throw new ServiceException(BusiStatus.BUSIERROR, "邀请码已绑定其他房间");
|
||||
}
|
||||
UserInviteCode specialCode = userInviteCodeService.getByCode(roomInviteCode);
|
||||
if (specialCode != null){
|
||||
if (specialCode != null) {
|
||||
return;
|
||||
}
|
||||
// 校验邀请码是不是自己小组的
|
||||
@@ -835,8 +835,8 @@ public class FlowTeamService {
|
||||
List<String> teamIdList = Arrays.asList(teamId.split(","));
|
||||
QueryWrapper<FlowTeamInviteCodeRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(FlowTeamInviteCodeRecord::getTeamId, teamIdList)
|
||||
.eq(FlowTeamInviteCodeRecord :: getStatus, Constant.status.valid)
|
||||
.orderByDesc(FlowTeamInviteCodeRecord :: getCreateTime);
|
||||
.eq(FlowTeamInviteCodeRecord::getStatus, Constant.status.valid)
|
||||
.orderByDesc(FlowTeamInviteCodeRecord::getCreateTime);
|
||||
if (StringUtils.isNotBlank(inviteCode)) {
|
||||
queryWrapper.lambda().eq(FlowTeamInviteCodeRecord::getInviteCode, inviteCode);
|
||||
}
|
||||
@@ -861,6 +861,7 @@ public class FlowTeamService {
|
||||
|
||||
/**
|
||||
* 组长生成邀请码
|
||||
*
|
||||
* @param teamId
|
||||
* @param genCount
|
||||
* @param creator
|
||||
@@ -907,7 +908,7 @@ public class FlowTeamService {
|
||||
return codeList.size();
|
||||
}
|
||||
|
||||
private List<String> checkGenInviteCode (List<String> codeList) {
|
||||
private List<String> checkGenInviteCode(List<String> codeList) {
|
||||
List<String> validCodeList = new ArrayList<>();
|
||||
codeList.forEach(code -> {
|
||||
// 检查邀请码是否已经被使用
|
||||
@@ -936,7 +937,7 @@ public class FlowTeamService {
|
||||
public List<FlowTeamMember> listTeamMember(String teamId) {
|
||||
QueryWrapper<FlowTeamMember> query = new QueryWrapper<>();
|
||||
query.lambda().in(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID,
|
||||
FlowTeamConstant.MemberStatus.MEMBER_STATUS_INVALID)
|
||||
FlowTeamConstant.MemberStatus.MEMBER_STATUS_INVALID)
|
||||
.eq(FlowTeamMember::getTeamId, teamId);
|
||||
return flowTeamMemberService.list(query);
|
||||
}
|
||||
|
@@ -11,29 +11,41 @@
|
||||
<select id="countGroupValidMember" resultType="java.lang.Integer">
|
||||
select count(fm.member_id) from flow_team_info ft, flow_team_member fm
|
||||
where ft.group_id = #{groupId} and ft.status = 1
|
||||
and ft.team_id = fm.team_id and fm.member_status = 1;
|
||||
and ft.team_id = fm.team_id and fm.member_status = 1;
|
||||
</select>
|
||||
|
||||
<select id="getJoinGroupIdByPhone" resultType="java.lang.Long">
|
||||
select i.group_id from flow_team_member m, flow_team_info i
|
||||
where m.team_id = i.team_id and m.member_status != -1
|
||||
and i.status != -1
|
||||
and m.member_phone = #{phone}
|
||||
and i.status != -1
|
||||
and m.member_phone = #{phone}
|
||||
group by i.group_id
|
||||
</select>
|
||||
|
||||
<select id="listFlowTeamInfoWithUser" resultType="com.accompany.admin.vo.flowteam.FlowTeamInviteUserVO">
|
||||
select u.uid, u.erban_no, u.nick, g.group_name, t.team_name, m.member_name, f.invite_code,
|
||||
f.create_time inviteTime
|
||||
from flow_team_member_invite_user f, users u, flow_team_group g, flow_team_info t,
|
||||
flow_team_member m
|
||||
select
|
||||
u.uid,
|
||||
u.erban_no,
|
||||
u.nick,
|
||||
g.group_name,
|
||||
t.team_name,
|
||||
m.member_name,
|
||||
f.invite_code,
|
||||
f.create_time inviteTime,
|
||||
f.source
|
||||
from
|
||||
flow_team_member_invite_user f,
|
||||
users u,
|
||||
flow_team_group g,
|
||||
flow_team_info t,
|
||||
flow_team_member m
|
||||
where f.uid = u.uid
|
||||
and f.group_id = g.group_id
|
||||
and f.team_id = t.team_id
|
||||
and f.member_id = m.member_id
|
||||
and g.status = 1
|
||||
and t.status = 1
|
||||
and m.member_status in (1, 0)
|
||||
and u.erban_no = #{erbanNo}
|
||||
and f.group_id = g.group_id
|
||||
and f.team_id = t.team_id
|
||||
and f.member_id = m.member_id
|
||||
and g.status = 1
|
||||
and t.status = 1
|
||||
and m.member_status in (1, 0)
|
||||
and u.erban_no = #{erbanNo}
|
||||
</select>
|
||||
</mapper>
|
@@ -1,6 +1,6 @@
|
||||
<?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.accompany.admin.mapper.flowteam.FlowTeamStatisticMapper" >
|
||||
<mapper namespace="com.accompany.admin.mapper.flowteam.FlowTeamStatisticMapper">
|
||||
|
||||
|
||||
<select id="staisticUseInviteCodes"
|
||||
@@ -8,15 +8,15 @@
|
||||
select sum(total_user) newUserCount, sum(charge_user) newChargeUserCount,
|
||||
sum(charge_count) chargeCount, sum(total_charge) chargeMoney,
|
||||
sum(total_send_gift) sendGiftMony from (
|
||||
select count(distinct u.uid) total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
select count(distinct u.uid) total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
sum(case when cr.amount is not null then cr.amount else 0 end) / 100 total_charge,
|
||||
0 total_send_gift
|
||||
0 total_send_gift
|
||||
from account a, users u
|
||||
left join charge_record cr
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange'
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0" >
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="params.groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -33,7 +33,7 @@
|
||||
#{inviteCode}
|
||||
</foreach>
|
||||
and a.uid = u.uid
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0" >
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="params.groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -46,10 +46,10 @@
|
||||
and u.create_time < #{params.endDate}
|
||||
</if>
|
||||
union
|
||||
select 0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
select 0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
sum(case when gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_send_gift
|
||||
from account a, users u
|
||||
left join gift_send_record gsr on u.uid = gsr.uid
|
||||
@@ -58,7 +58,7 @@
|
||||
#{inviteCode}
|
||||
</foreach>
|
||||
and a.uid = u.uid
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0" >
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="params.groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -89,16 +89,16 @@
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
count(distinct a.uid) total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_send_gift
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_send_gift
|
||||
from flow_team_member tm,
|
||||
flow_team_member_invite_code ic,
|
||||
user_invite_code uic
|
||||
left join users u on uic.uid = u.invite_uid and u.invite_code = uic.invite_code
|
||||
left join account a on a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -122,18 +122,18 @@
|
||||
tm.member_name,
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
0 total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
0 total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
sum(case when cr.amount is not null then cr.amount else 0 end) / 100 total_charge,
|
||||
0 total_send_gift
|
||||
0 total_send_gift
|
||||
from flow_team_member tm,
|
||||
flow_team_member_invite_code ic,
|
||||
user_invite_code uic,
|
||||
account a, users u
|
||||
left join charge_record cr
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange'
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -152,7 +152,7 @@
|
||||
and u.invite_uid = uic.uid
|
||||
and u.invite_code = uic.invite_code
|
||||
and a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -172,10 +172,10 @@
|
||||
tm.member_name,
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
sum(case when gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_send_gift
|
||||
from flow_team_member tm,
|
||||
flow_team_member_invite_code ic,
|
||||
@@ -189,7 +189,7 @@
|
||||
and u.invite_uid = uic.uid
|
||||
and u.invite_code = uic.invite_code
|
||||
and a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -208,7 +208,8 @@
|
||||
</select>
|
||||
<select id="listUserStatisticDetails"
|
||||
resultType="com.accompany.admin.vo.flowteam.FlowTeamStatisticUserDetailVO">
|
||||
select t.member_name teamMemberName, t.team_id teamId, t.invite_code inviteCode, t.erban_no userErbanNo , t.nick userNickName,t.create_time signUpTime,
|
||||
select t.member_name teamMemberName, t.team_id teamId, t.invite_code inviteCode, t.erban_no userErbanNo , t.nick
|
||||
userNickName,t.create_time signUpTime,
|
||||
sum(t.charge_count) chargeCount,
|
||||
sum(t.total_charge) chargeMoney,
|
||||
sum(t.total_send_gift) totalSendGiftMoney,
|
||||
@@ -222,16 +223,16 @@
|
||||
u.create_time,
|
||||
sum(case when cr.amount is not null then 1 else 0 end) charge_count,
|
||||
sum(case when cr.amount is not null then cr.amount else 0 end) / 100 total_charge,
|
||||
0 total_send_gift,
|
||||
0 total_no_backbag_send_gift,
|
||||
0 total_backbag_send_gift
|
||||
0 total_send_gift,
|
||||
0 total_no_backbag_send_gift,
|
||||
0 total_backbag_send_gift
|
||||
from flow_team_member tm,
|
||||
flow_team_member_invite_code ic,
|
||||
user_invite_code uic,
|
||||
account a, users u
|
||||
left join charge_record cr
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange'
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -250,7 +251,7 @@
|
||||
and u.invite_uid = uic.uid
|
||||
and u.invite_code = uic.invite_code
|
||||
and a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -276,10 +277,12 @@
|
||||
u.nick,
|
||||
u.create_time,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_charge,
|
||||
sum(case when gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_send_gift,
|
||||
sum(case when gsr.gift_source = 1 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_no_backbag_send_gift,
|
||||
sum(case when gsr.gift_source = 2 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_backbag_send_gift
|
||||
sum(case when gsr.gift_source = 1 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end)
|
||||
total_no_backbag_send_gift,
|
||||
sum(case when gsr.gift_source = 2 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end)
|
||||
total_backbag_send_gift
|
||||
from flow_team_member tm,
|
||||
flow_team_member_invite_code ic,
|
||||
user_invite_code uic,
|
||||
@@ -292,7 +295,7 @@
|
||||
and u.invite_uid = uic.uid
|
||||
and u.invite_code = uic.invite_code
|
||||
and a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -317,7 +320,8 @@
|
||||
;
|
||||
</select>
|
||||
<select id="listUsers" resultType="com.accompany.admin.vo.flowteam.UserWithFlowTeamInfoVO">
|
||||
select u.uid, u.erban_no erbanNo, u.nick, u.create_time createTime, u.invite_code, ic.member_id memberId from users u
|
||||
select u.uid, u.erban_no erbanNo, u.nick, u.create_time createTime, u.invite_code, ic.member_id memberId from
|
||||
users u
|
||||
left join flow_team_member_invite_code ic on ic.invite_code = u.invite_code
|
||||
where u.erban_no in
|
||||
<foreach item="erbanNo" collection="erbanNoList" open="(" separator="," close=")">
|
||||
@@ -349,7 +353,7 @@
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6)
|
||||
and cr.charge_prod_id <> 'exchange' and cr.buss_type in (0,4)
|
||||
and cr.create_time >= u.create_time
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0" >
|
||||
<if test="params.groupApps != null and params.groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="params.groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -450,12 +454,12 @@
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
count(distinct u.uid) total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_send_gift
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_send_gift
|
||||
from flow_team_member_invite_user fu
|
||||
left join flow_team_member tm on fu.member_id = tm.member_id
|
||||
left join flow_team_member tm on fu.member_id = tm.member_id
|
||||
inner join users u on fu.uid = u.uid
|
||||
where fu.team_id = #{teamId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
@@ -471,18 +475,19 @@
|
||||
tm.member_name,
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
0 total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
0 total_user,
|
||||
count(distinct cr.uid) charge_user,
|
||||
sum(case when cr.uid is not null then 1 else 0 end) charge_count,
|
||||
sum(case when cr.amount is not null then cr.amount else 0 end) / 100 total_charge,
|
||||
0 total_send_gift
|
||||
0 total_send_gift
|
||||
from flow_team_member_invite_user fu
|
||||
inner join users u on fu.uid = u.uid
|
||||
left join flow_team_member tm on tm.member_id = fu.member_id
|
||||
left join charge_record cr
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange' and cr.buss_type in (0,4)
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange' and cr.buss_type in
|
||||
(0,4)
|
||||
and cr.create_time >= u.create_time
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -509,10 +514,10 @@
|
||||
tm.member_name,
|
||||
tm.member_status,
|
||||
tm.team_role,
|
||||
0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
0 total_user,
|
||||
0 charge_user,
|
||||
0 charge_count,
|
||||
0 total_charge,
|
||||
sum(case when gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) total_send_gift
|
||||
from flow_team_member tm
|
||||
left join flow_team_member_invite_user fu on tm.member_id = fu.member_id
|
||||
@@ -542,6 +547,7 @@
|
||||
t.nick as userNickName,
|
||||
t.create_time as signUpTime,
|
||||
t.phone,
|
||||
t.sourceName,
|
||||
sum(t.charge_count) as chargeCount,
|
||||
sum(t.total_charge) as chargeMoney,
|
||||
sum(t.total_send_gift) as totalSendGiftMoney,
|
||||
@@ -556,6 +562,7 @@
|
||||
tm.team_id,
|
||||
u.invite_code,
|
||||
u.uid,
|
||||
if(u.source = 0, '自填', '补填') as sourceName,
|
||||
u1.erban_no,
|
||||
u1.nick,
|
||||
u1.create_time,
|
||||
@@ -569,7 +576,7 @@
|
||||
0 as total_give
|
||||
from flow_team_member_invite_user as u
|
||||
left join account as a on u.uid = a.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -579,7 +586,7 @@
|
||||
left join charge_record as cr
|
||||
on cr.uid = u.uid and cr.charge_status in (2,6) and cr.charge_prod_id <> 'exchange'
|
||||
and cr.buss_type in (0,4)
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and cr.charge_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -615,6 +622,7 @@
|
||||
tm.team_id,
|
||||
u.invite_code,
|
||||
u.uid,
|
||||
if(u.source = 0, '自填', '补填') as sourceName,
|
||||
u1.erban_no,
|
||||
u1.nick,
|
||||
u1.create_time,
|
||||
@@ -622,13 +630,15 @@
|
||||
0 as charge_count,
|
||||
0 as total_charge,
|
||||
sum(case when gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) as total_send_gift,
|
||||
sum(case when gsr.gift_source = 1 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) as total_no_backbag_send_gift,
|
||||
sum(case when gsr.gift_source = 2 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) as total_backbag_send_gift,
|
||||
sum(case when gsr.gift_source = 1 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) as
|
||||
total_no_backbag_send_gift,
|
||||
sum(case when gsr.gift_source = 2 and gsr.total_gold_num is not null then gsr.total_gold_num else 0 end) as
|
||||
total_backbag_send_gift,
|
||||
0 as give_count,
|
||||
0 as total_give
|
||||
from flow_team_member_invite_user as u
|
||||
left join account as a on a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -637,7 +647,7 @@
|
||||
left join flow_team_member as tm on u.member_id = tm.member_id
|
||||
left join users as u1 on u.uid = u1.uid
|
||||
left join gift_send_record as gsr on u1.uid = gsr.uid and gsr.create_time >= u1.create_time
|
||||
where 1= 1
|
||||
where 1= 1
|
||||
<if test="teamId != null">
|
||||
and u.team_id = #{teamId}
|
||||
</if>
|
||||
@@ -660,6 +670,7 @@
|
||||
tm.team_id,
|
||||
u.invite_code,
|
||||
u.uid,
|
||||
if(u.source = 0, '自填', '补填') as sourceName,
|
||||
u1.erban_no,
|
||||
u1.nick,
|
||||
u1.create_time,
|
||||
@@ -673,7 +684,7 @@
|
||||
(sum(case when dgh.diamond_num is not null then dgh.diamond_num else 0 end) / 1000) as total_give
|
||||
from flow_team_member_invite_user as u
|
||||
left join account as a on a.uid = u.uid
|
||||
<if test="groupApps != null and groupApps.size > 0" >
|
||||
<if test="groupApps != null and groupApps.size > 0">
|
||||
and a.signup_app in
|
||||
<foreach collection="groupApps" item="signUpApp" open="(" separator="," close=")">
|
||||
#{signUpApp}
|
||||
@@ -701,7 +712,8 @@
|
||||
group by tm.member_name, tm.team_id, u.invite_code, u.uid, u1.erban_no, u1.nick, u1.create_time, u1.phone
|
||||
) as t
|
||||
LEFT JOIN account as a ON t.erban_no = a.erban_no
|
||||
group by t.member_name, t.team_id, t.invite_code, t.erban_no , t.uid, t.nick, t.create_time, a.register_ip, t.phone
|
||||
group by t.member_name, t.team_id, t.invite_code, t.erban_no , t.uid, t.nick, t.create_time, a.register_ip,
|
||||
t.phone
|
||||
order by t.create_time desc, t.invite_code
|
||||
;
|
||||
</select>
|
||||
|
@@ -60,7 +60,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
|
||||
@PostMapping("/saveMember")
|
||||
public BaseResponseVO saveOrUpdateMember(@RequestBody TeamMemberEditParams params) {
|
||||
adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"saveOrUpdateMember","params===>>params:" + JSON.toJSONString(params));
|
||||
adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "saveOrUpdateMember", "params===>>params:" + JSON.toJSONString(params));
|
||||
if (params.getMemberId() != null) {
|
||||
flowTeamService.editTeamMember(params);
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
// 设置下载时客户端Excel的名称
|
||||
String filename = new StrBuilder(teamItem.getTeamName()).append(params.getStartDate()).append("_").append(params.getEndDate()).append("邀请明细.xls").toString();
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"),"ISO8859-1"));
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"), "ISO8859-1"));
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
OutputStream ouputStream = response.getOutputStream();
|
||||
workbook.write(ouputStream);
|
||||
@@ -104,7 +104,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
HSSFSheet sheet = workbook.createSheet("邀请明细");
|
||||
|
||||
String[] headers = {"邀请码","被邀请用户id", "被邀请用户昵称",
|
||||
String[] headers = {"邀请码", "邀请码填写类型", "被邀请用户id", "被邀请用户昵称",
|
||||
"被邀请用户注册ip", "被邀请用户手机号",
|
||||
"引入组", "引入人", "新增日期", "充值次数", "充值金额(美元)",
|
||||
"送礼钻石数",
|
||||
@@ -121,6 +121,8 @@ public class FlowTeamAdminController extends BaseController {
|
||||
int cellIdx = 0;
|
||||
row.createCell(cellIdx).setCellValue(item.getInviteCode());
|
||||
cellIdx++;
|
||||
row.createCell(cellIdx).setCellValue(item.getSourceName());
|
||||
cellIdx++;
|
||||
row.createCell(cellIdx).setCellValue(item.getUserErbanNo());
|
||||
cellIdx++;
|
||||
row.createCell(cellIdx).setCellValue(item.getUserNickName());
|
||||
@@ -168,7 +170,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
// 设置下载时客户端Excel的名称
|
||||
String filename = new StrBuilder(teamItem.getTeamName()).append(params.getStartDate()).append("_").append(params.getEndDate()).append("明细.xls").toString();
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"),"ISO8859-1"));
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"), "ISO8859-1"));
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
OutputStream ouputStream = response.getOutputStream();
|
||||
workbook.write(ouputStream);
|
||||
@@ -214,7 +216,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
public void exportUserStatisticDetails(HttpServletResponse response, FlowTeamStatisticParams params) throws IOException {
|
||||
List<FlowTeamStatisticUserDetailVO> summaryVOS = flowTeamService.listUserStatisticDetails(params);
|
||||
if (summaryVOS == null || summaryVOS.isEmpty()) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
FlowTeamStatisticUserDetailVO flowTeamStatisticUserDetailVO = summaryVOS.get(0);
|
||||
Map<String, FlowTeamConfVO.TeamItem> teamMap = flowTeamService.getTeamMap();
|
||||
@@ -226,7 +228,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
.append(flowTeamStatisticUserDetailVO.getTeamMemberName()).append(" ")
|
||||
.append(params.getStartDate()).append("_").append(params.getEndDate()).append("明细.xls").toString();
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"),"ISO8859-1"));
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + new String(filename.getBytes("utf-8"), "ISO8859-1"));
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
OutputStream ouputStream = response.getOutputStream();
|
||||
workbook.write(ouputStream);
|
||||
@@ -238,7 +240,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
HSSFSheet sheet = workbook.createSheet("邀请明细");
|
||||
|
||||
String[] headers = {"邀请码", "被邀请用户id", "被邀请用户昵称","被邀请用户注册ip","被邀请用户手机号", "引入人", "新增日期", "充值次数", "充值金额", "送礼金额",
|
||||
String[] headers = {"邀请码", "被邀请用户id", "被邀请用户昵称", "被邀请用户注册ip", "被邀请用户手机号", "引入人", "新增日期", "充值次数", "充值金额", "送礼金额",
|
||||
"送礼背包金额", "送礼非背包金额", "累计收到转赠次数", "累计收到转赠金额"};
|
||||
HSSFRow header = sheet.createRow(0);
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
@@ -289,7 +291,7 @@ public class FlowTeamAdminController extends BaseController {
|
||||
|
||||
@PostMapping("/refillUserInviteCode")
|
||||
public BaseResponseVO refillInviteCode(@RequestBody Users user) {
|
||||
adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"refillInviteCode","params===>>user:" + JSON.toJSONString(user));
|
||||
adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "refillInviteCode", "params===>>user:" + JSON.toJSONString(user));
|
||||
flowTeamService.refillUserInviteCode(user);
|
||||
|
||||
return new BaseResponseVO(BusinessStatusCodeEnum.SUCCESS);
|
||||
@@ -297,12 +299,13 @@ public class FlowTeamAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 初始化用户与引流小组成员的邀请绑定关系
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/init/member/inviteUserData")
|
||||
public BaseResponseVO initFlowTeamMemberInviteUserData() {
|
||||
flowTeamMemberInviteUserAdminService.initFlowTeamMemberInviteUserData();
|
||||
return new BaseResponseVO(BusinessStatusCodeEnum.SUCCESS);
|
||||
return new BaseResponseVO(BusinessStatusCodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
@GetMapping("/listTeamByGroupId")
|
||||
|
@@ -15,6 +15,7 @@ import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.params.flowteam.FlowTeamEditInviteUserParams;
|
||||
import com.accompany.admin.service.flowteam.FlowTeamGroupAdminService;
|
||||
import com.accompany.admin.service.system.AdminLogService;
|
||||
import com.accompany.admin.vo.flowteam.FlowTeamInviteUserVO;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.vo.BaseResponseVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -42,6 +43,7 @@ public class FlowTeamGroupAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 分页获取团队列表
|
||||
*
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @param groupName
|
||||
@@ -85,6 +87,7 @@ public class FlowTeamGroupAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 团队功能上线时初始化已有的团队与组信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/initGroupAndTeam", method = RequestMethod.GET)
|
||||
@@ -95,7 +98,7 @@ public class FlowTeamGroupAdminController extends BaseController {
|
||||
|
||||
@ApiOperation("获取邀请用户的引流团队信息")
|
||||
@GetMapping("/listFlowTeamInfoWithUser")
|
||||
public Pagination listFlowTeamInfoWithUser(Integer page, Integer pageSize, String erbanNo) {
|
||||
public Pagination<FlowTeamInviteUserVO> listFlowTeamInfoWithUser(Integer page, Integer pageSize, String erbanNo) {
|
||||
return flowTeamGroupAdminService.listFlowTeamInfoWithUser(page, pageSize, erbanNo);
|
||||
}
|
||||
|
||||
|
@@ -4,13 +4,11 @@ package com.accompany.business.event.listener;
|
||||
import com.accompany.business.event.NewUserEvent;
|
||||
import com.accompany.business.param.neteasepush.NeteaseSendMsgParam;
|
||||
import com.accompany.business.service.SendSysMsgService;
|
||||
import com.accompany.business.service.user.UserInviteCodeService;
|
||||
import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xuanyin.flowteam.service.FlowTeamMemberInviteUserBizService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@@ -21,10 +19,6 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
public class NewUserListener implements ApplicationListener<NewUserEvent> {
|
||||
|
||||
@Autowired
|
||||
private UserInviteCodeService userInviteCodeService;
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteUserBizService flowTeamMemberInviteUserBizService;
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
|
||||
@@ -33,12 +27,6 @@ public class NewUserListener implements ApplicationListener<NewUserEvent> {
|
||||
public void onApplicationEvent(NewUserEvent event) {
|
||||
Users user = (Users) event.getSource();
|
||||
Long uid = user.getUid();
|
||||
|
||||
// 初始化用户邀请码
|
||||
userInviteCodeService.initUserInivteCode(uid);
|
||||
// 绑定与引流小组成员的邀请关系
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUserAsync(user.getInviteCode(), uid);
|
||||
|
||||
log.info("首次登录版本小秘书登录消息, {} ", uid);
|
||||
sendFirstLoginMsgToUser(user);
|
||||
}
|
||||
@@ -48,23 +36,18 @@ public class NewUserListener implements ApplicationListener<NewUserEvent> {
|
||||
*/
|
||||
private void sendFirstLoginMsgToUser(Users u) {
|
||||
Long uid = u.getUid();
|
||||
|
||||
String msg = "Hi!歡迎你的到來!為了方便您的使用,可前往【我的】-【設置】去設置登錄密碼喔>>";
|
||||
|
||||
Attach attach = new Attach();
|
||||
attach.setFirst(Constant.DefineProtocol.CUSTOM_MESS_HEAD_SECRETARY);
|
||||
attach.setSecond(Constant.DefineProtocol.CUSTOM_MESS_SUB_SECRETARY_INTRACTION);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("title", msg);
|
||||
jsonObject.put("msg", msg);
|
||||
jsonObject.put("routerType", Constant.SecretarySkipType.SET_PASSWORD);
|
||||
attach.setData(jsonObject);
|
||||
|
||||
NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam();
|
||||
neteaseSendMsgParam.setType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE);
|
||||
neteaseSendMsgParam.setFrom(SystemConfig.secretaryUid);
|
||||
|
||||
neteaseSendMsgParam.setOpe(0);
|
||||
neteaseSendMsgParam.setTo(uid.toString());
|
||||
neteaseSendMsgParam.setAttach(attach);
|
||||
|
@@ -33,8 +33,8 @@ public class UserInviteCodeService extends ServiceImpl<UserInviteCodeMapper, Use
|
||||
public UserInviteCode getInviteCode(Long uid) {
|
||||
QueryWrapper<UserInviteCode> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(UserInviteCode::getUid, uid)
|
||||
.eq(UserInviteCode::getStatus, INVITE_CODE_STATUS_VALID)
|
||||
.orderByDesc(UserInviteCode::getCreateTime);
|
||||
.eq(UserInviteCode::getStatus, INVITE_CODE_STATUS_VALID)
|
||||
.orderByDesc(UserInviteCode::getCreateTime);
|
||||
List<UserInviteCode> userInviteCodes = userInviteCodeMapper.selectList(queryWrapper);
|
||||
List<UserInviteCode> primaryInviteCodes = userInviteCodes.stream().filter(UserInviteCode::getIsPrimary).collect(Collectors.toList());
|
||||
|
||||
@@ -49,7 +49,7 @@ public class UserInviteCodeService extends ServiceImpl<UserInviteCodeMapper, Use
|
||||
return null;
|
||||
}
|
||||
|
||||
public UserInviteCode getByCode(String code){
|
||||
public UserInviteCode getByCode(String code) {
|
||||
QueryWrapper<UserInviteCode> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(UserInviteCode::getInviteCode, code)
|
||||
.eq(UserInviteCode::getStatus, INVITE_CODE_STATUS_VALID)
|
||||
@@ -57,17 +57,15 @@ public class UserInviteCodeService extends ServiceImpl<UserInviteCodeMapper, Use
|
||||
return userInviteCodeMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
public void initUserInivteCode(Long uid) {
|
||||
public void initUserInviteCode(Long uid) {
|
||||
UserInviteCode inviteCode = getInviteCode(uid);
|
||||
if (inviteCode != null) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
UserInviteCode userInviteCode = new UserInviteCode();
|
||||
userInviteCode.setUid(uid);
|
||||
userInviteCode.setInviteCode(InviteCodeUtil.getInviteCodeByUid(uid));
|
||||
userInviteCode.setIsPrimary(true);
|
||||
|
||||
userInviteCodeMapper.insert(userInviteCode);
|
||||
}
|
||||
|
||||
|
@@ -94,6 +94,8 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.service.FlowTeamMemberInviteUserBizService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
@@ -227,6 +229,12 @@ public class UsersService extends BaseService {
|
||||
@Autowired
|
||||
private RechargeUserService rechargeUserService;
|
||||
|
||||
@Autowired
|
||||
private UserInviteCodeService userInviteCodeService;
|
||||
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteUserBizService flowTeamMemberInviteUserBizService;
|
||||
|
||||
private static String regEx = "^[0-9]*[1-9][0-9]*$";
|
||||
|
||||
public Users getUsersByUid(Long uid) {
|
||||
@@ -263,7 +271,7 @@ public class UsersService extends BaseService {
|
||||
UsersExample usersExample = new UsersExample();
|
||||
usersExample.createCriteria().andUidIn(uidList);
|
||||
List<Users> usersList = this.usersMapper.selectByExample(usersExample);
|
||||
for (Users user: usersList) {
|
||||
for (Users user : usersList) {
|
||||
user.setNick(user.getNick() == null ? null : SensitiveFilterUtil.getStringSensitiveFilter(user.getNick()));
|
||||
user.setUserDesc(user.getUserDesc() == null ? null : SensitiveFilterUtil.getStringSensitiveFilter(user.getUserDesc()));
|
||||
this.jedisService.hset(RedisKey.user.getKey(), user.getUid().toString(), this.gson.toJson(user));
|
||||
@@ -726,12 +734,11 @@ public class UsersService extends BaseService {
|
||||
if (account == null) {
|
||||
return new BusiResult<>(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
|
||||
Users userDb = usersMapper.selectByPrimaryKey(users.getUid());
|
||||
String avatarUrl = users.getAvatar();
|
||||
boolean isReview = false;
|
||||
if (!BlankUtil.isBlank(avatarUrl)) {
|
||||
if (ObjectUtil.isNull(userDb)){
|
||||
if (ObjectUtil.isNull(userDb)) {
|
||||
users.setAvatar(avatarUrl);
|
||||
} else {
|
||||
users.setAvatar(null);
|
||||
@@ -740,18 +747,14 @@ public class UsersService extends BaseService {
|
||||
}
|
||||
}
|
||||
Byte operType = null;
|
||||
|
||||
Date date = new Date();
|
||||
boolean hasRegPacket = false;//如果有被邀请人,判断是被邀请人是否能收到邀请红包
|
||||
|
||||
if (null == userDb) {// 第一次登录
|
||||
log.info("用户第一次注册,uid:" + users.getUid());
|
||||
operType = 2;
|
||||
|
||||
if (null == users.getBirth()) {
|
||||
users.setBirth(new Date(0));
|
||||
}
|
||||
|
||||
String phone = account.getPhone();
|
||||
if (StringUtils.isNotBlank(phone)) {
|
||||
users.setPhone(phone);
|
||||
@@ -769,7 +772,7 @@ public class UsersService extends BaseService {
|
||||
users.setLastLoginIp(account.getRegisterIp());
|
||||
users.setLastLoginRegion(regionService.getRegion(account.getRegisterIp()));
|
||||
}
|
||||
hasRegPacket = checkHasInviteRegisterPacket(users.getShareUid(), deviceInfo);
|
||||
hasRegPacket = checkHasInviteRegisterPacket(users.getShareUid());
|
||||
users.setErbanNo(account.getErbanNo());
|
||||
users.setCreateTime(date);
|
||||
users.setUpdateTime(date);
|
||||
@@ -778,36 +781,33 @@ public class UsersService extends BaseService {
|
||||
}
|
||||
logger.info("saveOrUpdateUserByUidV2 users before insert: {}", JSONObject.toJSONString(users));
|
||||
usersMapper.insertSelective(users);
|
||||
|
||||
//用户注册的时候给用户创建钱包
|
||||
userPurseService.createUserPurse(users.getUid());
|
||||
|
||||
Long uid = users.getUid();
|
||||
String inviteCode = users.getInviteCode();
|
||||
// 初始化用户邀请码
|
||||
userInviteCodeService.initUserInviteCode(uid);
|
||||
// 绑定与引流小组成员的邀请关系
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUser(inviteCode, uid, FlowTeamConstant.UserSourceType.SELF);
|
||||
Byte gender = null != users.getGender() ? users.getGender() : Constant.UserGender.MALE;
|
||||
erBanNetEaseService.updateUserGenderOnly(String.valueOf(users.getUid()), gender);
|
||||
|
||||
//新创建的用户
|
||||
applicationContext.publishEvent(new NewUserEvent(users));
|
||||
|
||||
deleteUserRelateCaches(users);
|
||||
addCurrentDayUserCache(users);
|
||||
} else {
|
||||
checkCanUpdateUserInfo(users);
|
||||
|
||||
operType = 1;
|
||||
users.setUpdateTime(date);
|
||||
usersBaseService.updateUser(users);
|
||||
// 更新用户房间头像
|
||||
//usersMapper.updateUserRoom(users.getUid());
|
||||
}
|
||||
// 更新声音
|
||||
if (StringUtils.isNotBlank(users.getUserVoice()) && users.getVoiceDura() != null) {
|
||||
this.voiceService.updateHistoryVersionVoice(userDb, users);
|
||||
}
|
||||
|
||||
String nick = users.getNick();
|
||||
String avatar = ObjectUtil.isNull(userDb) ? users.getAvatar() : userDb.getAvatar();
|
||||
String uidStr = String.valueOf(users.getUid());
|
||||
|
||||
BaseNetEaseRet baseNetEaseRet = erBanNetEaseService.updateUserInfo(uidStr, nick, avatar);
|
||||
if (200 != baseNetEaseRet.getCode()) {
|
||||
log.info("更新网易云账号信息异常accid=" + uidStr + ",uid=" + users.getUid() + "异常编码=" + baseNetEaseRet.getCode());
|
||||
@@ -821,9 +821,7 @@ public class UsersService extends BaseService {
|
||||
userVo.setNewAvatar(jedisService.hget(RedisKey.user_avatar_under_review.getKey(), String.valueOf(users.getUid())));
|
||||
}
|
||||
ReplaceDomainUtil.handlerForObject(userVo);
|
||||
|
||||
applicationContext.publishEvent(new RoomCacheDealEvent(users.getUid()));
|
||||
|
||||
return new BusiResult<>(userVo);
|
||||
}
|
||||
|
||||
@@ -860,29 +858,12 @@ public class UsersService extends BaseService {
|
||||
this.jedisService.hdel(RedisKey.user_summary.getKey(), user.getUid().toString());
|
||||
}
|
||||
|
||||
public boolean checkHasInviteRegisterPacket(Long shareUid, DeviceInfo curDeviceInfo) {
|
||||
boolean result = false;
|
||||
public boolean checkHasInviteRegisterPacket(Long shareUid) {
|
||||
if (shareUid != null) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// if(shareUid==null){
|
||||
// return result;
|
||||
// }
|
||||
// if(curDeviceInfo==null){//版本稳定之后修改
|
||||
// return true;
|
||||
// }
|
||||
// Users users=getUsersByUid(shareUid);
|
||||
// if(users==null){
|
||||
// return result;
|
||||
// }
|
||||
// //被邀请人与邀请人有着相同的imei号或者deviceId,邀请无效,不给红包
|
||||
//// if(curDeviceInfo.getImei().equals(users.getImei())||curDeviceInfo.getDeviceId().equals(curDeviceInfo.getDeviceId())) {
|
||||
//// return result;
|
||||
//// }
|
||||
// result =true;
|
||||
// return result;
|
||||
}
|
||||
|
||||
public Users fillDeviceInfo(Users users, DeviceInfo deviceInfo) {
|
||||
@@ -1017,15 +998,15 @@ public class UsersService extends BaseService {
|
||||
int size = erbanNoList.size();
|
||||
String[] erbanStrArray = erbanNoList.stream().map(Object::toString).toArray(String[]::new);
|
||||
List<String> usersListStr = jedisService.hmread(RedisKey.user_erban_no.getKey(), erbanStrArray);
|
||||
if (CollectionUtils.isEmpty(usersListStr)){
|
||||
if (CollectionUtils.isEmpty(usersListStr)) {
|
||||
return listUsersFromDbInErbanNos(erbanNoList);
|
||||
}
|
||||
List<Users> usersList = usersListStr.stream()
|
||||
.filter(str->StringUtils.isNotBlank(str) && !ApplicationConstant.NULL_JSON_OBJECT.equals(str))
|
||||
.map(str->gson.fromJson(str, Users.class)).collect(Collectors.toList());
|
||||
if (usersList.size() < size){
|
||||
.filter(str -> StringUtils.isNotBlank(str) && !ApplicationConstant.NULL_JSON_OBJECT.equals(str))
|
||||
.map(str -> gson.fromJson(str, Users.class)).collect(Collectors.toList());
|
||||
if (usersList.size() < size) {
|
||||
Set<Long> cacheErbanNos = usersList.stream().map(Users::getErbanNo).collect(Collectors.toSet());
|
||||
List<Long> dbErbanNos = erbanNoList.stream().filter(erbanNo->!cacheErbanNos.contains(erbanNo)).collect(Collectors.toList());
|
||||
List<Long> dbErbanNos = erbanNoList.stream().filter(erbanNo -> !cacheErbanNos.contains(erbanNo)).collect(Collectors.toList());
|
||||
usersList.addAll(listUsersFromDbInErbanNos(dbErbanNos));
|
||||
}
|
||||
return usersList;
|
||||
@@ -1039,7 +1020,7 @@ public class UsersService extends BaseService {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Users user: usersList){
|
||||
for (Users user : usersList) {
|
||||
user.setNick(user.getNick() == null ? null : SensitiveFilterUtil.getStringSensitiveFilter(user.getNick()));
|
||||
user.setUserDesc(user.getUserDesc() == null ? null : SensitiveFilterUtil.getStringSensitiveFilter(user.getUserDesc()));
|
||||
|
||||
@@ -1510,15 +1491,15 @@ public class UsersService extends BaseService {
|
||||
String[] uidstrArray = uidsList.stream().map(Object::toString).toArray(String[]::new);
|
||||
List<String> usersListStr = jedisService.hmread(RedisKey.user.getKey(), uidstrArray);
|
||||
|
||||
if (CollectionUtils.isEmpty(usersListStr)){
|
||||
if (CollectionUtils.isEmpty(usersListStr)) {
|
||||
return listUsersFromDbInUids(uidsList);
|
||||
}
|
||||
List<Users> usersList = usersListStr.stream()
|
||||
.filter(str->StringUtils.isNotBlank(str) && !ApplicationConstant.NULL_JSON_OBJECT.equals(str))
|
||||
.map(str->gson.fromJson(str, Users.class)).collect(Collectors.toList());
|
||||
if (usersList.size() < size){
|
||||
.filter(str -> StringUtils.isNotBlank(str) && !ApplicationConstant.NULL_JSON_OBJECT.equals(str))
|
||||
.map(str -> gson.fromJson(str, Users.class)).collect(Collectors.toList());
|
||||
if (usersList.size() < size) {
|
||||
Set<Long> cacheUids = usersList.stream().map(Users::getUid).collect(Collectors.toSet());
|
||||
List<Long> dbUids = uidsList.stream().filter(uid->!cacheUids.contains(uid)).collect(Collectors.toList());
|
||||
List<Long> dbUids = uidsList.stream().filter(uid -> !cacheUids.contains(uid)).collect(Collectors.toList());
|
||||
usersList.addAll(listUsersFromDbInUids(dbUids));
|
||||
}
|
||||
return usersList;
|
||||
@@ -1527,7 +1508,7 @@ public class UsersService extends BaseService {
|
||||
|
||||
public Map<Long, Users> getUsersMapByUids(List<Long> uids) {
|
||||
List<Users> usersList = getUsersListByUids(uids);
|
||||
return usersList.stream().collect(Collectors.toMap(Users::getUid, u->u));
|
||||
return usersList.stream().collect(Collectors.toMap(Users::getUid, u -> u));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -30,6 +30,7 @@ import com.accompany.business.vo.user.PrivacyVo;
|
||||
import com.accompany.common.annotation.Authorization;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.exception.ApiException;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
@@ -138,7 +139,7 @@ public class UsersController extends BaseController {
|
||||
CountDownLatch cdl = new CountDownLatch(4);
|
||||
|
||||
boolean isSelft = this.getUid().equals(uid);
|
||||
bizExecutor.execute(()->{
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
if (!isSelft) {
|
||||
userVo.setPrivatePhoto(privatePhotoService.dealPrivatePhotoVo(userVo.getPrivatePhoto()));
|
||||
@@ -160,7 +161,7 @@ public class UsersController extends BaseController {
|
||||
}
|
||||
|
||||
userVo.setBanAccount(accountBlockService.checkAccountBlock(userVo.getErbanNo(), userVo.getPhone()));
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("[getUserByUid] 查询 {} 个人信息类信息 异常 ", uid, e);
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY);
|
||||
} finally {
|
||||
@@ -168,7 +169,7 @@ public class UsersController extends BaseController {
|
||||
}
|
||||
});
|
||||
|
||||
bizExecutor.execute(()->{
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
//过滤自定义敏感词
|
||||
String filterNick = dfaService.filterWord(userVo.getNick());
|
||||
@@ -185,7 +186,7 @@ public class UsersController extends BaseController {
|
||||
List<String> labels = labelService.listByUid(uid);
|
||||
userVo.setLabels(labels);
|
||||
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("[getUserByUid] 查询 {} 个人信息类信息 异常 ", uid, e);
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY);
|
||||
} finally {
|
||||
@@ -193,7 +194,7 @@ public class UsersController extends BaseController {
|
||||
}
|
||||
});
|
||||
|
||||
bizExecutor.execute(()->{
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
//处理话题
|
||||
IPage<World> worldIPage = worldService.queryMyJoinWorlds(uid, 1, 20);
|
||||
@@ -228,7 +229,7 @@ public class UsersController extends BaseController {
|
||||
NewUserSayHelloChannel byChannel = newUserSayHelloChannelService.getByChannel(getDeviceInfo(request).getChannel());
|
||||
userVo.setFromSayHelloChannel(byChannel != null);
|
||||
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("[getUserByUid] 查询 {} 社交类信息 异常 ", uid, e);
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY);
|
||||
} finally {
|
||||
@@ -236,7 +237,7 @@ public class UsersController extends BaseController {
|
||||
}
|
||||
});
|
||||
|
||||
bizExecutor.execute(()->{
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
// 查询用户是否满足首充激励条件
|
||||
Boolean isFirstCharge = firstChargeRewardService.isFirstCharge(uid);
|
||||
@@ -269,7 +270,7 @@ public class UsersController extends BaseController {
|
||||
userVo.setMicNickColor(micNickColour == null ? null : micNickColour.getItemValue());
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("[getUserByUid] 查询 {} 充值类信息 异常 ", uid, e);
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY);
|
||||
} finally {
|
||||
@@ -347,75 +348,63 @@ public class UsersController extends BaseController {
|
||||
return new BusiResult(BusiStatus.SUCCESS, Lists.newArrayList());
|
||||
}
|
||||
|
||||
@RequestMapping(value = "update")
|
||||
@PostMapping("update")
|
||||
@Authorization
|
||||
public BusiResult saveOrUpdateUserByUid(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
BusiResult<UserVo> busiResult = null;
|
||||
public BusiResult<UserVo> saveOrUpdateUserByUid(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
if (userParam == null || userParam.getUid() == null) {
|
||||
return new BusiResult<UserVo>(BusiStatus.PARAMETERILLEGAL);
|
||||
return new BusiResult<>(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
if (!BlankUtil.isBlank(userParam.getNick())) {
|
||||
if (userParam.getNick().length() > 15) {
|
||||
return new BusiResult<UserVo>(BusiStatus.NICK_TOO_LONG);
|
||||
return new BusiResult<>(BusiStatus.NICK_TOO_LONG);
|
||||
}
|
||||
}
|
||||
try {
|
||||
Users usersInfo = usersService.getUsersByUid(userParam.getUid());
|
||||
//不可修改头像的用户拦截
|
||||
Map<String, String> maps = jedisService.hgetAll(RedisKey.room_unchange.getKey());
|
||||
List<Long> uids = maps.keySet().stream().map(key -> Long.parseLong(key)).collect(Collectors.toList());
|
||||
List<Long> uids = maps.keySet().stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
if (uids.contains(userParam.getUid())
|
||||
&& !StringUtils.isBlank(userParam.getAvatar())
|
||||
&& !usersInfo.getAvatar().equalsIgnoreCase(userParam.getAvatar())) {
|
||||
return new BusiResult<>(BusiStatus.ROOM_UNCHANGE);
|
||||
}
|
||||
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
busiResult = usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
|
||||
UserVo userVo = busiResult.getData();
|
||||
if (busiResult.getCode() == 200 && userVo.getOperType() == 2) {
|
||||
//Async异步执行红包邀请活动,用户首次注册,并且属于被人邀请人,则邀请人获得红包
|
||||
// 去除邀请红包和新人红包
|
||||
// if (userVo.isHasRegPacket()) {
|
||||
// userShareRecordService.saveUserShareRegisterRecord(userParam.getShareUid(), userParam.getUid());
|
||||
// }
|
||||
// userPacketService.checkAndGetFirsetPacket(userParam.getUid());
|
||||
}
|
||||
return usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
} catch (Exception e) {
|
||||
logger.error("saveOrUpdateUserByUid error..uid=" + userParam.getUid(), e);
|
||||
return new BusiResult(BusiStatus.BUSIERROR);
|
||||
if (e instanceof ApiException) {
|
||||
ApiException exception = (ApiException) e;
|
||||
return BusiResult.fail(exception.getMessage());
|
||||
} else if (e instanceof ServiceException) {
|
||||
ServiceException exception = (ServiceException) e;
|
||||
return BusiResult.fail(exception.getMessage());
|
||||
}
|
||||
return BusiResult.fail(BusiStatus.BUSIERROR);
|
||||
}
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "updatev2", method = RequestMethod.POST)
|
||||
@PostMapping("updatev2")
|
||||
@Authorization
|
||||
public BusiResult saveOrUpdateUserByUidV2(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
BusiResult<UserVo> busiResult = null;
|
||||
public BusiResult<UserVo> updateUserV2(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
if (userParam == null || userParam.getUid() == null) {
|
||||
busiResult = new BusiResult<UserVo>(BusiStatus.PARAMETERILLEGAL);
|
||||
return BusiResult.fail(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
|
||||
try {
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
busiResult = usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
|
||||
UserVo userVo = busiResult.getData();
|
||||
if (userVo.getOperType() == 2) {
|
||||
//Async异步执行红包邀请活动,用户首次注册,并且属于被人邀请人,则邀请人获得红包
|
||||
// 去除邀请红包和新人红包
|
||||
// if (userVo.isHasRegPacket()) {
|
||||
// userShareRecordService.saveUserShareRegisterRecord(userParam.getShareUid(), userParam.getUid());
|
||||
// }
|
||||
// userPacketService.checkAndGetFirsetPacket(userParam.getUid());
|
||||
}
|
||||
return usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
} catch (Exception e) {
|
||||
logger.error("saveOrUpdateUserByUidV2 error..uid=" + userParam.getUid(), e);
|
||||
return new BusiResult(BusiStatus.BUSIERROR);
|
||||
if (e instanceof ApiException) {
|
||||
ApiException exception = (ApiException) e;
|
||||
return BusiResult.fail(exception.getMessage());
|
||||
} else if (e instanceof ServiceException) {
|
||||
ServiceException exception = (ServiceException) e;
|
||||
return BusiResult.fail(exception.getMessage());
|
||||
}
|
||||
return BusiResult.fail(BusiStatus.BUSIERROR);
|
||||
}
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/test", method = RequestMethod.POST)
|
||||
@@ -938,6 +927,7 @@ public class UsersController extends BaseController {
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
*
|
||||
* @param phone
|
||||
* @param code
|
||||
* @return
|
||||
@@ -947,11 +937,11 @@ public class UsersController extends BaseController {
|
||||
public BusiResult boundPhone(@RequestParam("phone") String phone,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("phoneAreaCode") String phoneAreaCode,
|
||||
HttpServletRequest request) throws Exception{
|
||||
HttpServletRequest request) throws Exception {
|
||||
phone = decryptSensitiveInfo(request, phone);
|
||||
if (phoneBlackService.checkIsNeedInterceptWithPhoneAreaCode(phoneAreaCode,phone)) {
|
||||
if (phoneBlackService.checkIsNeedInterceptWithPhoneAreaCode(phoneAreaCode, phone)) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BE_INTERCEPTED);
|
||||
}
|
||||
return new BusiResult(usersService.boundPhone(getUid(request), phone, code,phoneAreaCode));
|
||||
return new BusiResult(usersService.boundPhone(getUid(request), phone, code, phoneAreaCode));
|
||||
}
|
||||
}
|
||||
|
@@ -50,4 +50,11 @@ public class FlowTeamConstant {
|
||||
public final static Byte UPDATE = 1;
|
||||
public final static Byte DEL = 2;
|
||||
}
|
||||
|
||||
public interface UserSourceType {
|
||||
//自填
|
||||
int SELF = 0;
|
||||
//补填
|
||||
int REPAIR = 1;
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ 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.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -50,4 +51,10 @@ public class FlowTeamMemberInviteUser {
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 来源类型 0 自填 1 补填
|
||||
*/
|
||||
@ApiModelProperty("来源类型 0 自填 1 补填")
|
||||
@TableField("source")
|
||||
private Integer source;
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.accompany.common.exception.ApiException;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
@@ -46,19 +47,19 @@ public class FlowTeamMemberInviteUserBizService {
|
||||
|
||||
/**
|
||||
* 保存引流小组成员与用户之间的邀请关系
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @param uid 被邀请用户uid
|
||||
* @param uid 被邀请用户uid
|
||||
*/
|
||||
@Async
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
public void saveFlowTeamMemberInviteUserAsync(String inviteCode, Long uid) {
|
||||
public void saveFlowTeamMemberInviteUser(String inviteCode, Long uid, Integer source) {
|
||||
if (uid == null || StringUtils.isBlank(inviteCode)) {
|
||||
return;
|
||||
}
|
||||
// 根据邀请码查询对用的引流小组成员与当前所处小组信息
|
||||
FlowTeamMemberInviteCode flowTeamMemberInviteCode = flowTeamMemberInviteCodeService.getByInviteCode(inviteCode);
|
||||
if (flowTeamMemberInviteCode == null) {
|
||||
return;
|
||||
throw new ApiException("請輸入正確的邀請碼");
|
||||
}
|
||||
Long memberId = flowTeamMemberInviteCode.getMemberId();
|
||||
FlowTeamMember flowTeamMember = flowTeamMemberService.getById(memberId);
|
||||
@@ -72,16 +73,18 @@ public class FlowTeamMemberInviteUserBizService {
|
||||
if (null == flowTeamInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
FlowTeamMemberInviteUser flowTeamMemberInviteUser = buildFlowTeamMemberInviteUser(flowTeamMember, inviteCode, uid, flowTeamInfo.getGroupId());
|
||||
Date now = new Date();
|
||||
FlowTeamMemberInviteUser flowTeamMemberInviteUser = FlowTeamMemberInviteUser.builder()
|
||||
.groupId(flowTeamInfo.getGroupId())
|
||||
.teamId(flowTeamMember.getTeamId())
|
||||
.memberId(flowTeamMember.getMemberId())
|
||||
.inviteCode(inviteCode)
|
||||
.uid(uid)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.source(source)
|
||||
.build();
|
||||
flowTeamMemberInviteUserService.save(flowTeamMemberInviteUser);
|
||||
}
|
||||
|
||||
private FlowTeamMemberInviteUser buildFlowTeamMemberInviteUser(FlowTeamMember flowTeamMember, String inviteCode, Long uid, Long groupId) {
|
||||
return FlowTeamMemberInviteUser.builder().groupId(groupId).teamId(flowTeamMember.getTeamId())
|
||||
.memberId(flowTeamMember.getMemberId()).inviteCode(inviteCode).uid(uid)
|
||||
.createTime(new Date()).updateTime(new Date()).build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user