cp_record_fixed
This commit is contained in:
@@ -226,6 +226,7 @@ public enum I18nAlertEnum {
|
||||
CP_LEVEL_DOWN_SYS("您和{0}的CP关系即将结束,快去送CP礼物维持吧!"),
|
||||
CP_CANCEL_SYS("您已经成功解除和{0}的CP。"),
|
||||
CP_BE_CANCEL_SYS("{0}已经和您解除CP关系。"),
|
||||
CP_DOWN_CANCEL_SYS("您和{0}的CP关系已经解除。"),
|
||||
|
||||
;
|
||||
|
||||
|
@@ -12,4 +12,5 @@ public class AgencyOwnerVo {
|
||||
private String nationalFlag;
|
||||
private Integer agencyId;
|
||||
private Integer guildId;
|
||||
private String guildName;
|
||||
}
|
||||
|
@@ -2,6 +2,9 @@ package com.accompany.business.vo.user;
|
||||
|
||||
import com.accompany.business.model.UserGiftWall;
|
||||
import com.accompany.business.vo.gamepartner.UserGamePartnerInfoVo;
|
||||
import com.accompany.business.vo.guild.AgencyOwnerVo;
|
||||
import com.accompany.business.vo.guild.GuildMemberVo;
|
||||
import com.accompany.business.vo.guild.GuildVo;
|
||||
import com.accompany.business.vo.medal.UserDetailMedalVo;
|
||||
import com.accompany.business.vo.relation.RelationUserVO;
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
@@ -87,4 +90,6 @@ public class UserDetailsVo {
|
||||
private UserDetailMedalVo medals;
|
||||
|
||||
private RelationUserVO relationUserVO;
|
||||
|
||||
private AgencyOwnerVo guildInfo;
|
||||
}
|
||||
|
@@ -83,7 +83,8 @@ public class GiftListService extends BaseService {
|
||||
Constant.GiftPanelTab.VIP,
|
||||
Constant.GiftPanelTab.SINGLE_POPULAR,
|
||||
Constant.GiftPanelTab.WEEK_STAR,
|
||||
Constant.GiftPanelTab.DRAW
|
||||
Constant.GiftPanelTab.DRAW,
|
||||
Constant.GiftPanelTab.CP_GIFT
|
||||
);
|
||||
|
||||
public Map<String, List<GiftVo>> listGiftV5(Long uid, Long roomUid) {
|
||||
|
@@ -418,4 +418,22 @@ public class GuildManagerService {
|
||||
|
||||
return voList;
|
||||
}
|
||||
|
||||
public AgencyOwnerVo getByMemberUid(Long uid) {
|
||||
GuildMember vaildGuildMemberByUid = guildMemberService.getVaildGuildMemberByUid(uid);
|
||||
if (null == vaildGuildMemberByUid) {
|
||||
return null;
|
||||
}
|
||||
Guild vaildGuildById = guildService.getVaildGuildById(vaildGuildMemberByUid.getGuildId());
|
||||
if (null == vaildGuildById) {
|
||||
return null;
|
||||
}
|
||||
AgencyOwnerVo agencyOwnerVo = new AgencyOwnerVo();
|
||||
Users users = usersService.getUsersByUid(vaildGuildById.getOwnerUid());
|
||||
agencyOwnerVo.setGuildId(vaildGuildMemberByUid.getGuildId());
|
||||
agencyOwnerVo.setAvatar(users.getAvatar());
|
||||
agencyOwnerVo.setErbanNo(users.getErbanNo());
|
||||
agencyOwnerVo.setGuildName(vaildGuildById.getName());
|
||||
return agencyOwnerVo;
|
||||
}
|
||||
}
|
||||
|
@@ -207,6 +207,7 @@ public class BillRecordService extends ServiceImpl<BillRecordMapper, BillRecord>
|
||||
objTypes.add(BillObjTypeEnum.GUILD_USD_EXCHANGE_GOLD_IN.getValue());
|
||||
objTypes.add(BillObjTypeEnum.GUILD_USD_TO_RECHARGE_USER_IN.getValue());
|
||||
objTypes.add(BillObjTypeEnum.SS_GUILD_MONTH_MEMBER_DIAMOND.getValue());
|
||||
objTypes.add(BillObjTypeEnum.CANCEL_CP.getValue());
|
||||
break;
|
||||
case GOLD_OUT:
|
||||
objTypes.add(BillObjTypeEnum.WITHDRAW.getValue());
|
||||
|
@@ -278,6 +278,7 @@ public class RelationUserServiceImpl extends ServiceImpl<RelationUserMapper, Rel
|
||||
continue;
|
||||
}
|
||||
Users userOne = usersService.getUsersByUid(uidOne);
|
||||
Users userTwo = usersService.getUsersByUid(uidTwo);
|
||||
RScoredSortedSet<String> totalCpValueSet = this.totalCpValueSet(userOne.getPartitionId());
|
||||
Double nowCpValue = totalCpValueSet.addScore(s, subCpValue);
|
||||
double lastCpvalue = nowCpValue + Math.abs(subCpValue);
|
||||
@@ -286,17 +287,18 @@ public class RelationUserServiceImpl extends ServiceImpl<RelationUserMapper, Rel
|
||||
lastSendTimeSet.remove(s);
|
||||
this.updateValue(uidOne, uidTwo, 0D, 0, RelationConstant.RelationStatus.CANCEL);
|
||||
this.updateValue(uidTwo, uidOne, 0D, 0, RelationConstant.RelationStatus.CANCEL);
|
||||
String oneSys = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CP_DOWN_CANCEL_SYS, new Object[]{userTwo.getNick()}, userOne.getPartitionId());
|
||||
String twoSys = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CP_DOWN_CANCEL_SYS, new Object[]{userOne.getNick()}, userTwo.getPartitionId());
|
||||
baseSendService.sendSystemMsg(uidOne.toString(), oneSys);
|
||||
baseSendService.sendSystemMsg(uidTwo.toString(), twoSys);
|
||||
} else { //降级/解绑逻辑
|
||||
Integer lastLevel = relationInfoService.parseCpLevel(lastCpvalue);
|
||||
Integer nowLevel = relationInfoService.parseCpLevel(nowCpValue);
|
||||
Integer subLevel = lastLevel - nowLevel;
|
||||
baseMapper.updateCpValue(uidOne, uidTwo, subCpValue, -subLevel, null, null);
|
||||
baseMapper.updateCpValue(uidTwo, uidOne, subCpValue, -subLevel, null, null);
|
||||
if (lastLevel.intValue() == nowLevel) {
|
||||
continue;
|
||||
}
|
||||
Users userTwo = usersService.getUsersByUid(uidTwo);
|
||||
if (nowLevel != 0 || nowCpValue < loverConfig.getNotifyDownMsgValue()) { //
|
||||
|
||||
if (nowCpValue < loverConfig.getNotifyDownMsgValue()) { //
|
||||
String oneSys = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CP_LEVEL_DOWN_SYS, new Object[]{userTwo.getNick()}, userOne.getPartitionId());
|
||||
String twoSys = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CP_LEVEL_DOWN_SYS, new Object[]{userOne.getNick()}, userTwo.getPartitionId());
|
||||
baseSendService.sendSystemMsg(uidOne.toString(), oneSys);
|
||||
|
@@ -7,6 +7,7 @@ import com.accompany.business.param.neteasepush.NeteasePushParam;
|
||||
import com.accompany.business.service.SendSysMsgService;
|
||||
import com.accompany.business.service.account.AccountBlockService;
|
||||
import com.accompany.business.service.community.DynamicService;
|
||||
import com.accompany.business.service.guild.GuildManagerService;
|
||||
import com.accompany.business.service.medal.UserMedalService;
|
||||
import com.accompany.business.service.gamepartner.UserGamePartnerInfoService;
|
||||
import com.accompany.business.service.relation.RelationUserService;
|
||||
@@ -85,6 +86,9 @@ public class UserDetailsService extends BaseService {
|
||||
@Autowired
|
||||
private RelationUserService relationUserService;
|
||||
|
||||
@Autowired
|
||||
private GuildManagerService guildManagerService;
|
||||
|
||||
/**
|
||||
* 获取用户资料详情
|
||||
*
|
||||
@@ -204,6 +208,7 @@ public class UserDetailsService extends BaseService {
|
||||
userDetailsVo.setUserGamePartner(userGamePartnerInfoService.listUserGamePartnerInfo(uid));
|
||||
userDetailsVo.setIsRechargeUser(rechargeUserService.isRechargeUser(uid));
|
||||
userDetailsVo.setRelationUserVO(relationUserService.getOneCP(uid));
|
||||
userDetailsVo.setGuildInfo(guildManagerService.getByMemberUid(uid));
|
||||
try {
|
||||
cdl.await(5, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
|
@@ -0,0 +1,19 @@
|
||||
package com.accompany.scheduler.task.relation;
|
||||
|
||||
import com.accompany.business.service.relation.RelationUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class RelationTask {
|
||||
@Autowired
|
||||
private RelationUserService relationUserService;
|
||||
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void taskDownCpValue() {
|
||||
relationUserService.taskDown();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user