소스 검색

1、物资进销存 --> 领用相关(Mobile) 详情、列表 新增团组名称

LEIYI 7 달 전
부모
커밋
217dde670e

+ 2 - 2
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -258,8 +258,6 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<EditDailyFeePaymentContentDto, Fin_DailyFeePaymentContent>();
 
             #region 收款账单
-
-
             CreateMap<Fin_ForeignReceivables, ProceedsReceivedNewView>();
             #endregion
             #endregion
@@ -280,6 +278,8 @@ namespace OASystem.Domain.AutoMappers
             #region 进销存
             CreateMap<GoodsStorageOpDto, Pm_GoodsStorage>();
             CreateMap<GoodsReceiveOpDto, Pm_GoodsReceive>();
+            CreateMap<GoodsReceiveInfoMobileView, GoodsReceiveInfoView>(); //
+            CreateMap<GoodsReceiveListMobileView, GoodsReceiveListView>();
             #endregion
             #endregion
 

+ 13 - 0
OASystem/OASystem.Domain/ViewModels/PersonnelModule/GoodsInfoView.cs

@@ -203,6 +203,12 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
     {
         public string GoodsType { get; set; }
     }
+
+    public class GoodsReceiveListMobileView : GoodsReceiveListView
+    {
+        public string GroupName { get; set; }
+    }
+
     /// <summary>
     /// 
     /// </summary>
@@ -215,6 +221,13 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
         public string GoodsType { get; set; }
     }
 
+
+    public class GoodsReceiveInfoMobileView : GoodsReceiveInfoView
+    {
+        public string GroupName { get; set; }
+    }
+
+
     /// <summary>
     /// 
     /// </summary>

+ 41 - 19
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -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) //pc端
+            {
+                _jv.Data = _mapper.Map<GoodsReceiveInfoView>(data);
+            }
+
             return _jv;
         }