|
@@ -27997,6 +27997,147 @@ ORDER BY
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 会务流程
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 会务流程 - 数据初始化
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns>团组基本信息、团组列表和会务基本信息列表</returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public async Task<IActionResult> ConferenceProceduresInit(ConferenceProceduresInitDto dto)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ Grp_DelegationInfo targetGroup = null;
|
|
|
|
+
|
|
|
|
+ targetGroup = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
+ .Where(x => x.Id == dto.GroupId && x.IsDel == 0)
|
|
|
|
+ .FirstAsync();
|
|
|
|
+
|
|
|
|
+ if (targetGroup == null)
|
|
|
|
+ {
|
|
|
|
+ targetGroup = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
|
+ .OrderByDescending(x => x.CreateTime)
|
|
|
|
+ .FirstAsync();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (targetGroup == null)
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "未找到任何团组信息"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var groupList = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
|
+ .OrderByDescending(x => x.CreateTime)
|
|
|
|
+ .Select(x => new { x.Id, x.TeamName })
|
|
|
|
+ .ToListAsync();
|
|
|
|
+
|
|
|
|
+ var conferenceProceduresList = await _sqlSugar.Queryable<Grp_ConferenceProcedures>()
|
|
|
|
+ .Where(x => x.DiId == targetGroup.Id && x.IsDel == 0)
|
|
|
|
+ .Select(x => new { x.Id, x.Title, x.DataDetails, x.Details, x.Remark })
|
|
|
|
+ .ToListAsync();
|
|
|
|
+
|
|
|
|
+ var conferenceProceduresGroupByTitle = conferenceProceduresList
|
|
|
|
+ .GroupBy(x => x.Title)
|
|
|
|
+ .Select(x => new
|
|
|
|
+ {
|
|
|
|
+ title = x.Key,
|
|
|
|
+ itmes = x.Select(y => new
|
|
|
|
+ {
|
|
|
|
+ y.Id,
|
|
|
|
+ y.DataDetails,
|
|
|
|
+ y.Details,
|
|
|
|
+ y.Remark
|
|
|
|
+ }).ToList()
|
|
|
|
+ })
|
|
|
|
+ .ToList();
|
|
|
|
+
|
|
|
|
+ var response = new
|
|
|
|
+ {
|
|
|
|
+ GroupInfo = new
|
|
|
|
+ {
|
|
|
|
+ targetGroup.Id,
|
|
|
|
+ targetGroup.TeamName,
|
|
|
|
+ targetGroup.VisitDate,
|
|
|
|
+ targetGroup.VisitDays,
|
|
|
|
+ targetGroup.VisitPNumber,
|
|
|
|
+ targetGroup.VisitCountry,
|
|
|
|
+ targetGroup.VisitStartDate,
|
|
|
|
+ targetGroup.VisitEndDate
|
|
|
|
+ },
|
|
|
|
+ GroupList = groupList,
|
|
|
|
+ ConferenceProceduresList = conferenceProceduresList,
|
|
|
|
+ conferenceProceduresGroupByTitle = conferenceProceduresGroupByTitle
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true, "SUCCESS", response));
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ _logger.LogError(ex, "数据初始化失败");
|
|
|
|
+ return Ok(JsonView(false, $"ERROR:{ex.Message}"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 会务流程 - 保存
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public async Task<IActionResult> ConferenceProceduresSave(ConferenceProceduresSaveDto dto)
|
|
|
|
+ {
|
|
|
|
+ _sqlSugar.BeginTran();
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ //删除旧数据
|
|
|
|
+ _sqlSugar.Updateable<Grp_ConferenceProcedures>()
|
|
|
|
+ .Where(x => x.DiId == dto.GroupId && x.IsDel == 0)
|
|
|
|
+ .SetColumns(x => new Grp_ConferenceProcedures
|
|
|
|
+ {
|
|
|
|
+ IsDel = 1,
|
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
|
+ DeleteUserId = dto.UserId
|
|
|
|
+ })
|
|
|
|
+ .ExecuteCommand();
|
|
|
|
+
|
|
|
|
+ //添加新数据
|
|
|
|
+ var newData = new List<Grp_ConferenceProcedures>();
|
|
|
|
+ foreach (var item in dto.ConferenceProceduresSaveItem)
|
|
|
|
+ {
|
|
|
|
+ foreach (var item2 in item.itmes)
|
|
|
|
+ {
|
|
|
|
+ newData.Add(new Grp_ConferenceProcedures
|
|
|
|
+ {
|
|
|
|
+ DiId = dto.GroupId,
|
|
|
|
+ Title = item.title,
|
|
|
|
+ DataDetails = item2.DataDetails,
|
|
|
|
+ Details = item2.details,
|
|
|
|
+ Remark = item2.Remark,
|
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
|
+ CreateUserId = dto.UserId
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ _sqlSugar.Insertable(newData).ExecuteCommand();
|
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
|
+ return Ok(JsonView(false, $"ERROR:{ex.Message}"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true, "SUCCESS"));
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 团组签证流程
|
|
#region 团组签证流程
|