SKILL.md 4.1 KB


name: hikvision-clear-expired-person-auth

description: Clear stale Hikvision personal auth_config permissions left behind by historical leave records. Use when a student shows expired permission or cannot enter/exit after a leave has already ended, especially when PMS and Hikvision organization status look normal but auth_config/search may still return an old personal time window. This skill is for confirming a residual personal permission window, deleting it with auth_config/delete, and re-checking that auth_config/search returns zero.

Hikvision Clear Expired Person Auth

Use this skill when the likely problem is a historical personal leave permission that was never recycled on Hikvision.

Workflow

  1. Identify the student and the target historical leave window.
  2. Confirm the student is not failing because of a current leave still in effect.
  3. Confirm Hikvision still returns the exact old personal time window through auth_config/search.
  4. Delete only that exact expired window's resources through auth_config/delete.
  5. Re-run auth_config/search and require the matched count to become 0.

Required Evidence

Collect these before deleting:

  • RYID
  • XM
  • RYH
  • Hikvision personId
  • target RCID
  • leave time window KSSJ ~ JSSJ
  • the current auth_config/search result proving the exact old window still exists

Do not delete if:

  • the time window has not ended yet
  • search returns multiple unrelated windows and you have not isolated the exact expired one
  • the student issue is clearly caused by current organization permission or field device problems instead

Preferred Approach

Prefer a one-off Java probe in the project tmp/ directory that:

  1. reads the historical leave resource set from RCHKLA.RESOURCE_KEYS or RCHKLA_ITEM.RESOURCE_KEYS
  2. uses the student's Hikvision personId
  3. calls auth_config/search
  4. filters rows by exact startTime/endTime
  5. builds resourceInfos only from the matched rows
  6. calls auth_config/delete
  7. polls auth_config/search until the matched row count becomes 0

This is safer than deleting by a broad all-device search result without filtering the exact window.

Reusable Scripts

Read these project scripts first and copy the nearest one into a new one-off probe:

  • tmp/prod_delete_lusiyu_expired_auth_probe.java
  • tmp/prod_delete_yuanweiqi_expired_auth_probe.java
  • tmp/prod_delete_two_students_expired_auth_probe.java

Use prod_delete_lusiyu_expired_auth_probe.java as the default starting point for a single student.

Minimal Edit Points

When cloning a probe, normally only change these constants:

private static final String XM = "学生姓名";
private static final String PERSON_ID = "海康personId";
private static final String EXPECT_BEG = "yyyy-MM-dd HH:mm:ss";
private static final String EXPECT_END = "yyyy-MM-dd HH:mm:ss";

If the resource set comes from a head-only old record, keep loading resource_keys from RCHKLA.

If the record already has RCHKLA_ITEM, prefer the item-level resource_keys.

Compile And Run

From the PMS project root:

javac -cp 'tmp;.;out\artifacts\PMS_war_exploded\WEB-INF\lib\*' 'tmp\your_probe.java'
java -cp 'tmp;.;out\artifacts\PMS_war_exploded\WEB-INF\lib\*' your_probe

Success Criteria

Deletion is only considered successful if all of these hold:

  • auth_config/delete returns code=0 or an accepted taskId
  • the post-delete auth_config/search exact-window matched count is 0
  • the result clearly states the residual personal permission has been cleared

Output Pattern

Report in this order:

  1. Student identity and personId
  2. Historical leave RCID and expired window
  3. Search-before matched count
  4. Delete acceptance result and taskId
  5. Search-after matched count
  6. Clear conclusion: residual permission cleared / not cleared

Notes

  • This skill is only for expired personal leave permissions.
  • It does not fix organization-level normal access permissions.
  • If the student is a resident student in both PMS and Hikvision organization data, but still fails and an expired personal window exists, clear the residual window first before escalating elsewhere.