|
@@ -82,6 +82,7 @@ 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);
|
|
RtkAccount rtkAccount = JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
RtkAccount rtkAccount = JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
|
|
+ log.info("rtkAccount:{}",jsonStr);
|
|
Boolean flag = checkAccountFailureTime(rtkAccount.getId());
|
|
Boolean flag = checkAccountFailureTime(rtkAccount.getId());
|
|
if(flag){
|
|
if(flag){
|
|
redisUtil.expire(redisKey,time);
|
|
redisUtil.expire(redisKey,time);
|
|
@@ -102,13 +103,13 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
dingdingService.sendDingDingMsg(0);
|
|
dingdingService.sendDingDingMsg(0);
|
|
throw new BusinessException(ResultCode.RTK_ACCOUNT_NOT_EXIT);
|
|
throw new BusinessException(ResultCode.RTK_ACCOUNT_NOT_EXIT);
|
|
}
|
|
}
|
|
- dingdingService.modelThreshold(list.size() -1,this.count());
|
|
|
|
|
|
+ dingdingService.modelThreshold(list.size() -1,this.getCanUseCount());
|
|
|
|
|
|
RtkAccount rtkAccount = null;
|
|
RtkAccount rtkAccount = null;
|
|
RtkUseLog rtkUseLog = rtkUseLogService.getByRtkSn(rtkSnCode);
|
|
RtkUseLog rtkUseLog = rtkUseLogService.getByRtkSn(rtkSnCode);
|
|
if(rtkUseLog != null && rtkUseLog.getRtkAccountId() != null){
|
|
if(rtkUseLog != null && rtkUseLog.getRtkAccountId() != null){
|
|
RtkAccount rtkAccount2 = this.getById(rtkUseLog.getRtkAccountId());
|
|
RtkAccount rtkAccount2 = this.getById(rtkUseLog.getRtkAccountId());
|
|
- if(rtkAccount2 != null && rtkAccount2.getStatus() == 1){
|
|
|
|
|
|
+ if(rtkAccount2 != null && rtkAccount2.getStatus() == 1 && rtkAccount2.getUseStatus() == 0){
|
|
rtkAccount = rtkAccount2;
|
|
rtkAccount = rtkAccount2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -121,6 +122,13 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
return rtkAccount;
|
|
return rtkAccount;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Long getCanUseCount() {
|
|
|
|
+ LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(RtkAccount::getUseStatus,0);
|
|
|
|
+ return this.count(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
private Boolean checkAccountFailureTime(Integer accountId) {
|
|
private Boolean checkAccountFailureTime(Integer accountId) {
|
|
RtkAccount dbRtkAccount = this.getById(accountId);
|
|
RtkAccount dbRtkAccount = this.getById(accountId);
|
|
if(dbRtkAccount == null || dbRtkAccount.getStatus() == 3 || dbRtkAccount.getUseStatus() == 1){
|
|
if(dbRtkAccount == null || dbRtkAccount.getStatus() == 3 || dbRtkAccount.getUseStatus() == 1){
|