fix(identity): search org snapshots by phone
This commit is contained in:
+3
-1
@@ -469,12 +469,14 @@ public class AihrOrgSyncService {
|
||||
args.add(like);
|
||||
} else {
|
||||
where.append("""
|
||||
and (ext_party_id like ? or position_name like ? or project_code like ? or project_name like ?)
|
||||
and (ext_party_id like ? or person_phone like ? or position_name like ?
|
||||
or project_code like ? or project_name like ?)
|
||||
""");
|
||||
args.add(like);
|
||||
args.add(like);
|
||||
args.add(like);
|
||||
args.add(like);
|
||||
args.add(like);
|
||||
}
|
||||
}
|
||||
String project = clean(projectCode);
|
||||
|
||||
+13
@@ -95,6 +95,19 @@ public class AihrOrgSyncServiceTest {
|
||||
assertEquals(true, ReflectionTestUtils.getField(masked, "suspectText"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hiddenDisplayFieldsStillAllowIdentitySearchByPhone() {
|
||||
AihrOrgSyncService service = new AihrOrgSyncService(new ObjectMapper(), mock(JdbcTemplate.class), mock(TransactionTemplate.class));
|
||||
ReflectionTestUtils.setField(service, "storeDisplayFields", false);
|
||||
List<Object> args = new ArrayList<>();
|
||||
|
||||
String where = ReflectionTestUtils.invokeMethod(service, "orgSnapshotWhere",
|
||||
"13900001111", null, null, "active", args);
|
||||
|
||||
assertTrue(where.contains("person_phone like ?"));
|
||||
assertFalse(where.contains("person_name like ?"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void snapshotSuspectTextQuerySearchesLiteralQuestionMarks() {
|
||||
SnapshotJdbcTemplate jdbcTemplate = new SnapshotJdbcTemplate();
|
||||
|
||||
Reference in New Issue
Block a user