Compare commits
No commits in common. "72d2e6b45ffcfa45e937e0f3beb5fcbc2b7f90d7" and "57e58520feb058e9526f3fa501be05fe8c2e6edd" have entirely different histories.
72d2e6b45f
...
57e58520fe
|
@ -109,7 +109,7 @@ public class ProjectController {
|
||||||
List<Project> projectList = commonService.findByFieldEqTargetField(Project::getIsShelves, 1, projectService);
|
List<Project> projectList = commonService.findByFieldEqTargetField(Project::getIsShelves, 1, projectService);
|
||||||
for (Project project : projectList) {
|
for (Project project : projectList) {
|
||||||
BigDecimal projectPrice = projectPriceMap.get(project.getId());
|
BigDecimal projectPrice = projectPriceMap.get(project.getId());
|
||||||
project.setProjectPrice(projectPrice == null ? BigDecimal.ZERO : projectPrice);
|
project.setProjectPrice(projectPrice);
|
||||||
}
|
}
|
||||||
List<ProjectCardVO> projectCardVOS = commonService.convertList(projectList, ProjectCardVO.class);
|
List<ProjectCardVO> projectCardVOS = commonService.convertList(projectList, ProjectCardVO.class);
|
||||||
return ResultUtils.success(projectCardVOS);
|
return ResultUtils.success(projectCardVOS);
|
||||||
|
|
|
@ -100,12 +100,8 @@ public class PromoCodeApplyController {
|
||||||
String promoCodeImage = promoCode.getPromoCodeImage();
|
String promoCodeImage = promoCode.getPromoCodeImage();
|
||||||
// 获取项目的参数信息
|
// 获取项目的参数信息
|
||||||
Project project = projectService.getById(projectId);
|
Project project = projectService.getById(projectId);
|
||||||
|
|
||||||
// 更新项目的推广人数
|
// 更新项目的推广人数
|
||||||
Map<SFunction<UserProject, ?>, Object> projectConditions = Map.of(UserProject::getProjectId, projectId, UserProject::getUserId, userId);
|
project.setCurrentPromotionCount(project.getCurrentPromotionCount() + 1);
|
||||||
List<UserProject> userProjectList = commonService.findByFieldEqTargetFields(projectConditions, userProjectService);
|
|
||||||
if (userProjectList.isEmpty()) project.setCurrentPromotionCount(project.getCurrentPromotionCount() + 1);
|
|
||||||
|
|
||||||
projectService.updateById(project);
|
projectService.updateById(project);
|
||||||
String projectName = project.getProjectName();
|
String projectName = project.getProjectName();
|
||||||
String projectImage = project.getProjectImage();
|
String projectImage = project.getProjectImage();
|
||||||
|
@ -128,7 +124,6 @@ public class PromoCodeApplyController {
|
||||||
promoCodeApplyService.save(promoCodeApply);
|
promoCodeApplyService.save(promoCodeApply);
|
||||||
|
|
||||||
// 添加用户项目记录
|
// 添加用户项目记录
|
||||||
if (userProjectList.isEmpty()) {
|
|
||||||
UserProject userProject = UserProject.builder()
|
UserProject userProject = UserProject.builder()
|
||||||
.projectId(projectId)
|
.projectId(projectId)
|
||||||
.projectName(projectName)
|
.projectName(projectName)
|
||||||
|
@ -137,7 +132,6 @@ public class PromoCodeApplyController {
|
||||||
.userId(userId)
|
.userId(userId)
|
||||||
.build();
|
.build();
|
||||||
userProjectService.save(userProject);
|
userProjectService.save(userProject);
|
||||||
}
|
|
||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ import jakarta.validation.Valid;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -82,7 +81,6 @@ public class UserMainInfoController {
|
||||||
userMainInfoMap.put(userMainInfo.getUserId(), userMainInfo);
|
userMainInfoMap.put(userMainInfo.getUserId(), userMainInfo);
|
||||||
}
|
}
|
||||||
List<UserMemberInfoVO> userMemberInfoVOList = new ArrayList<>();
|
List<UserMemberInfoVO> userMemberInfoVOList = new ArrayList<>();
|
||||||
BigDecimal totalEarnings = BigDecimal.ZERO;
|
|
||||||
for (UserInfo userInfo : userInfoList) {
|
for (UserInfo userInfo : userInfoList) {
|
||||||
Long id = userInfo.getId();
|
Long id = userInfo.getId();
|
||||||
UserInfo userInformation = userInfoMap.get(id);
|
UserInfo userInformation = userInfoMap.get(id);
|
||||||
|
@ -96,17 +94,14 @@ public class UserMainInfoController {
|
||||||
.registerTime(userInformation.getCreateTime())
|
.registerTime(userInformation.getCreateTime())
|
||||||
.build();
|
.build();
|
||||||
userMemberInfoVOList.add(userMemberInfoVO);
|
userMemberInfoVOList.add(userMemberInfoVO);
|
||||||
totalEarnings = totalEarnings.add(userMainInfo.getParentEarnings());
|
|
||||||
}
|
}
|
||||||
UserInfo userInfo = userInfoService.getById(userId);
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
UserTeamInfoVO userTeamInfoVO = commonService.copyProperties(userInfo, UserTeamInfoVO.class);
|
UserTeamInfoVO userTeamInfoVO = commonService.copyProperties(userInfo, UserTeamInfoVO.class);
|
||||||
userTeamInfoVO.setDirectAgentSize(userInfoList.size());
|
userTeamInfoVO.setDirectAgentSize(userInfoList.size());
|
||||||
userTeamInfoVO.setTeamEarnings(totalEarnings);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<UserMainInfo> userMainInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserMainInfo> userMainInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
userMainInfoLambdaQueryWrapper.eq(UserMainInfo::getUserId, userId);
|
userMainInfoLambdaQueryWrapper.eq(UserMainInfo::getUserId, userId);
|
||||||
UserMainInfo userMainInfo = userMainInfoService.getOne(userMainInfoLambdaQueryWrapper);
|
UserMainInfo userMainInfo = userMainInfoService.getOne(userMainInfoLambdaQueryWrapper);
|
||||||
userTeamInfoVO.setTeamSize(userMainInfo.getTeamSize());
|
|
||||||
userTeamInfoVO.setInviteQrCode(userMainInfo.getInviteQrCode());
|
userTeamInfoVO.setInviteQrCode(userMainInfo.getInviteQrCode());
|
||||||
userTeamInfoVO.setUserMemberInfoVOList(userMemberInfoVOList);
|
userTeamInfoVO.setUserMemberInfoVOList(userMemberInfoVOList);
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,11 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||||
|
|
||||||
String invitationCode = userInfoRegisterRequest.getInvitationCode();
|
String invitationCode = userInfoRegisterRequest.getInvitationCode();
|
||||||
LambdaQueryWrapper<UserInfo> invitedLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserInfo> invitedLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
invitedLambdaQueryWrapper.eq(UserInfo::getInvitationCode, invitationCode).eq(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE);
|
invitedLambdaQueryWrapper.eq(UserInfo::getInvitationCode, invitationCode);
|
||||||
UserInfo parentUserInfo = this.getOne(invitedLambdaQueryWrapper);
|
UserInfo parentUserInfo = this.getOne(invitedLambdaQueryWrapper);
|
||||||
ThrowUtils.throwIf(parentUserInfo == null, ErrorCode.OPERATION_ERROR, "邀请码错误");
|
ThrowUtils.throwIf(parentUserInfo == null, ErrorCode.OPERATION_ERROR, "邀请码错误");
|
||||||
|
|
||||||
|
|
||||||
UserInfo myUserInfo = commonService.copyProperties(userInfoRegisterRequest, UserInfo.class);
|
UserInfo myUserInfo = commonService.copyProperties(userInfoRegisterRequest, UserInfo.class);
|
||||||
// 判断当前用户是否是根节点
|
// 判断当前用户是否是根节点
|
||||||
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, this);
|
List<UserInfo> userInfoList = commonService.findByFieldEqTargetField(UserInfo::getUserRole, UserConstant.DEFAULT_ROLE, this);
|
||||||
|
@ -159,14 +160,6 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||||
UserMainInfo userMainInfo = new UserMainInfo();
|
UserMainInfo userMainInfo = new UserMainInfo();
|
||||||
userMainInfo.setUserId(myUserInfo.getId());
|
userMainInfo.setUserId(myUserInfo.getId());
|
||||||
|
|
||||||
// 批量更新父级用户团队人数
|
|
||||||
List<Long> pathToRoot = this.findPathToRoot(myUserInfo.getId());
|
|
||||||
List<UserMainInfo> userMainInfoList = commonService.findByFieldInTargetField(pathToRoot, userMainInfoService, id -> id, UserMainInfo::getUserId);
|
|
||||||
for (UserMainInfo mainInfo : userMainInfoList) {
|
|
||||||
mainInfo.setTeamSize(mainInfo.getTeamSize() + 1);
|
|
||||||
}
|
|
||||||
userMainInfoService.updateBatchById(userMainInfoList);
|
|
||||||
|
|
||||||
// 生成邀请二维码
|
// 生成邀请二维码
|
||||||
try {
|
try {
|
||||||
String view = wechatGetQrcodeService.getWxQrCode(myUserInfo.getInvitationCode());
|
String view = wechatGetQrcodeService.getWxQrCode(myUserInfo.getInvitationCode());
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: test
|
active: dev
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user