From 2f25f52f42693590ec29cef19b23b7a6fecc9f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?=
<10755671+mei-rong-he@user.noreply.gitee.com>
Date: Wed, 25 Mar 2026 18:08:27 +0800
Subject: [PATCH] 1
---
.../FM/IFMNotificationTaskService.cs | 10 ++-
.../Services/FM/FMFlowPermitService.cs | 2 +-
.../Services/FM/FMNotificationTaskService.cs | 70 +++++++++++++++++++
3 files changed, 79 insertions(+), 3 deletions(-)
diff --git a/APT.BaseData.Domain/IServices/FM/IFMNotificationTaskService.cs b/APT.BaseData.Domain/IServices/FM/IFMNotificationTaskService.cs
index 4f81a10..cc2e58a 100644
--- a/APT.BaseData.Domain/IServices/FM/IFMNotificationTaskService.cs
+++ b/APT.BaseData.Domain/IServices/FM/IFMNotificationTaskService.cs
@@ -308,7 +308,13 @@ namespace APT.BaseData.Domain.IServices.FM
/// 审批明细
/// 下一个审批待办
/// 上一个审批待办
- void TaskToHead(IEnumerable appdetails, T_FM_NOTIFICATION_TASK taskNext, List listModelNext, T_FM_NOTIFICATION_TASK taskLast);
-
+ void TaskToHead(IEnumerable appdetails, T_FM_NOTIFICATION_TASK taskNext, List listModelNext, T_FM_NOTIFICATION_TASK taskLast);
+ ///
+ /// 审批流 待办处理 判断到总部数据
+ ///
+ /// 审批明细
+ /// 下一个审批待办
+ /// 上一个审批待办
+ void TaskToHeads(IEnumerable appdetails, List taskNexts, List listModelNext, T_FM_NOTIFICATION_TASK taskLast);
}
}
diff --git a/APT.BaseData.Services/Services/FM/FMFlowPermitService.cs b/APT.BaseData.Services/Services/FM/FMFlowPermitService.cs
index 18e33f5..a12a5ff 100644
--- a/APT.BaseData.Services/Services/FM/FMFlowPermitService.cs
+++ b/APT.BaseData.Services/Services/FM/FMFlowPermitService.cs
@@ -643,7 +643,7 @@ namespace APT.BaseData.Services.Services.FM
#region //涉及到总部的人员 待办 直接把数据传到总部去
//待办同步
- NotificationTaskService.TaskToHead(appdetails, notice, null, finishNotice);
+ NotificationTaskService.TaskToHeads(appdetails, notices, null, finishNotice);
#endregion
diff --git a/APT.BaseData.Services/Services/FM/FMNotificationTaskService.cs b/APT.BaseData.Services/Services/FM/FMNotificationTaskService.cs
index 6bc4fa4..9c19432 100644
--- a/APT.BaseData.Services/Services/FM/FMNotificationTaskService.cs
+++ b/APT.BaseData.Services/Services/FM/FMNotificationTaskService.cs
@@ -1562,6 +1562,76 @@ namespace APT.BaseData.Services.Services.FM
catch (Exception ex) { }
}
}
+ }
+
+ #endregion
+ #region 总部待办处理
+
+ ///
+ /// 审批流 待办处理 判断到总部数据
+ ///
+ /// 审批明细
+ /// 下一个审批待办
+ /// 下一个审批待办
+ /// 上一个审批待办
+ public void TaskToHeads(IEnumerable appdetails, List taskNexts, List listModelNext, T_FM_NOTIFICATION_TASK taskLast)
+ {
+ if (appdetails != null)
+ {
+ var checkAdd = appdetails.FirstOrDefault(e => e.ISHEAD && e.IS_CURRENT);
+ if (checkAdd == null)
+ {
+ //审批的最后一步 IS_CURRENT =false
+ if ((taskNexts == null || taskNexts.Count() < 1) && (listModelNext == null || listModelNext.Count() < 1) && taskLast != null)
+ {
+ checkAdd = appdetails.FirstOrDefault(e => e.APPROVE_USER_ID.HasValue && e.ISHEAD && e.APPROVE_USER_ID.Value == taskLast.USER_ID);
+ if (checkAdd != null)
+ {
+ if (checkAdd.NUM != appdetails.Max(e => e.NUM))
+ {
+ checkAdd = null;
+ }
+ }
+ }
+ }
+ if (checkAdd != null)
+ {
+ var isLastDeal = false;//上一个是审批相关
+ if (taskLast != null)
+ {
+ var checkLast = appdetails.FirstOrDefault(e => e.ISHEAD && e.APPROVE_USER_ID.HasValue && e.APPROVE_USER_ID.Value == taskLast.USER_ID);
+ if (checkLast != null)
+ isLastDeal = true;
+ }
+
+ try
+ {
+ IEnumerable listSync = null;
+ if (listModelNext != null && listModelNext.Any())
+ {
+ var userids = appdetails.Where(e => e.ISHEAD && e.IS_CURRENT && e.APPROVE_USER_ID.HasValue).Select(e => e.APPROVE_USER_ID.Value);
+ if (userids != null && userids.Any())
+ {
+ listSync = listModelNext.Where(e => userids.Contains(e.USER_ID));
+ }
+ }
+
+ if (isLastDeal && taskLast != null)
+ {
+ this.UpdateEntityByTenant(taskLast, HeadHelper.HeadtelnetCode);
+ }
+ if (taskNexts != null && taskNexts.Any())
+ {
+ this.AddEntitiesByTenant(taskNexts, HeadHelper.HeadtelnetCode);
+ }
+ if (listSync != null && listSync.Count() > 0)
+ {
+ this.AddEntitiesByTenant(listSync, HeadHelper.HeadtelnetCode);
+ }
+ }
+ catch (Exception ex) { }
+ }
+ }
}
#endregion