|
@@ -219,17 +219,14 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
String[] pidPaths = user.getPidPath().split(StrPool.COMMA);
|
|
String[] pidPaths = user.getPidPath().split(StrPool.COMMA);
|
|
|
//翻转上级从最近的开始查询
|
|
//翻转上级从最近的开始查询
|
|
|
Arrays.sort(pidPaths, Collections.reverseOrder());
|
|
Arrays.sort(pidPaths, Collections.reverseOrder());
|
|
|
- kxsCamp = baseMapper.selectUsersCamp(pidPaths);
|
|
|
|
|
- if (kxsCamp != null) {
|
|
|
|
|
|
|
+ KxsCampUser kxsCampUser = baseMapper.selectParentUsersCamp(pidPaths);
|
|
|
|
|
+ if (kxsCampUser != null) {
|
|
|
//给训练营加金额
|
|
//给训练营加金额
|
|
|
|
|
+ kxsCamp = baseMapper.selectById(kxsCampUser.getCampId());
|
|
|
kxsCamp.setBonusPool(NumberUtil.add(kxsCamp.getBonusPool(), amount));
|
|
kxsCamp.setBonusPool(NumberUtil.add(kxsCamp.getBonusPool(), amount));
|
|
|
kxsCamp.setOrderNum(kxsCamp.getOrderNum() + number.intValue());
|
|
kxsCamp.setOrderNum(kxsCamp.getOrderNum() + number.intValue());
|
|
|
baseMapper.updateById(kxsCamp);
|
|
baseMapper.updateById(kxsCamp);
|
|
|
|
|
|
|
|
- //给创客团队加金额
|
|
|
|
|
- KxsCampUser kxsCampUser = kxsCampUserService.getOne(Wrappers.<KxsCampUser>lambdaQuery()
|
|
|
|
|
- .eq(KxsCampUser::getCampId, kxsCamp.getId())
|
|
|
|
|
- .eq(KxsCampUser::getUserId, param.getUserId()));
|
|
|
|
|
//给创客团队加金额
|
|
//给创客团队加金额
|
|
|
kxsCampUser.setTeamOrderPool(NumberUtil.add(kxsCampUser.getTeamOrderPool(), amount));
|
|
kxsCampUser.setTeamOrderPool(NumberUtil.add(kxsCampUser.getTeamOrderPool(), amount));
|
|
|
kxsCampUser.setTeamOrderNum(kxsCampUser.getTeamOrderNum() + number.intValue());
|
|
kxsCampUser.setTeamOrderNum(kxsCampUser.getTeamOrderNum() + number.intValue());
|
|
@@ -282,19 +279,16 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
String[] pidPaths = user.getPidPath().split(StrPool.COMMA);
|
|
String[] pidPaths = user.getPidPath().split(StrPool.COMMA);
|
|
|
//翻转上级从最近的开始查询
|
|
//翻转上级从最近的开始查询
|
|
|
Arrays.sort(pidPaths, Collections.reverseOrder());
|
|
Arrays.sort(pidPaths, Collections.reverseOrder());
|
|
|
- kxsCamp = baseMapper.selectUsersCamp(pidPaths);
|
|
|
|
|
- if (kxsCamp != null) {
|
|
|
|
|
|
|
+ KxsCampUser kxsCampUser = baseMapper.selectParentUsersCamp(pidPaths);
|
|
|
|
|
+ if (kxsCampUser != null) {
|
|
|
//判断绑定时间
|
|
//判断绑定时间
|
|
|
if (!LocalDateTimeUtil.isIn(bindTime, kxsCamp.getStartTime(), kxsCamp.getEndTime(), false, false)) {
|
|
if (!LocalDateTimeUtil.isIn(bindTime, kxsCamp.getStartTime(), kxsCamp.getEndTime(), false, false)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ kxsCamp = baseMapper.selectById(kxsCampUser.getCampId());
|
|
|
kxsCamp.setOpenNum(kxsCamp.getOpenNum() + (param.getActType() == 4 ? 2 : 1));
|
|
kxsCamp.setOpenNum(kxsCamp.getOpenNum() + (param.getActType() == 4 ? 2 : 1));
|
|
|
baseMapper.updateById(kxsCamp);
|
|
baseMapper.updateById(kxsCamp);
|
|
|
|
|
|
|
|
- //给创客团队加金额
|
|
|
|
|
- KxsCampUser kxsCampUser = kxsCampUserService.getOne(Wrappers.<KxsCampUser>lambdaQuery()
|
|
|
|
|
- .eq(KxsCampUser::getCampId, kxsCamp.getId())
|
|
|
|
|
- .eq(KxsCampUser::getUserId, param.getUserId()));
|
|
|
|
|
//给创客团队加金额
|
|
//给创客团队加金额
|
|
|
switch (param.getActType()){
|
|
switch (param.getActType()){
|
|
|
case 1 -> kxsCampUser.setTeamPosNum(kxsCampUser.getTeamPosNum() + 1);
|
|
case 1 -> kxsCampUser.setTeamPosNum(kxsCampUser.getTeamPosNum() + 1);
|