feat(aihr): surface org snapshot data quality
This commit is contained in:
+2
@@ -35,6 +35,8 @@ public final class AihrOrgSyncDto {
|
||||
int total,
|
||||
int active,
|
||||
int departed,
|
||||
int phoneLinked,
|
||||
int suspectText,
|
||||
int pageNum,
|
||||
int pageSize,
|
||||
List<OrgProjectOption> projects,
|
||||
|
||||
+12
-1
@@ -124,6 +124,17 @@ public class AihrOrgSyncService {
|
||||
int total = countOrgRows("select count(*) from aihr_org_snapshot" + where, args);
|
||||
int active = countOrgRows("select count(*) from aihr_org_snapshot" + where + " and employment_status = 'active'", args);
|
||||
int departed = countOrgRows("select count(*) from aihr_org_snapshot" + where + " and employment_status = 'departed'", args);
|
||||
int phoneLinked = countOrgRows("select count(*) from aihr_org_snapshot" + where + " and person_phone is not null and person_phone <> ''", args);
|
||||
int suspectText = countOrgRows("""
|
||||
select count(*) from aihr_org_snapshot
|
||||
""" + where + """
|
||||
and (
|
||||
person_name like '%?%'
|
||||
or project_name like '%?%'
|
||||
or dept_name like '%?%'
|
||||
or position_name like '%?%'
|
||||
)
|
||||
""", args);
|
||||
List<Object> rowArgs = new ArrayList<>(args);
|
||||
rowArgs.add(safePageSize);
|
||||
rowArgs.add(offset);
|
||||
@@ -147,7 +158,7 @@ public class AihrOrgSyncService {
|
||||
rs.getString("employment_status"),
|
||||
rs.getString("snapshot_date")
|
||||
), rowArgs.toArray());
|
||||
return new OrgSnapshotResponse(total, active, departed, safePageNum, safePageSize, orgProjects(), orgLevels(), rows);
|
||||
return new OrgSnapshotResponse(total, active, departed, phoneLinked, suspectText, safePageNum, safePageSize, orgProjects(), orgLevels(), rows);
|
||||
}
|
||||
|
||||
private List<JsonNode> fetchOptional(String baseUrl, String token, SyncRequest req, String resourceType,
|
||||
|
||||
Reference in New Issue
Block a user