|
@@ -152,17 +152,16 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
Map<Long, String> idPhoneMap = sysUserMapper.selectBatchIds(studentIds).stream()
|
|
Map<Long, String> idPhoneMap = sysUserMapper.selectBatchIds(studentIds).stream()
|
|
.collect(Collectors.toMap(SysUser::getId, SysUser::getPhone));
|
|
.collect(Collectors.toMap(SysUser::getId, SysUser::getPhone));
|
|
|
|
|
|
- for (Long studentId : studentIds) {
|
|
|
|
- for (TenantActivationCode tenantActivationCode : tenantActivationCodes) {
|
|
|
|
- boolean update = this.lambdaUpdate()
|
|
|
|
- .set(TenantActivationCode::getSendStatus, EActivationCode.SEND.getCode())
|
|
|
|
- .set(TenantActivationCode::getActivationPhone, idPhoneMap.get(studentId))
|
|
|
|
- .eq(TenantActivationCode::getActivationStatus, false)
|
|
|
|
- .eq(TenantActivationCode::getId, tenantActivationCode.getId())
|
|
|
|
- .update();
|
|
|
|
- if (!update) {
|
|
|
|
- throw new BizException("激活码已被激活:" + tenantActivationCode.getActivationCode());
|
|
|
|
- }
|
|
|
|
|
|
+ for (int i = 0; i < studentIds.size(); i++) {
|
|
|
|
+ Long studentId = studentIds.get(i);
|
|
|
|
+ boolean update = this.lambdaUpdate()
|
|
|
|
+ .set(TenantActivationCode::getSendStatus, EActivationCode.SEND.getCode())
|
|
|
|
+ .set(TenantActivationCode::getActivationPhone, idPhoneMap.get(studentId))
|
|
|
|
+ .eq(TenantActivationCode::getActivationStatus, false)
|
|
|
|
+ .eq(TenantActivationCode::getId, tenantActivationCodes.get(i).getId())
|
|
|
|
+ .update();
|
|
|
|
+ if (!update) {
|
|
|
|
+ throw new BizException("激活码已被激活:" + tenantActivationCodes.get(i).getActivationCode());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|