Parcourir la source

新增团组流程返回实体数据

jiangjc il y a 1 an
Parent
commit
6aee3dc643

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

@@ -147,7 +147,9 @@ namespace OASystem.API.Controllers
             var result = await _grpScheduleRep._sqlSugar.Insertable(_detail).ExecuteReturnIdentityAsync();
             if (result > 0)
             {
-                return Ok(JsonView(true, "添加成功!"));
+                Grp_ScheduleDetailView _result = await _grpScheduleRep.GetInsertBackData(result);
+
+                return Ok(JsonView(true, "添加成功!", _result));
             }
 
             return Ok(JsonView(false, "添加失败!"));

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs

@@ -68,7 +68,7 @@ Where bcil.Id={0}
             string diName = _DelegationInfo != null ? _DelegationInfo.TeamName : "未知团组" + _entity.Diid;
 
             WorkbookDesigner designer = new WorkbookDesigner();
-            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + "Model/会务物料清单模板.xlsx");
+            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + "Template/会务物料清单模板.xlsx");
             designer.SetDataSource("Export", _confItemList);
             designer.SetDataSource("ExportDiName", diName);
             designer.SetDataSource("ExportOutputDt", DateTime.Now.ToString("yyyy-MM-dd"));

+ 4 - 0
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -4,6 +4,7 @@ using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Enums;
+using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
 using System.Configuration;
 using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
@@ -467,6 +468,9 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
 
         #endregion
 
+
+        
+
     }
 
 

+ 27 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs

@@ -49,6 +49,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return sql;
         }
 
+        #region 获取添加后的新数据
+        public async Task<Grp_ScheduleDetailView> GetInsertBackData(int detailId)
+        {
+            Grp_ScheduleDetailInfo item = await _sqlSugar.Queryable<Grp_ScheduleDetailInfo>().FirstAsync(s => s.Id == detailId);
+            if (item != null)
+            {
+                Grp_ScheduleDetailView temp = new Grp_ScheduleDetailView();
+                temp.Duty = item.Duty;
+                temp.Exception = item.Exception;
+                temp.ExpectBeginDt = item.ExpectBeginDt;
+                temp.ExpectEndDt = item.ExpectEndDt;
+                temp.DetailId = item.Id;
+                temp.JobContent = item.JobContent;
+                temp.Level = item.SLevel;
+                temp.RealEndDt = item.RealEndDt;
+                temp.Remark = item.Remark;
+                temp.Root = item.ParentStep;
+                temp.Step = item.Step;
+                temp.StepStatus = item.StepStatus;
+
+                return temp;
+            }
+
+            return null;
+        }
+        #endregion
+
         /// <summary>
         /// 获取团组流程数据单个对象
         /// </summary>