Commit 2c3c520e by 墨竹

Merge branch 'feature/2022-0104' of http://git.gicdev.com/haoban3.0/haoban-manage3.0

parents 52b6b6c5 a4252645
......@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
......@@ -314,12 +315,20 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
log.info("企业外部联系人id为空");
return false;
}
String lockKey = "updateNewExternalUserid_" + wxEnterpriseId;
if (RedisUtil.isLocked(lockKey)) {
log.info("redis锁,lockKey:{}",lockKey);
return false;
}
RedisUtil.lock(lockKey,1L,TimeUnit.DAYS,0L);
try {
updateNewExUserId(tabHaobanWxEnterprise.getWxEnterpriseId(), tabHaobanWxEnterprise.getCorpid());
log.info("企业外部联系人id end,wxEnterpriseId:{}", wxEnterpriseId);
RedisUtil.unlock(lockKey);
return true;
} catch (Exception e) {
log.info("企业外部联系人id异常,wxEnterpriseId:{},{}", wxEnterpriseId, e.getMessage(), e);
RedisUtil.unlock(lockKey);
return false;
}
}
......@@ -338,6 +347,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
List<QywxNewExternalUseridDTO> newExternalUseridList = qywxUserApiService.getNewExternalUseridByList(corpid, config.getWxSuiteid(), externalUserIdList);
if (CollectionUtils.isEmpty(newExternalUseridList)) {
log.info("更新新的外部联系人id,查询企业微信接口报错");
wxEnterriseMapper.updateExternalFlagById(3, wxEnterpriseId);
return;
}
List<TabExternalUseridLog> tabExternalUseridLogList = new ArrayList<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment