|
@@ -4,6 +4,7 @@ using Aspose.Words.Drawing;
|
|
|
using Aspose.Words.Tables;
|
|
|
using DiffMatchPatch;
|
|
|
using EyeSoft.Runtime.InteropServices;
|
|
|
+using Google.Protobuf.WellKnownTypes;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
using Microsoft.VisualBasic;
|
|
@@ -161,6 +162,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <param name="enterExitCostDraftRep"></param>
|
|
|
/// <param name="restaurantRep"></param>
|
|
|
/// <param name="enterExitCostQuoteRep"></param>
|
|
|
+ /// <param name="grpOrderPreInfoRep"></param>
|
|
|
public GroupsController(
|
|
|
ILogger<GroupsController> logger,
|
|
|
IMapper mapper,
|
|
@@ -401,17 +403,56 @@ namespace OASystem.API.Controllers
|
|
|
/// 团组前期信息 List
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet("{userId}")]
|
|
|
+ [HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GroupOrderPreInfoList(GroupOrderPreInfoListDto dto)
|
|
|
{
|
|
|
|
|
|
- //var list = await _sqlSugar.Queryable<Grp_OrderPreInfo, Sys_Users>((opi, u) => new JoinQueryInfos() { JoinType.Left, opi.CreateUserId == u.Id })
|
|
|
- // .Select(x => new GroupOrderPreInfoListView() { })
|
|
|
- // .ToPageListAsync(dto.PageIndex,dto.PageSize);
|
|
|
+
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;
|
|
|
+ var list = await _sqlSugar.Queryable<Grp_OrderPreInfo>()
|
|
|
+ .LeftJoin<Sys_Users>((opi, u) => opi.CreateUserId == u.Id)
|
|
|
+ .Where((opi, u) => opi.IsDel == 0)
|
|
|
+ .OrderByDescending((opi, u) => opi.CreateTime)
|
|
|
+ .Select((opi, u) => new GroupOrderPreInfoListView()
|
|
|
+ {
|
|
|
+ Id = opi.Id,
|
|
|
+ Name = opi.Name,
|
|
|
+ UnitName = SqlFunc.Subqueryable<Grp_OrderPreItem>().Where(x => x.ParentId == opi.Id && x.FormTempId == 1).Select(x => x.Value),
|
|
|
+ VisitDays = SqlFunc.Subqueryable<Grp_OrderPreItem>().Where(x => x.ParentId == opi.Id && x.FormTempId == 4).Select(x => x.Value),
|
|
|
+ VisiPpNum = SqlFunc.Subqueryable<Grp_OrderPreItem>().Where(x => x.ParentId == opi.Id && x.FormTempId == 6).Select(x => x.Value),
|
|
|
+ Operator = u.CnName,
|
|
|
+ OperationTime = opi.CreateTime
|
|
|
+ })
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Search), x => x.Name.Contains(dto.Search) || x.UnitName.Contains(dto.Search))
|
|
|
+ .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
+
|
|
|
+ var infoIds = list.Select(x => x.Id).ToList();
|
|
|
|
|
|
+ var typeDatas = await _sqlSugar.Queryable<Sys_SetData>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.STid == 109)
|
|
|
+ .ToArrayAsync();
|
|
|
|
|
|
- return Ok(await _grpOrderPreInfoRep.DataInit(0));
|
|
|
+ var items = await _sqlSugar.Queryable<Grp_OrderPreItem>()
|
|
|
+ .LeftJoin<Sys_FormTemp>((opi, ft) => opi.FormTempId == ft.Id)
|
|
|
+ .Where((opi, ft) => opi.IsDel == 0 && infoIds.Contains(opi.ParentId))
|
|
|
+ .Select((opi, ft) => new { opi.ParentId, opi.FormTempId, ft.TempId })
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ foreach (var item in list)
|
|
|
+ {
|
|
|
+ var typeDatas1 = typeDatas.Select(x => new
|
|
|
+ {
|
|
|
+ Id = x.Id,
|
|
|
+ Name = x.Name,
|
|
|
+ IsNull = !items.Any(x1 => item.Id == x1.ParentId && x.Id == x1.TempId)
|
|
|
+ }).ToArray();
|
|
|
+ item.VersionDetails = typeDatas1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(JsonView(list, total));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -422,8 +463,6 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GroupOrderPreInfo(int userId)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
return Ok(await _grpOrderPreInfoRep.DataInit(userId));
|
|
|
}
|
|
|
|