|
@@ -584,21 +584,23 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
RefAsync<int> total = 0;
|
|
|
var data = await _sqlSugar.Queryable<Pm_GoodsReceive>()
|
|
|
.LeftJoin<Pm_GoodsInfo>((gr, gi) => gr.GoodsId == gi.Id)
|
|
|
- .LeftJoin<Sys_SetData>((gr, gi,sd) => gi.Type == sd.Id)
|
|
|
- .LeftJoin<Sys_Users>((gr, gi,sd,u1) => gr.AuditUserId == u1.Id)
|
|
|
- .LeftJoin<Sys_Users>((gr, gi,sd, u1, u2) => gr.CreateUserId == u2.Id)
|
|
|
- .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(groupLabel.Length > 0, (gr, gi, sd, u1, u2) => groupLabel.Contains(gr.GroupId))
|
|
|
- .WhereIF(beginBool && endBool, (gr, gi, sd, u1, u2) => gr.CreateTime >= begin && gr.CreateTime <= end)
|
|
|
- .Select((gr, gi, sd, u1, u2) => new GoodsReceiveListView
|
|
|
+ .LeftJoin<Sys_SetData>((gr, gi, sd) => gi.Type == sd.Id)
|
|
|
+ .LeftJoin<Sys_Users>((gr, gi, sd, u1) => gr.AuditUserId == u1.Id)
|
|
|
+ .LeftJoin<Sys_Users>((gr, gi, sd, u1, u2) => gr.CreateUserId == u2.Id)
|
|
|
+ .LeftJoin<Grp_DelegationInfo>((gr, gi, sd, u1, u2, di) => gr.GroupId == di.Id)
|
|
|
+ .Where((gr, gi, sd, u1, u2, di) => gr.IsDel == 0)
|
|
|
+ .WhereIF(dto.GoodsId > 0, (gr, gi, sd, u1, u2, di) => gr.GoodsId == dto.GoodsId)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.GoodsName), (gr, gi, sd, u1, u2, di) => gi.Name.Contains(dto.GoodsName))
|
|
|
+ .WhereIF(auditLabel.Length > 0, (gr, gi, sd, u1, u2, di) => auditLabel.Contains((int)gr.AuditStatus))
|
|
|
+ .WhereIF(typeLabel.Length > 0, (gr, gi, sd, u1, u2, di) => typeLabel.Contains(gi.Type))
|
|
|
+ .WhereIF(userLabel.Length > 0, (gr, gi, sd, u1, u2, di) => userLabel.Contains(gr.CreateUserId))
|
|
|
+ .WhereIF(groupLabel.Length > 0, (gr, gi, sd, u1, u2, di) => groupLabel.Contains(gr.GroupId))
|
|
|
+ .WhereIF(beginBool && endBool, (gr, gi, sd, u1, u2, di) => gr.CreateTime >= begin && gr.CreateTime <= end)
|
|
|
+ .Select((gr, gi, sd, u1, u2, di) => new GoodsReceiveListMobileView
|
|
|
{
|
|
|
Id = gr.Id,
|
|
|
GroupId = gr.GroupId,
|
|
|
+ GroupName = di.TeamName,
|
|
|
GoodsId = gr.GoodsId,
|
|
|
GoodsName = gi.Name,
|
|
|
GoodsType = sd.Name,
|
|
@@ -616,8 +618,19 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
.OrderByDescending(gr => gr.CreateTime)
|
|
|
.ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
+ {
|
|
|
+ _jv.Data = data;
|
|
|
+ }
|
|
|
+ else if (dto.PortType == 1)
|
|
|
+ {
|
|
|
+ _jv.Data = _mapper.Map<List<GoodsReceiveListView>>(data);
|
|
|
+ }
|
|
|
+
|
|
|
_jv.Code = StatusCodes.Status200OK;
|
|
|
- _jv.Data = data;
|
|
|
_jv.Count = total;
|
|
|
_jv.Msg = $"操作成功";
|
|
|
return _jv;
|
|
@@ -635,12 +648,14 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
.LeftJoin<Pm_GoodsInfo>((gr, gi) => gr.GoodsId == gi.Id)
|
|
|
.LeftJoin<Sys_Users>((gr, gi, u1) => gr.AuditUserId == u1.Id)
|
|
|
.LeftJoin<Sys_Users>((gr, gi, u1, u2) => gr.CreateUserId == u2.Id)
|
|
|
- .Where((gr, gi, u1, u2) => gr.IsDel == 0)
|
|
|
- .WhereIF(id > 0, (gr, gi, u1, u2) => gr.Id == id)
|
|
|
- .Select((gr, gi, u1, u2) => new GoodsReceiveInfoView
|
|
|
+ .LeftJoin<Grp_DelegationInfo>((gr, gi, u1, u2,di) => gr.GroupId == di.Id)
|
|
|
+ .Where((gr, gi, u1, u2, di) => gr.IsDel == 0)
|
|
|
+ .WhereIF(id > 0, (gr, gi, u1, u2, di) => gr.Id == id)
|
|
|
+ .Select((gr, gi, u1, u2, di) => new GoodsReceiveInfoMobileView
|
|
|
{
|
|
|
Id = gr.Id,
|
|
|
GroupId = gr.GroupId,
|
|
|
+ GroupName = di.TeamName,
|
|
|
GoodsId = gr.GoodsId,
|
|
|
GoodsName = gi.Name,
|
|
|
Quantity = gr.Quantity,
|
|
@@ -690,11 +705,18 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
Console.WriteLine(e);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
_jv.Code = StatusCodes.Status200OK;
|
|
|
- _jv.Data = data;
|
|
|
_jv.Msg = $"操作成功";
|
|
|
+ if (portType == 2 || portType == 3)
|
|
|
+ {
|
|
|
+ _jv.Data = data;
|
|
|
+ }
|
|
|
+ else if (portType == 1)
|
|
|
+ {
|
|
|
+ _jv.Data = _mapper.Map<GoodsReceiveInfoView>(data);
|
|
|
+ }
|
|
|
+
|
|
|
return _jv;
|
|
|
}
|
|
|
|