|
@@ -158,6 +158,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
boolean update = this.lambdaUpdate()
|
|
|
.set(TenantActivationCode::getSendStatus, EActivationCode.SEND.getCode())
|
|
|
.set(TenantActivationCode::getActivationPhone, idPhoneMap.get(studentId))
|
|
|
+ .set(TenantActivationCode::getSendTime, new Date())
|
|
|
.eq(TenantActivationCode::getActivationStatus, false)
|
|
|
.eq(TenantActivationCode::getId, tenantActivationCodes.get(i).getId())
|
|
|
.update();
|
|
@@ -341,12 +342,19 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
boolean update = this.lambdaUpdate()
|
|
|
.set(TenantActivationCode::getSendStatus, EActivationCode.WAIT)
|
|
|
.set(TenantActivationCode::getActivationPhone, "")
|
|
|
+ .set(TenantActivationCode::getSendTime, null)
|
|
|
.eq(TenantActivationCode::getId, activationCode.getId())
|
|
|
.eq(TenantActivationCode::getActivationStatus, false)
|
|
|
.eq(TenantActivationCode::getSendStatus, EActivationCode.SEND)
|
|
|
.update();
|
|
|
if (!update) {
|
|
|
- throw new BizException("激活码已经激活");
|
|
|
+ TenantActivationCode code = this.getById(activationCode.getId());
|
|
|
+ if (EActivationCode.WAIT.equals(code.getSendStatus())) {
|
|
|
+ throw new BizException("激活码已撤回");
|
|
|
+ }
|
|
|
+ if (Boolean.TRUE.equals(code.getActivationStatus())) {
|
|
|
+ throw new BizException("激活码已经激活");
|
|
|
+ }
|
|
|
}
|
|
|
com.yonge.cooleshow.auth.api.entity.SysUser sysUser = sysUserService.findUserByPhone(activationCode.getActivationPhone());
|
|
|
if (sysUser != null) {
|
|
@@ -406,6 +414,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
for (int i = 0; i < studentIdList.size(); i++) {
|
|
|
TenantActivationCode tenantActivationCode = activationCodes.get(i);
|
|
|
tenantActivationCode.setSendStatus(EActivationCode.SEND);
|
|
|
+ tenantActivationCode.setSendTime(new Date());
|
|
|
tenantActivationCode.setActivationPhone(mapPhoneById.getOrDefault(studentIdList.get(i), ""));
|
|
|
updates.add(tenantActivationCode);
|
|
|
}
|