|
@@ -44,11 +44,13 @@ import com.fs.wxwork.dto.WxSearchContactResp;
|
|
|
import com.fs.wxwork.dto.WxWorkResponseDTO;
|
|
import com.fs.wxwork.dto.WxWorkResponseDTO;
|
|
|
import com.fs.wxwork.service.WxWorkService;
|
|
import com.fs.wxwork.service.WxWorkService;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.redisson.api.RLock;
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -62,9 +64,13 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
-@AllArgsConstructor
|
|
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
public class WxTaskService {
|
|
public class WxTaskService {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${cid-group-no:0}")
|
|
|
|
|
+ private Integer cidGroupNo;
|
|
|
|
|
+
|
|
|
private final ICompanyWxAccountService companyWxAccountService;
|
|
private final ICompanyWxAccountService companyWxAccountService;
|
|
|
private final ISysConfigService sysConfigService;
|
|
private final ISysConfigService sysConfigService;
|
|
|
private final ICompanyWxClientService companyWxClientService;
|
|
private final ICompanyWxClientService companyWxClientService;
|
|
@@ -295,7 +301,7 @@ public class WxTaskService {
|
|
|
if (vo.isSuccess()) {
|
|
if (vo.isSuccess()) {
|
|
|
e.setLastAddWxTime(LocalDateTime.now());
|
|
e.setLastAddWxTime(LocalDateTime.now());
|
|
|
// todo 删除还原 以下为测试所用
|
|
// todo 删除还原 以下为测试所用
|
|
|
-// e.setLastAddWxTime(LocalDateTime.now().plus(-1, ChronoUnit.DAYS));
|
|
|
|
|
|
|
+ e.setLastAddWxTime(LocalDateTime.now().plus(-1, ChronoUnit.DAYS));
|
|
|
e.setIsAddNum(e.getIsAddNum() + 1);
|
|
e.setIsAddNum(e.getIsAddNum() + 1);
|
|
|
client.setIsAdd(2);
|
|
client.setIsAdd(2);
|
|
|
client.setAddTime(LocalDateTime.now());
|
|
client.setAddTime(LocalDateTime.now());
|
|
@@ -826,7 +832,7 @@ public class WxTaskService {
|
|
|
*/
|
|
*/
|
|
|
public void cidWorkflowAddWxRun() {
|
|
public void cidWorkflowAddWxRun() {
|
|
|
log.info("===========工作流延时任务开始扫描===========");
|
|
log.info("===========工作流延时任务开始扫描===========");
|
|
|
- String delayAddWxKeyPrefix = AiAddWxTaskNode.getDelayAddWxKeyPrefix(null) + "*";
|
|
|
|
|
|
|
+ String delayAddWxKeyPrefix = AiAddWxTaskNode.getDelayAddWxKeyPrefix(cidGroupNo,null) + "*";
|
|
|
Set<String> keys = redisKeyScanner.scanMatchKey(delayAddWxKeyPrefix);
|
|
Set<String> keys = redisKeyScanner.scanMatchKey(delayAddWxKeyPrefix);
|
|
|
log.info("共扫描到 {} 个待处理键", keys.size());
|
|
log.info("共扫描到 {} 个待处理键", keys.size());
|
|
|
keys.parallelStream().forEach(key -> {
|
|
keys.parallelStream().forEach(key -> {
|