|
@@ -518,7 +518,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
{
|
|
|
//参数处理
|
|
|
int[] typeLabel = new int[] { },
|
|
|
- userLabel = new int[] { };
|
|
|
+ userLabel = new int[] { },
|
|
|
+ auditLabel = new int[] { };
|
|
|
if (!string.IsNullOrEmpty(dto.TypeLabel))
|
|
|
{
|
|
|
typeLabel = dto.TypeLabel
|
|
@@ -541,11 +542,25 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
})
|
|
|
.ToArray();
|
|
|
}
|
|
|
+ if (!string.IsNullOrEmpty(dto.AuditLabel))
|
|
|
+ {
|
|
|
+ auditLabel = dto.AuditLabel
|
|
|
+ .Split(',')
|
|
|
+ .Select(x =>
|
|
|
+ {
|
|
|
+ if (int.TryParse(x, out var id)) return id;
|
|
|
+ return id;
|
|
|
+ })
|
|
|
+ .ToArray();
|
|
|
+ }
|
|
|
|
|
|
//物品ID和物品名称只能传一个
|
|
|
if (dto.GoodsId > 0) dto.GoodsName = string.Empty;
|
|
|
if (!string.IsNullOrEmpty(dto.GoodsName)) dto.GoodsId = 0;
|
|
|
|
|
|
+ var beginBool = DateTime.TryParse($"{dto.BeginDt} 00:00:00", out DateTime begin);
|
|
|
+ var endBool = DateTime.TryParse($"{dto.EndDt} 23:59:59", out DateTime end);
|
|
|
+
|
|
|
RefAsync<int> total = 0;
|
|
|
var data = await _sqlSugar.Queryable<Pm_GoodsReceive>()
|
|
|
.LeftJoin<Pm_GoodsInfo>((gr, gi) => gr.GoodsId == gi.Id)
|
|
@@ -555,8 +570,10 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
.Where((gr, gi, sd, u1, u2) => gr.IsDel == 0)
|
|
|
.WhereIF(dto.GoodsId > 0, (gr, gi, sd, u1, u2) => gr.GoodsId == dto.GoodsId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.GoodsName), (gr, gi, sd, u1, u2) => gi.Name.Contains(dto.GoodsName))
|
|
|
+ .WhereIF(auditLabel.Length > 0, (gr, gi, sd, u1, u2) => auditLabel.Contains((int)gr.AuditStatus))
|
|
|
.WhereIF(typeLabel.Length > 0, (gr, gi, sd, u1, u2) => typeLabel.Contains(gi.Type))
|
|
|
.WhereIF(userLabel.Length > 0, (gr, gi, sd, u1, u2) => userLabel.Contains(gr.CreateUserId))
|
|
|
+ .WhereIF(beginBool && endBool, (gr, gi, sd, u1, u2) => gr.CreateTime >= begin && gr.CreateTime <= end)
|
|
|
.Select((gr, gi, sd, u1, u2) => new GoodsReceiveListView
|
|
|
{
|
|
|
Id = gr.Id,
|
|
@@ -626,7 +643,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
var subData1 = JsonConvert.DeserializeObject<List<GoodsReceiveLinkStorageView>>(data.GoodsStorageInfo);
|
|
|
if (subData1.Count > 0)
|
|
|
{
|
|
|
- string quantityInfosStr = string.Empty;
|
|
|
+ string goodsStorageInfoStr = string.Empty;
|
|
|
var storageIds = subData1.Select(x => x.StorageId).ToList();
|
|
|
var storages = await _sqlSugar.Queryable<Pm_GoodsStorage>().Where(x => x.IsDel == 0 && storageIds.Contains(x.Id)).ToListAsync();
|
|
|
foreach (var item in subData1)
|
|
@@ -640,11 +657,11 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
BatchNo = storageInfo.BatchNo,
|
|
|
RecsiveQuantity = item.Quantity
|
|
|
});
|
|
|
- quantityInfosStr += $"物品名称:{data.GoodsName} 批次号:{storageInfo.BatchNo} 领用数量:{item.Quantity} \r\n";
|
|
|
+ goodsStorageInfoStr += $"物品名称:{data.GoodsName} 批次号:{storageInfo.BatchNo} 领用数量:{item.Quantity} \r\n";
|
|
|
}
|
|
|
}
|
|
|
data.QuantityInfos = subData;
|
|
|
- data.QuantityInfosStr = quantityInfosStr;
|
|
|
+ data.GoodsStorageInfoStr = goodsStorageInfoStr;
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e)
|