Kaynağa Gözat

支持团组/会务流程节点灵活变更与权限控制

新增节点状态任意切换功能,支持进行中与已完成双向变更,并引入节点级操作权限(OpUserList),实现节点操作人精细化控制。节点参与人字段由字符串改为List<int>,提升类型安全性。所有节点状态变更、实际完成时间设置等操作均增加权限校验和详细日志记录。同步优化数据结构、接口调用及异常处理,提升流程管理灵活性与安全性。
Lyyyi 1 gün önce
ebeveyn
işleme
c840b7f2de

+ 1 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -21654,7 +21654,6 @@ end as 'country'
             int diid = dto.Diid == -1 ? groupList.First().Id : dto.Diid;
             var groupInfo = await _groupRepository.PostShareGroupInfo(new ShareGroupInfoDto { PortType = 1, Id = diid }); //团组信息
 
-
             var visaCountryInfoArr = new ArrayList();
             var groupinfoValue = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x => x.Id == diid && x.IsDel == 0);
             if (groupinfoValue != null)
@@ -32950,7 +32949,7 @@ WHERE
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> GroupProcessUpdateNodeStatus(GroupProcessUpdateNodeStatusDto dto)
         {
-            var res = await _processOverviewRep.UpdateNodeStatusAsync(dto.NodeId, dto.CurrUserId);
+            var res = await _processOverviewRep.UpdateNodeStatusSimpleAsync(dto.NodeId, dto.CurrUserId);
 
             if (res.Code == StatusCodes.Status200OK)
             {

+ 12 - 9
OASystem/OASystem.Domain/Entities/Groups/Grp_ConfProcess.cs

@@ -122,8 +122,8 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 参与人 
         /// </summary>
-        [SugarColumn(ColumnName = "Participator", ColumnDescription = "参与人 [1,2,3]", IsNullable = true, ColumnDataType = "varchar(200)")]
-        public string Participator { get; set; }
+        [SugarColumn(ColumnName = "Participators", ColumnDescription = "参与人 [1,2,3]", IsNullable = true, IsJson = true, ColumnDataType = "varchar(300)")]
+        public List<int> Participators { get; set; } = new List<int>() { 213 /*李新江*/ };
 
         /// <summary>
         /// 操作人 
@@ -157,6 +157,13 @@ namespace OASystem.Domain.Entities.Groups
         [DefaultValue(false)]
         public bool IsFileUp { get; set; }
 
+        /// <summary>
+        /// 节点操作权限
+        /// </summary>
+        [SugarColumn(ColumnName = "OpUserList", ColumnDescription = "节点操作权限", IsJson = true, ColumnDataType = "varchar(300)")]
+        [DefaultValue(false)]
+        public List<int> OpUserList { get; set; } = new List<int>();
+
         public Grp_ConfProcessNode() { }
 
         /// <summary>
@@ -165,12 +172,6 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsIgnore = true)]
         public bool IsEnaFileUpBtn { get; set; }
 
-        /// <summary>
-        /// 参与人
-        /// </summary>
-        [SugarColumn(IsIgnore = true)]
-        public List<int> Participators { get; set; }
-
         /// <summary>
         /// Create
         /// </summary>
@@ -182,10 +183,11 @@ namespace OASystem.Domain.Entities.Groups
         /// <param name="isFileUp">是否上传文件</param>
         /// <param name="currUserId">当前用户Id</param>
         /// <param name="participators">参与人</param>
+        /// <param name="opUserList">节点操作权限</param>
         /// <param name="remark">备注</param>
         /// <returns></returns>
         public static Grp_ConfProcessNode Create(int nodeOrder, string nodeName, string nodeDescTips, ProcessStatus status, bool isCurrent, bool isFileUp, int currUserId,
-            List<int> participators, string remark = null)
+            List<int> participators, List<int> opUserList, string? remark = null)
         {
             bool isEnaFileUpBtn = isFileUp;
 
@@ -199,6 +201,7 @@ namespace OASystem.Domain.Entities.Groups
                 Participators = participators,
                 IsEnaFileUpBtn = isEnaFileUpBtn,
                 IsFileUp = isFileUp,
+                OpUserList = opUserList,
                 CreateUserId = currUserId,
                 Remark = remark
             };

+ 1 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_ProcessOverview.cs

@@ -193,7 +193,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <param name="remark">备注</param>
         /// <returns></returns>
         public static Grp_ProcessNode Create(int nodeOrder, string nodeName, string nodeDescTips, ProcessStatus status,
-            bool isCurrent, bool isAssist, bool isFileUp, bool isPart, int currUserId, List<int> opUserList, string remark = null)
+            bool isCurrent, bool isAssist, bool isFileUp, bool isPart, int currUserId, List<int> opUserList, string? remark = null)
         {
             return new Grp_ProcessNode
             {

+ 1 - 3
OASystem/OASystem.Domain/ViewModels/Groups/ProcessOverView.cs

@@ -37,9 +37,6 @@ namespace OASystem.Domain.ViewModels.Groups
     public class ConfProcessOverInfoView
     { 
         public int Id { get; set; }
-
-        
-
         public int GroupId { get; set; }
         public ConfProcessType ProcessType { get; set; }
         public string ProcessName { get; set; }
@@ -54,6 +51,7 @@ namespace OASystem.Domain.ViewModels.Groups
         public string NodeDescTips { get; set; }
         public ProcessStatus OverallStatus { get; set; }
         public List<int> Participators { get; set; }
+        public List<int> OpUserList { get; set; }
         public string StatusText { get; set; }
         public string Operator { get; set; }
         public string OpeateTime { get; set; }

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs

@@ -190,7 +190,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 return (new List<AscribedUser>(), new List<AscribedDepartment>());
 
             var cacheKey = $"NewClientData_Relations_{string.Join("_", clientIds.OrderBy(x => x))}";
-            var cachedData = await _redisHelper.StringGetAsync<(List<SerializableAscribedUser>, List<SerializableAscribedDepartment>)>(cacheKey);
+            var cachedData = await _redisHelper.StringGetAsync<(List<SerializableAscribedUser>?, List<SerializableAscribedDepartment>?)>(cacheKey);
             cachedData.Item1 = null;
             cachedData.Item2 = null;
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 809 - 220
OASystem/OASystem.Infrastructure/Repositories/Groups/ProcessOverviewRepository.cs


+ 4 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaProcessRepository.cs

@@ -384,7 +384,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <param name="operatorId">操作人用户ID</param>
         /// <returns>表示异步操作的任务</returns>
         /// <remarks>此方法会自动比较前后数据的差异,生成变更字段列表和操作描述</remarks>
-        public async Task LogOperationAsync(Grp_VisaProcessSteps before, Grp_VisaProcessSteps after,string opType, int operatorId)
+        public async Task LogOperationAsync(Grp_VisaProcessSteps? before, Grp_VisaProcessSteps? after,string opType, int operatorId)
         {
             // 合并基础排除字段和额外排除字段
             var allExcludedFields = GetDefaultExcludedFields();
@@ -421,7 +421,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <param name="after">变更后</param>
         /// <param name="exclFields">排除字段</param>
         /// <returns>变更详情列表</returns>
-        private List<FieldChangeDetail> GetChangeDetails(Grp_VisaProcessSteps before, Grp_VisaProcessSteps after, List<string> exclFields = null)
+        private List<FieldChangeDetail> GetChangeDetails(Grp_VisaProcessSteps? before, Grp_VisaProcessSteps? after, List<string>? exclFields = null)
         {
             var changeDetails = new List<FieldChangeDetail>();
             var defaultExclFields = GetDefaultExcludedFields();
@@ -516,8 +516,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <param name="after">操作后</param>
         /// <param name="chgDetails">变更详情</param>
         /// <returns>操作描述</returns>
-        private static string GenerateOpDesc(string opType, Grp_VisaProcessSteps before,
-            Grp_VisaProcessSteps after, List<FieldChangeDetail> chgDetails)
+        private static string GenerateOpDesc(string opType, Grp_VisaProcessSteps? before,
+            Grp_VisaProcessSteps? after, List<FieldChangeDetail>? chgDetails)
         {
             if (!chgDetails.Any())
             {

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/TaskAllocationRepository.cs

@@ -1373,7 +1373,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <param name="after">变更后</param>
         /// <param name="exclFields">排除字段</param>
         /// <returns>变更详情列表</returns>
-        private List<FieldChangeDetail> GetChangeDetails(Pm_TaskAllocation before, Pm_TaskAllocation after, List<string> exclFields = null)
+        private List<FieldChangeDetail> GetChangeDetails(Pm_TaskAllocation before, Pm_TaskAllocation after, List<string>? exclFields = null)
         {
             var changeDetails = new List<FieldChangeDetail>();
             var defaultExclFields = GetDefaultExcludedFields();

+ 3 - 3
OASystem/OASystem.Infrastructure/Repositories/Resource/CountryFeeRepository.cs

@@ -388,9 +388,9 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 return new JsonView { Code = StatusCodes.Status400BadRequest, Msg = $"{countryName} 该国家签证费用信息不存在" };
 
 
-            decimal largeVisaQuote = 0.00M,  // 公务签证报价
-                    smallVisaQuote = 0.00M,  // 公务普通签证报价
-                    quotePrice1 = 0.00M;     // 报价费用1
+            //decimal largeVisaQuote = 0.00M,  // 公务签证报价
+            //        smallVisaQuote = 0.00M,  // 公务普通签证报价
+            //        quotePrice1 = 0.00M;     // 报价费用1
             var visaFeeLabel = new StringBuilder(); //签证费用描述
 
             // 103  重庆