|
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
-import com.fdkankan.dingtalk.DingTalkSendUtils;
|
|
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
import com.fdkankan.manage.entity.*;
|
|
import com.fdkankan.manage.entity.*;
|
|
@@ -77,8 +76,14 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
}
|
|
}
|
|
if(redisUtil.hasKey(redisKey)){
|
|
if(redisUtil.hasKey(redisKey)){
|
|
String jsonStr = redisUtil.get(redisKey);
|
|
String jsonStr = redisUtil.get(redisKey);
|
|
- redisUtil.expire(redisKey,time);
|
|
|
|
- return JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
|
|
|
|
+ RtkAccount rtkAccount = JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
|
|
+ Boolean flag = checkAccountFailureTime(rtkAccount.getId());
|
|
|
|
+ if(flag){
|
|
|
|
+ redisUtil.expire(redisKey,time);
|
|
|
|
+ return rtkAccount;
|
|
|
|
+ }else {
|
|
|
|
+ redisUtil.del(redisKey);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -110,6 +115,17 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
return rtkAccount;
|
|
return rtkAccount;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private Boolean checkAccountFailureTime(Integer accountId) {
|
|
|
|
+ RtkAccount dbRtkAccount = this.getById(accountId);
|
|
|
|
+ if(dbRtkAccount == null || dbRtkAccount.getStatus() == 3){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if(dbRtkAccount.getFailureTime() != null && dbRtkAccount.getFailureTime().getTime() <= new Date().getTime() ){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void updateAccountStatus(Integer id, int status) {
|
|
public void updateAccountStatus(Integer id, int status) {
|
|
LambdaUpdateWrapper<RtkAccount> wrapper1 = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<RtkAccount> wrapper1 = new LambdaUpdateWrapper<>();
|
|
@@ -129,14 +145,6 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Object pageList(RtkInfoParam param) {
|
|
public Object pageList(RtkInfoParam param) {
|
|
LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -205,4 +213,13 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
wrapper.eq(RtkAccount::getUserName,userName);
|
|
wrapper.eq(RtkAccount::getUserName,userName);
|
|
return this.getOne(wrapper);
|
|
return this.getOne(wrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<RtkAccount> getByNotFailure() {
|
|
|
|
+ LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.ne(RtkAccount::getStatus,3);
|
|
|
|
+ wrapper.isNotNull(RtkAccount::getFailureTime);
|
|
|
|
+ wrapper.le(RtkAccount::getFailureTime,new Date());
|
|
|
|
+ return this.list(wrapper);
|
|
|
|
+ }
|
|
}
|
|
}
|