处理BUG

This commit is contained in:
TS-QD1 2025-01-08 15:40:17 +08:00
parent 488ce5f8b0
commit 739dd4afcd
2 changed files with 24 additions and 9 deletions

View File

@ -1,11 +1,15 @@
package cn.com.tenlion.operator.service; package cn.com.tenlion.operator.service;
import cn.com.tenlion.operator.pojo.vos.user.expand.UserExpandVO;
import cn.com.tenlion.operator.service.account.IAccountService; import cn.com.tenlion.operator.service.account.IAccountService;
import cn.com.tenlion.operator.service.user.custom.UserCustomService;
import cn.com.tenlion.operator.service.user.expand.UserExpandServiceImpl;
import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SaveException;
import ink.wgink.interfaces.expand.register.IRegisterHandlerService; import ink.wgink.interfaces.expand.register.IRegisterHandlerService;
import ink.wgink.interfaces.expand.register.IRegisterWithExpandInfoHandlerService; import ink.wgink.interfaces.expand.register.IRegisterWithExpandInfoHandlerService;
import ink.wgink.interfaces.role.IRoleBaseService; import ink.wgink.interfaces.role.IRoleBaseService;
import ink.wgink.interfaces.user.IUserBaseService; import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.interfaces.user.IUserExpandBaseService;
import ink.wgink.pojo.dtos.role.RoleDTO; import ink.wgink.pojo.dtos.role.RoleDTO;
import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.service.role.service.IRoleUserService; import ink.wgink.service.role.service.IRoleUserService;
@ -30,10 +34,11 @@ public class UserRegisterService implements IRegisterHandlerService, IRegisterWi
private IAccountService iAccountService; private IAccountService iAccountService;
@Autowired @Autowired
private IRoleUserService iRoleUserService; private IRoleUserService iRoleUserService;
@Autowired
private UserExpandServiceImpl userExpandService;
@Override @Override
public void handler(String userId, Map<String, Object> requestParams) throws Exception { public void handler(String userId, Map<String, Object> requestParams) throws Exception {
UserDTO userDTO = iUserBaseService.get(userId);
String userRole = requestParams.get("userRole").toString(); String userRole = requestParams.get("userRole").toString();
RoleDTO roleDTO = iRoleBaseService.get(userRole); RoleDTO roleDTO = iRoleBaseService.get(userRole);
if (roleDTO == null) { if (roleDTO == null) {
@ -49,6 +54,8 @@ public class UserRegisterService implements IRegisterHandlerService, IRegisterWi
iAccountService.updateUserTypeToSystemUser(userId); iAccountService.updateUserTypeToSystemUser(userId);
// 3.初始化个人信息 // 3.初始化个人信息
iAccountService.saveCreate(roleName, userId); iAccountService.saveCreate(roleName, userId);
// 4.初始化用户拓展信息
userExpandService.saveOrUpdate(userId, new UserExpandVO());
} }
@Override @Override

View File

@ -13,6 +13,7 @@ import ink.wgink.interfaces.user.IUserExpandBaseService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.pojo.pos.UserPO;
import ink.wgink.service.user.service.IUserService; import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.date.DateUtil; import ink.wgink.util.date.DateUtil;
import ink.wgink.util.map.HashMapUtil; import ink.wgink.util.map.HashMapUtil;
@ -282,16 +283,10 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
} }
public void updateRelationIcByUserId(String userId, UserExpandRelationIcVO userExpandIcVO) { public void updateRelationIcByUserId(String userId, UserExpandRelationIcVO userExpandIcVO) {
UserExpandPO selfPO = getPO(userId); UserPO userPO = userService.getPO(userId);
if (selfPO == null) { if (userPO == null) {
throw new SearchException("用户不存在"); throw new SearchException("用户不存在");
} }
if (StringUtils.equals("ACTIVE", selfPO.getPostpaid())) {
throw new SearchException("后付费用户不能绑定邀请码");
}
if (StringUtils.isNotBlank(selfPO.getRelationIc())) {
throw new SearchException("已经绑定过邀请码");
}
UserExpandPO icUserPO = getPOByIc(userExpandIcVO.getRelationIc()); UserExpandPO icUserPO = getPOByIc(userExpandIcVO.getRelationIc());
if (icUserPO == null) { if (icUserPO == null) {
throw new SearchException("邀请码不正确"); throw new SearchException("邀请码不正确");
@ -299,6 +294,19 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
if (StringUtils.equals(icUserPO.getUserId(), userId)) { if (StringUtils.equals(icUserPO.getUserId(), userId)) {
throw new SearchException("不能绑定自己的邀请码"); throw new SearchException("不能绑定自己的邀请码");
} }
UserExpandPO selfPO = getPO(userId);
if (selfPO == null) {
saveOrUpdate(userId, new UserExpandVO());
selfPO = getPO(userId);
}
if (StringUtils.equals("ACTIVE", selfPO.getPostpaid())) {
throw new SearchException("后付费用户不能绑定邀请码");
}
if (StringUtils.isNotBlank(selfPO.getRelationIc())) {
throw new SearchException("已经绑定过邀请码");
}
Map<String, Object> params = getHashMap(4); Map<String, Object> params = getHashMap(4);
params.put("priceAll", icUserPO.getIcPriceAll()); params.put("priceAll", icUserPO.getIcPriceAll());
params.put("priceMaterial", icUserPO.getIcPriceMaterial()); params.put("priceMaterial", icUserPO.getIcPriceMaterial());