|
|
@@ -721,9 +721,11 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
if (limit <= 0)
|
|
|
limit = HK_DEF_RECYCLE_LIMIT;
|
|
|
result.put("limit", limit);
|
|
|
+ Timestamp now = new Timestamp(System.currentTimeMillis());
|
|
|
+ result.put("now", makeHkTime(now));
|
|
|
|
|
|
try (Db gdba = Db.makeConn()) {
|
|
|
- List<LeaveAuthSyncCtx> ctxList = selExpiredPlatformConfigDeleteCtxList(gdba, limit);
|
|
|
+ List<LeaveAuthSyncCtx> ctxList = selExpiredPlatformConfigDeleteCtxList(gdba, now, limit);
|
|
|
result.put("candidateCount", ctxList.size());
|
|
|
|
|
|
List<Map<String, Object>> itemList = new ArrayList<>();
|
|
|
@@ -3504,10 +3506,12 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
/**
|
|
|
* 2026-06-10:仅挑选“已走过平台配置模式且尚未确认删除”的过期请假单,给定时回收使用。
|
|
|
*/
|
|
|
- private static List<LeaveAuthSyncCtx> selExpiredPlatformConfigDeleteCtxList(Db gdba, int limit) throws Exception {
|
|
|
- if (gdba == null)
|
|
|
+ private static List<LeaveAuthSyncCtx> selExpiredPlatformConfigDeleteCtxList(Db gdba,
|
|
|
+ Timestamp now,
|
|
|
+ int limit) throws Exception {
|
|
|
+ if (gdba == null || now == null)
|
|
|
return List.of();
|
|
|
- List<LeaveAuthSyncCtx> extCtxList = selExpiredPlatformConfigDeleteCtxListFromExt(gdba, limit);
|
|
|
+ List<LeaveAuthSyncCtx> extCtxList = selExpiredPlatformConfigDeleteCtxListFromExt(gdba, now, limit);
|
|
|
if (!extCtxList.isEmpty())
|
|
|
return extCtxList;
|
|
|
String sql = "select * from ("
|
|
|
@@ -3516,12 +3520,13 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
+ " from RC rc"
|
|
|
+ " join RY ry on ry.RYID=rc.FZRYID"
|
|
|
+ " where rc.JSSJ is not null"
|
|
|
- + " and rc.JSSJ<=sysdate"
|
|
|
+ + " and rc.JSSJ<=:nowTs"
|
|
|
+ " and rc.WCMSWJ like '%mode=execute_platform_config%'"
|
|
|
+ " and nvl(rc.WCMSWJ,' ') not like '%deleteConfirmed=true%'"
|
|
|
+ " order by rc.JSSJ asc,rc.RCID asc"
|
|
|
+ " ) where rownum<=:limit";
|
|
|
SqlCmd sqlCmd = new SqlCmd(sql);
|
|
|
+ sqlCmd.wrTimeParm("nowTs", now);
|
|
|
sqlCmd.wrIntParm("limit", Math.max(1, limit));
|
|
|
List<Map<String, Object>> rowList = gdba.doSelMapListByC(sqlCmd);
|
|
|
if (rowList == null || rowList.isEmpty())
|
|
|
@@ -3620,8 +3625,10 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
/**
|
|
|
* 2026-06-10:到期回收候选优先读扩展表,明确按“已确认下发、未确认删除”筛选。
|
|
|
*/
|
|
|
- private static List<LeaveAuthSyncCtx> selExpiredPlatformConfigDeleteCtxListFromExt(Db gdba, int limit) throws Exception {
|
|
|
- if (gdba == null || !ifLeaveAuthExtTableReady(gdba))
|
|
|
+ private static List<LeaveAuthSyncCtx> selExpiredPlatformConfigDeleteCtxListFromExt(Db gdba,
|
|
|
+ Timestamp now,
|
|
|
+ int limit) throws Exception {
|
|
|
+ if (gdba == null || now == null || !ifLeaveAuthExtTableReady(gdba))
|
|
|
return List.of();
|
|
|
String sql = "select * from ("
|
|
|
+ " select rc.RCID rcid,rc.BJID bjid,rc.FZRYID ryid,rc.RCLBM rclbm,rc.KSSJ kssj,rc.JSSJ jssj,"
|
|
|
@@ -3630,7 +3637,7 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
+ " join RC rc on rc.RCID=ext.RCID"
|
|
|
+ " left join RY ry on ry.RYID=rc.FZRYID"
|
|
|
+ " where rc.JSSJ is not null"
|
|
|
- + " and rc.JSSJ<=sysdate"
|
|
|
+ + " and rc.JSSJ<=:nowTs"
|
|
|
+ " and (nvl(ext.PLATFORM_CONFIG_CONFIRMED,0)=1"
|
|
|
+ " or nvl(ext.CONFIG_SEARCH_MATCHED,0)=1"
|
|
|
+ " or ext.CONFIG_TASK_ID is not null)"
|
|
|
@@ -3638,6 +3645,7 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
+ " order by rc.JSSJ asc,rc.RCID asc"
|
|
|
+ " ) where rownum<=:limit";
|
|
|
SqlCmd sqlCmd = new SqlCmd(sql);
|
|
|
+ sqlCmd.wrTimeParm("nowTs", now);
|
|
|
sqlCmd.wrIntParm("limit", Math.max(1, limit));
|
|
|
List<Map<String, Object>> rowList = gdba.doSelMapListByC(sqlCmd);
|
|
|
if (rowList == null || rowList.isEmpty())
|