소스 검색

团组签证流程 请求参数调整

Lyyyi 1 일 전
부모
커밋
8adb4052c2
2개의 변경된 파일23개의 추가작업 그리고 11개의 파일을 삭제
  1. 17 11
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  2. 6 0
      OASystem/OASystem.Domain/Dtos/Groups/VisaProcessDtos.cs

+ 17 - 11
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -28258,7 +28258,8 @@ ORDER BY
 
             var query = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>()
                 .InnerJoin<Grp_DelegationInfo>((x, y) => x.DIId == y.Id)
-                .Where((x, y) => x.IsDel == 0 && x.CTId == 80 && x.UId == currUserId);
+                .InnerJoin<Grp_VisaProcessSteps>((x, y, z) => x.DIId == z.GroupId)
+                .Where((x, y, z) => x.IsDel == 0 && x.CTId == 80 && x.UId == currUserId && z.IsDel == 0);
 
             //构建单字模糊查询
             if (!string.IsNullOrEmpty(groupName))
@@ -28278,7 +28279,11 @@ ORDER BY
                 {
                     y.Id,
                     GroupName = y.TeamName,
-                    y.VisitDate
+                    y.VisitDate,
+                    // 加入子查询统计子表条数
+                    CompletedCount = SqlFunc.Subqueryable<Grp_VisaProcessSteps>()
+                    .Where(sub => sub.GroupId == y.Id && sub.IsCompleted && sub.IsDel == 0)
+                    .Count()
                 })
                 .Distinct()
                 .ToPageListAsync(pageIndex, pageSize, total);
@@ -28286,7 +28291,11 @@ ORDER BY
             var msg = "SUCCESS";
             if (total <= 0) msg = "暂无可操作的团组,请联系经理分配团组!";
 
-            var groups1 = groups.Select(x => new { x.Id, x.GroupName }).ToList();
+            var groups1 = groups.Select(x => new { 
+                    x.Id, 
+                    x.GroupName,
+                    //x.CompletedCount 
+                }).ToList();
 
             return Ok(JsonView(true, msg, groups1, total));
         }
@@ -28324,22 +28333,21 @@ ORDER BY
             return Ok(await _visaProcessRep.UpdateBatchTop4Step(groupId, currUserId));
         }
 
-
         /// <summary>
         /// 团组签证流程 - 设置状态为已完成
         /// </summary>
         /// <returns></returns>
         [HttpPost]
-        public async Task<IActionResult> VisaProcessSetCompleted(int id, int currUserId)
+        public async Task<IActionResult> VisaProcessSetCompleted(VisaProcessSetCompletedDto dto)
         {
             //参数验证
-            var stepValid = await _sqlSugar.Queryable<Grp_VisaProcessSteps>().Where(x => x.Id == id && x.IsDel == 0).AnyAsync();
+            var stepValid = await _sqlSugar.Queryable<Grp_VisaProcessSteps>().Where(x => x.Id == dto.StepId && x.IsDel == 0).AnyAsync();
             if (!stepValid) return Ok(JsonView(false, "签证流程ID无效。"));
 
-            var userValid = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.Id == currUserId && x.IsDel == 0).AnyAsync();
+            var userValid = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.Id == dto.CurrUserId && x.IsDel == 0).AnyAsync();
             if (!userValid) return Ok(JsonView(false, "用户ID无效。"));
 
-            var res = await _visaProcessRep.SetCompleted(id, currUserId);
+            var res = await _visaProcessRep.SetCompleted(dto.StepId, dto.CurrUserId);
             if (res.Code != 200) return Ok(JsonView(false, res.Msg));
 
             return Ok(JsonView(true, res.Msg));
@@ -28475,12 +28483,11 @@ ORDER BY
             return Ok(JsonView(true));
         }
 
-
         /// <summary>
         /// 团组签证流程 - step 7 资料下载
         /// </summary>
         /// <returns></returns>
-        [HttpPost]
+        [HttpGet]
         public async Task<IActionResult> VisaProcessDownload(int groupId)
         {
             //验证根目录
@@ -28560,7 +28567,6 @@ WHERE
                 return Ok(JsonView(false, $"团组客户名单未录入客户信息,不可生成相关资料。"));
             }
 
-
             #region 生成文件
 
             //酒店信息

+ 6 - 0
OASystem/OASystem.Domain/Dtos/Groups/VisaProcessDtos.cs

@@ -70,4 +70,10 @@ namespace OASystem.Domain.Dtos.Groups
         public List<VisaProcessNode> VisaSubNodes { get; set; }
     }
 
+    public class VisaProcessSetCompletedDto
+    {
+        public int StepId { get; set; }
+        public int CurrUserId { get; set; }
+    }
+
 }