fix(aihr): prefer supervisor identity mapping
This commit is contained in:
+5
-2
@@ -68,8 +68,11 @@ public class AihrMobileController {
|
||||
if (phone.isBlank()) {
|
||||
return R.ok(new IdentityResponse("user", "员工端", "", "一线"));
|
||||
}
|
||||
var snapshot = orgSyncService.snapshot(phone, null, null, "active", 1, 1, 1);
|
||||
var row = snapshot.rows().stream().findFirst();
|
||||
var snapshot = orgSyncService.snapshot(phone, null, null, "active", 1, 500, 500);
|
||||
var row = snapshot.rows().stream()
|
||||
.filter(person -> "主管".equals(person.positionLevel()) || "项目经理".equals(person.positionLevel()))
|
||||
.findFirst()
|
||||
.or(() -> snapshot.rows().stream().findFirst());
|
||||
if (row.isEmpty()) {
|
||||
return R.ok(new IdentityResponse("user", "员工端", "", "一线"));
|
||||
}
|
||||
|
||||
+2
-1
@@ -86,7 +86,7 @@ public class AihrPracticeSeedServiceTest {
|
||||
assertTrue(csv.contains("\"training_count\",\"1\""));
|
||||
assertTrue(csv.contains("\"FORMAL-1\",\"P1\",\"session-1\""));
|
||||
assertTrue(csv.contains("\"ai_score\",\"calibration_original_score\",\"human_score\""));
|
||||
assertTrue(csv.contains("\"3\",\"86\",\"86\",\"78\",\"主管甲\""));
|
||||
assertTrue(csv.contains("\"3\",\"\",\"\",\"86\",\"86\",\"78\",\"主管甲\""));
|
||||
assertTrue(csv.contains("\"78\"\n"));
|
||||
}
|
||||
|
||||
@@ -356,6 +356,7 @@ public class AihrPracticeSeedServiceTest {
|
||||
assertTrue(controllerSource.contains("mobileSeedService.markReviewed(id, request, supervisorScopeExtPartyId())"));
|
||||
assertTrue(controllerSource.contains("mobileSeedService.practiceAlerts(supervisorScopeExtPartyId())"));
|
||||
assertTrue(controllerSource.contains("mobileSeedService.createPracticeAssignment(request, supervisorScopeExtPartyId())"));
|
||||
assertTrue(controllerSource.contains("orgSyncService.snapshot(phone, null, null, \"active\", 1, 500, 500)"));
|
||||
assertTrue(controllerSource.contains("private String supervisorScopeExtPartyId()"));
|
||||
assertTrue(controllerSource.contains("mobileSeedService.requireSupervisorIdentity(currentAppUsername())"));
|
||||
assertTrue(controllerSource.contains("UserType.SYS_USER.getUserType().equals(loginUser.getUserType())"));
|
||||
|
||||
Reference in New Issue
Block a user