|
@@ -16,11 +16,15 @@ import com.fdkankan.redis.util.RedisUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -83,6 +87,31 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Scheduled(initialDelay = 2000, fixedDelay = 1000 * 60)
|
|
|
+ public void checkAccount() {
|
|
|
+ HashMap<String,RtkAccount> map = new HashMap<>();
|
|
|
+ String redisKey = "4dkankan:rtk:snCode:*";
|
|
|
+ Set<String> keys = redisUtil.keys(redisKey);
|
|
|
+ if(keys!= null && !keys.isEmpty()){
|
|
|
+ for (String key : keys) {
|
|
|
+ String jsonStr = redisUtil.get(key);
|
|
|
+ RtkAccount rtkAccount = JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
|
+ map.put(rtkAccount.getUserName(),rtkAccount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("map:{}",map);
|
|
|
+ LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(RtkAccount::getStatus,2);
|
|
|
+ List<RtkAccount> list = this.list(wrapper);
|
|
|
+ for (RtkAccount rtkAccount : list) {
|
|
|
+ if(map.containsKey(rtkAccount.getUserName())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ updateAccountStatus(rtkAccount.getId(),1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
DingTalkSendUtils dingTalkSendUtils;
|
|
|
|