提交耗时日志输出

This commit is contained in:
Guava
2023-07-05 09:40:24 +08:00
parent 2324083711
commit 298b2851f1

View File

@@ -85,8 +85,10 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
}
// 组织
if (CollectionUtil.isNotEmpty(casesRecommendLaunch.getDeptIds())) {
long tt = System.currentTimeMillis();
for (String orgId : casesRecommendLaunch.getDeptIds()) {
List<OrgRootBean.ResultData> orgChildTree = thirdApi.getOrgChildTree(orgId, token);
log.info("查询组织数据耗时 {}秒", (System.currentTimeMillis() - tt) / 1000);
if (CollectionUtil.isNotEmpty(orgChildTree)) {
for (OrgRootBean.ResultData result : orgChildTree) {
UserListParam build = UserListParam.builder().departId(result.getId()).pageSize(100).build();
@@ -98,16 +100,20 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
}
}
}
log.info("{} 机构查询耗时 {}秒", orgId, (System.currentTimeMillis()) / 1000);
}
log.info("组织查询耗时 {}秒", (System.currentTimeMillis() - tt) / 1000);
}
// 受众关联
if (CollectionUtil.isNotEmpty(casesRecommendLaunch.getGroupIds())) {
long t2 = System.currentTimeMillis();
for (String groupId : casesRecommendLaunch.getGroupIds()) {
List<AuditList> allAudienceList = thirdApi.getAllAudienceList(AuditListParam.builder().audienceId(groupId).pageSize(100).page(1).build(), token);
if (CollectionUtil.isNotEmpty(allAudienceList)) {
allAudienceList.forEach(auditList -> userIds.add(String.valueOf(auditList.getUserId())));
}
}
log.info("耗时 受众查询 {}", (System.currentTimeMillis()) / 1000);
}
if (CollectionUtil.isEmpty(userIds)) {
throw new RuntimeException("推荐人不能为空");