|
@@ -8,6 +8,7 @@ using OASystem.API.OAMethodLib.QiYeWeChatAPI;
|
|
|
using OASystem.API.OAMethodLib.Quartz.Business;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Dtos.PersonnelModule;
|
|
|
+using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.Entities.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
@@ -1703,6 +1704,39 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(await _goodsRep.InitDataSource());
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 物资进销存
|
|
|
+ /// 基础数据类型 --> 团组名称列表 分页
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GoodsGroupNameInit(QueryGroupListOffsetDto dto)
|
|
|
+ {
|
|
|
+ var watch = new Stopwatch();
|
|
|
+ watch.Start();
|
|
|
+ var countyDatas = await _sqlSugar
|
|
|
+ .Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where((di) => di.IsDel == 0 && !string.IsNullOrWhiteSpace(di.TeamName))
|
|
|
+ .OrderBy((di) => new { id = SqlFunc.Desc(di.Id) })
|
|
|
+ .Select((di) => new { id = di.Id, name = di.TeamName})
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ countyDatas.Insert(0, new { id = 0, name = "其他物资(公司内部物资)"});
|
|
|
+ countyDatas.Insert(0, new { id = -1, name = "拜访客户所使用的物资" });
|
|
|
+ var total = countyDatas.Count;
|
|
|
+ countyDatas = countyDatas.WhereIF(!string.IsNullOrEmpty(dto.Search), x => x.name.Contains(dto.Search)).ToList();
|
|
|
+ countyDatas = countyDatas
|
|
|
+ .Skip((dto.PageIndex - 1) * dto.PageSize)
|
|
|
+ .Take(dto.PageSize)
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ watch.Stop();
|
|
|
+
|
|
|
+ return Ok(JsonView(true, $"{MsgTips.Succeed},耗时 {watch.ElapsedMilliseconds} ms", countyDatas, total));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 物资进销存
|
|
|
/// 物品 列表
|