Browse Source

1、付款申请 --> 保险费用类型 --> 更改费用名称2、未审核数据List --> 保险费用类型 --> 更改费用名称

LEIYI 6 months ago
parent
commit
f5125415af

+ 75 - 2
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2366,7 +2366,44 @@ namespace OASystem.API.Controllers
                             priName = $"[费用名称:{ioaDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.Inviter ?? " -"}]";
                             break;
                         case 82:  // 82	团组客户保险
-                            priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
+
+                            string bx_sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", groupInfo.Id);
+                            List<SimplClientInfo> bx_arr = _sqlSugar.SqlQueryable<SimplClientInfo>(bx_sql).ToList();
+
+                            string bx_ClientName = insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? "";
+                            string bx_clientName = "-";
+                            if (Regex.Match(bx_ClientName, @"\d+,?").Value.Length > 0)
+                            {
+                                string[] temparr = bx_ClientName.Split(',');
+                                string fistrStr = temparr[0];
+                                int count = temparr.Count();
+
+                                int tempId;
+                                bool success = int.TryParse(fistrStr, out tempId);
+                                if (success)
+                                {
+                                    SimplClientInfo tempInfo = bx_arr.FirstOrDefault(s => s.Id == tempId);
+                                    if (tempInfo != null)
+                                    {
+                                        if (count > 1)
+                                        {
+                                            bx_clientName = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);
+                                        }
+                                        else
+                                        {
+                                            bx_clientName = string.Format(@"{0}{1}", tempInfo.LastName, tempInfo.FirstName);
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    bx_clientName = fistrStr;
+                                }
+                            }
+
+                            //priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
+                            priName = $"[费用名称:{bx_clientName}]";
+
                             break;
                         case 85:  // 85	机票预订
                             string flightsCode = airDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.FlightsCode ?? "-";
@@ -6033,7 +6070,43 @@ Group by PriceType ", dto.diId);
                                 priName = $"[费用名称:{ioaDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.Inviter ?? " -"}]";
                                 break;
                             case 82:  // 82	团组客户保险
-                                priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
+
+                                string bx_sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", groupInfo.Id);
+                                List<SimplClientInfo> bx_arr = _sqlSugar.SqlQueryable<SimplClientInfo>(bx_sql).ToList();
+
+                                string bx_ClientName = insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? "";
+                                string bx_clientName = "-";
+                                if (Regex.Match(bx_ClientName, @"\d+,?").Value.Length > 0)
+                                {
+                                    string[] temparr = bx_ClientName.Split(',');
+                                    string fistrStr = temparr[0];
+                                    int count = temparr.Count();
+
+                                    int tempId;
+                                    bool success = int.TryParse(fistrStr, out tempId);
+                                    if (success)
+                                    {
+                                        SimplClientInfo tempInfo = bx_arr.FirstOrDefault(s => s.Id == tempId);
+                                        if (tempInfo != null)
+                                        {
+                                            if (count > 1)
+                                            {
+                                                bx_clientName = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);
+                                            }
+                                            else
+                                            {
+                                                bx_clientName = string.Format(@"{0}{1}", tempInfo.LastName, tempInfo.FirstName);
+                                            }
+                                        }
+                                    }
+                                    else
+                                    {
+                                        bx_clientName = fistrStr;
+                                    }
+                                }
+
+                                //priName = $"[费用名称:{insureDatas.Find(it => payInfo.DIId == it.DiId && payInfo.CId == it.Id)?.ClientName ?? " -"}]";
+                                priName = $"[费用名称:{bx_clientName}]";
                                 break;
                             case 85:  // 85	机票预订
                                 string flightsCode = airDatas.Find(it => payInfo.DIId == it.DIId && payInfo.CId == it.Id)?.FlightsCode ?? "-";

+ 26 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -6452,6 +6452,32 @@ namespace OASystem.API.Controllers
             return Ok(await _visaCommissionRep.Item(_dto));
         }
 
+
+        /// <summary>
+        /// 签证提成录入 
+        /// Save
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> VisaCommissionSave(VisaCommissionSaveDto _dto)
+        {
+            //参数验证
+            if (_dto.Items.Length < 1) return Ok(JsonView(false, "请输入有效的请求!"));
+
+            foreach (var item in _dto.Items)
+            {
+                if (item.CurrUserId < 1) return Ok(JsonView(false, "请输入有效的CurrUserId!"));
+                if (item.DiId < 1) return Ok(JsonView(false, "请输入有效的DiId!"));
+                if (string.IsNullOrEmpty( item.Country) ) return Ok(JsonView(false, "国家为空!"));
+                if (item.Quantity < 1) return Ok(JsonView(false, "请输入有效的Qauntity!"));
+            }
+            
+
+            return Ok(await _visaCommissionRep.Save(_dto));
+        }
+
         /// <summary>
         /// 签证提成录入 
         /// Create

+ 65 - 0
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1799,6 +1799,41 @@ namespace OASystem.API.Controllers
             return Ok(await _goodsRep.GoodsList(_dto));
         }
 
+        /// <summary>
+        /// 物资进销存
+        /// 物品详情
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsInfo(int portType, int id)
+        {
+            if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (id < 1) return Ok(JsonView(false, MsgTips.Id));
+
+            return Ok(await _goodsRep.GoodsInfo(portType, id));
+        }
+
+        /// <summary>
+        /// 物资进销存
+        /// 物品 OP(Add OR Edit)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsOP(GoodsOPDTO _dto)
+        {
+            var validator = new GoodsOPDTOValidator();
+            var validatorRes = await validator.ValidateAsync(_dto);
+            if (!validatorRes.IsValid)
+            {
+                var sb = new StringBuilder();
+                foreach (var error in validatorRes.Errors) sb.AppendLine(error.ErrorMessage);
+                return Ok(JsonView(false, sb.ToString()));
+            }
+
+            return Ok(await _goodsRep.GoodsOP(_dto));
+        }
 
         /// <summary>
         /// 物资进销存
@@ -1815,6 +1850,21 @@ namespace OASystem.API.Controllers
             return Ok(await _goodsRep.GoodsStorageList(_dto));
         }
 
+        /// <summary>
+        /// 物资进销存
+        /// 物品入库详情
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsStorageInfo(int portType, int id)
+        {
+            if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (id < 1) return Ok(JsonView(false, MsgTips.Id));
+
+            return Ok(await _goodsRep.GoodsStorageInfo(portType,id));
+        }
+
         /// <summary>
         /// 物资进销存
         /// 物品领用列表
@@ -1829,6 +1879,21 @@ namespace OASystem.API.Controllers
 
             return Ok(await _goodsRep.GoodsReceiveList(_dto));
         }
+
+        /// <summary>
+        /// 物资进销存
+        /// 物品领用详情
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsReceiveInfo(int portType, int id)
+        {
+            if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (id < 1) return Ok(JsonView(false, MsgTips.Id));
+
+            return Ok(await _goodsRep.GoodsReceiveInfo(portType, id));
+        }
         #endregion
     }
 }

+ 1 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -170,6 +170,7 @@ namespace OASystem.Domain.AutoMappers
             #region 签证提成录入
 
             CreateMap<VisaCommissionCreateDto, Grp_VisaCommission>();
+            CreateMap<VisaCommissionCreateView, Grp_VisaCommission>();
             #endregion
 
             #endregion

+ 45 - 2
OASystem/OASystem.Domain/Dtos/Groups/VisaCommissionDto.cs

@@ -1,4 +1,6 @@
-using FluentValidation;
+using EyeSoft.Collections.Generic;
+using FluentValidation;
+using Org.BouncyCastle.Utilities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -11,7 +13,7 @@ namespace OASystem.Domain.Dtos.Groups
     {
     }
 
-    public class VisaCommissionItemDto: PortDtoBase
+    public class VisaCommissionItemDto : PortDtoBase
     {
         public int CurrUserId { get; set; }
 
@@ -30,6 +32,47 @@ namespace OASystem.Domain.Dtos.Groups
         }
     }
 
+
+    public class VisaCommissionSaveDto
+    {
+
+        public VisaCommissionCreateView[] Items { get; set; }
+    }
+
+
+    public class VisaCommissionCreateView 
+    {
+        /// <summary>
+        /// ID
+        /// ID<1 添加
+        /// ID>0 修改
+        /// </summary>
+        public int Id { get; set; }
+        /// 用户ID
+        /// </summary>
+        public int CurrUserId { get; set; }
+        /// <summary>
+        /// 团组ID
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 国家
+        /// </summary>
+        public string Country { get; set; }
+
+        /// <summary>
+        /// 数量
+        /// </summary>
+        public int Quantity { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+
+
     /// <summary>
     /// Create Dto
     /// </summary>

+ 77 - 2
OASystem/OASystem.Domain/Dtos/PersonnelModule/GoodsDTO.cs

@@ -1,4 +1,5 @@
-using System;
+using FluentValidation;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -13,10 +14,12 @@ namespace OASystem.Domain.Dtos.PersonnelModule
     {
     }
 
+    #region 物品 DTO
+
     /// <summary>
     /// 物品List DTO
     /// </summary>
-    public class GoodsListDTO : DtoBase 
+    public class GoodsListDTO : DtoBase
     {
         /// <summary>
         /// 类型Id
@@ -27,6 +30,61 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         public string GoodsName { get; set; }
     }
 
+    /// <summary>
+    /// 物品 OP  DTO
+    /// </summary>
+    public class GoodsOPDTO
+    {
+        /// <summary>
+        /// 当前用户id
+        /// </summary>
+        public int CurrUserId { get; set; }
+
+        /// <summary>
+        /// ID编号
+        /// ID > 0 Edit
+        /// ID < 1 Add
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 物品名称
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 类型
+        /// </summary>
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+
+    /// <summary>
+    /// 物品 OP  DTO
+    /// Validator
+    /// </summary>
+    public class GoodsOPDTOValidator : AbstractValidator<GoodsOPDTO>
+    {
+        /// <summary>
+        /// 初始化
+        /// </summary>
+        public GoodsOPDTOValidator()
+        {
+            RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
+            RuleFor(x => x.Name).NotEmpty().WithMessage("物品名称为空!");
+            RuleFor(x => x.Type).Must(x => x > 0).WithMessage("物品所属类型未选择!");
+        }
+    }
+
+
+    #endregion
+
+
+
     /// <summary>
     /// 物品入库List DTO
     /// </summary>
@@ -49,4 +107,21 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public int GoodsId { get; set; }
     }
+
+    /// <summary>
+    /// 物品入库 操作(Create Or Edit) DTO
+    /// </summary>
+    public class GoodsStorageOPDTO
+    {
+        /// <summary>
+        /// 物品Id
+        /// </summary>
+        public int GoodsId { get; set; }
+
+        /// <summary>
+        /// 物品名称
+        /// </summary>
+        public string GoodsName { get; set; }
+    }
+
 }

+ 7 - 7
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsInfo.cs

@@ -28,26 +28,26 @@ namespace OASystem.Domain.Entities.PersonnelModule
         /// <summary>
         /// 累计入库数量
         /// </summary>
-        [SugarColumn(ColumnDescription = "累计入库数量", IsNullable = true, ColumnDataType = "int")]
-        public int SQ_Total { get; set; }
+        [SugarColumn(ColumnDescription = "累计入库数量", IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal SQ_Total { get; set; }
 
         /// <summary>
         /// 累计出库数量
         /// </summary>
-        [SugarColumn(ColumnDescription = "累计出库数量", IsNullable = true, ColumnDataType = "int")]
-        public int OQ_Total { get; set; }
+        [SugarColumn(ColumnDescription = "累计出库数量", IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal OQ_Total { get; set; }
 
         /// <summary>
         /// 累计金额
         /// </summary>
         [SugarColumn(ColumnDescription = "累计金额", IsNullable = true, ColumnDataType = "decimal(10,2)")]
-        public int PriceTotal { get; set; }
+        public decimal PriceTotal { get; set; }
 
         /// <summary>
         /// 现有库存
         /// </summary>
-        [SugarColumn(ColumnDescription = "现有库存", IsNullable = true, ColumnDataType = "int")]
-        public int StockQuantity { get; set; }
+        [SugarColumn(ColumnDescription = "现有库存", IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal StockQuantity { get; set; }
 
         /// <summary>
         /// 最后操作人

+ 2 - 2
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsReceive.cs

@@ -31,8 +31,8 @@ namespace OASystem.Domain.Entities.PersonnelModule
         /// <summary>
         /// 领用数量
         /// </summary>
-        [SugarColumn(ColumnDescription = "领用数量", IsNullable = true, ColumnDataType = "int")]
-        public int Quantity { get; set; }
+        [SugarColumn(ColumnDescription = "领用数量", IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal Quantity { get; set; }
 
         /// <summary>
         /// 领用原因

+ 2 - 2
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsStorage.cs

@@ -22,8 +22,8 @@ namespace OASystem.Domain.Entities.PersonnelModule
         /// <summary>
         /// 此次入库数量
         /// </summary>
-        [SugarColumn(ColumnDescription = "此次入库数量", IsNullable = true, ColumnDataType = "int")]
-        public int Quantity { get; set; }
+        [SugarColumn(ColumnDescription = "此次入库数量", IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal Quantity { get; set; }
 
         /// <summary>
         /// 此次物品单价

+ 52 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaCommissionRepository.cs

@@ -5,6 +5,7 @@ using OASystem.Domain.ViewModels.Groups;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -75,6 +76,57 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
 
 
+        /// <summary>
+        /// Save
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> Save(VisaCommissionSaveDto _dto)
+        {
+            var data = _mapper.Map<List<Grp_VisaCommission>>(_dto.Items);
+            for (int i = 0; i < data.Count; i++)
+            {
+                data[i].CreateUserId = _dto.Items.FirstOrDefault()?.CurrUserId ?? 0;
+                data[i].UId = _dto.Items.FirstOrDefault()?.CurrUserId ?? 0;
+            }
+
+            //添加数据
+            var addData = data.Where(x => x.Id < 1).ToList();
+            //修改数据
+            var updData = data.Where(x => x.Id > 0).ToList();
+
+            _sqlSugar.BeginTran();
+            bool status = false;
+            if (addData.Count > 0) { 
+            
+                var addCount = await _sqlSugar.Insertable<Grp_VisaCommission>(addData).ExecuteCommandAsync();
+                if (addCount > 0) status=true;
+            }
+
+            if (updData.Count > 0)
+            {
+                var updCount =  await _sqlSugar.Updateable<Grp_VisaCommission>(updData)
+                                               .UpdateColumns(x => new
+                                               {
+                                                   x.Country,
+                                                   x.Quantity,
+                                                   x.Remark
+                                               })
+                                               .WhereColumns(x => x.Id)
+                                               .ExecuteCommandAsync();
+                if (updCount > 0) status = true;
+            }
+
+            var jv = new JsonView() { Code = StatusCodes.Status200OK, Msg = "操作成功!" };
+            if (status) _sqlSugar.CommitTran();
+            else
+            {
+                _sqlSugar.RollbackTran();
+                jv.Code = StatusCodes.Status400BadRequest;
+                jv.Msg = "操作失败";
+            }
+
+            return jv;
+        }
         /// <summary>
         /// Create
         /// </summary>

+ 210 - 0
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -7,6 +7,7 @@ using System.Text;
 using System.Threading.Tasks;
 using AutoMapper;
 using OASystem.Domain.Dtos.PersonnelModule;
+using SqlSugar;
 
 namespace OASystem.Infrastructure.Repositories.PersonnelModule
 {
@@ -103,6 +104,104 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             return _jv;
         }
 
+        /// <summary>
+        /// 物品Info
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsInfo(int portType,int id)
+        {
+            var data = await _sqlSugar.Queryable<Pm_GoodsInfo>()
+                                      .LeftJoin<Sys_SetData>((gi, sd) => gi.Type == sd.Id)
+                                      .LeftJoin<Sys_Users>((gi, sd, u1) => gi.LastUpdateUserId == u1.Id)
+                                      .LeftJoin<Sys_Users>((gi, sd, u1 ,u2) => gi.CreateUserId == u2.Id)
+                                      .Where((gi, sd, u1, u2) => gi.IsDel == 0 && gi.Id == id)
+                                      .Select((gi, sd, u1, u2) => new
+                                      {
+                                          gi.Id,
+                                          gi.Name,
+                                          gi.Type,
+                                          TypeName = sd.Name,
+                                          gi.SQ_Total,
+                                          gi.OQ_Total,
+                                          gi.PriceTotal,
+                                          gi.StockQuantity,
+                                          gi.Remark,
+                                          LastUpdateUserName = u1.CnName,
+                                          gi.LastUpdateTime,
+                                          CreateUserName = u2.CnName,
+                                          gi.CreateTime,
+                                      })
+                                      .FirstAsync();
+
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
+
+        /// <summary>
+        /// 物品 OP(Create Or Edit)
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsOP(GoodsOPDTO _dto)
+        {
+            var info = new Pm_GoodsInfo()
+            {
+                Id = _dto.Id,
+                Name = _dto.Name,
+                Type = _dto.Type,
+                SQ_Total = 0,
+                OQ_Total = 0,
+                PriceTotal = 0,
+                StockQuantity = 0,
+                Remark = _dto.Remark,
+                LastUpdateUserId = _dto.CurrUserId,
+                LastUpdateTime = DateTime.Now,
+                CreateUserId = _dto.CurrUserId
+            };
+
+            if (_dto.Id > 0) //Edit
+            {
+                var upd = await _sqlSugar.Updateable<Pm_GoodsInfo>(info)
+                                         .UpdateColumns(x => new
+                                         {
+                                             x.Name,
+                                             x.Type,
+                                             x.Remark,
+                                             x.LastUpdateUserId,
+                                             x.LastUpdateTime,
+                                         })
+                                         .ExecuteCommandAsync();
+                if (upd > 0)
+                {
+                    _jv.Msg = $"修改成功!"; 
+                    _jv.Code = StatusCodes.Status200OK;
+                    return _jv;
+                }
+            }
+            else if (_dto.Id < 1) //添加
+            {
+                var selectInfo = await _sqlSugar.Queryable<Pm_GoodsInfo>().FirstAsync(x => x.Name.Equals(info.Name));
+                if (selectInfo != null)
+                {
+                    _jv.Msg = $"“{info.Name}”该物品已存在,请勿重新添加!";
+                    return _jv;
+                }
+
+                var add = await _sqlSugar.Insertable<Pm_GoodsInfo>(info).ExecuteCommandAsync();
+                if (add > 0)
+                {
+                    _jv.Msg = $"添加成功!";
+                    _jv.Code = StatusCodes.Status200OK;
+                    return _jv;
+                }
+            }
+            return _jv;
+        }
+
+
         /// <summary>
         /// 物品入库列表
         /// </summary>
@@ -142,6 +241,80 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             return _jv;
         }
 
+        /// <summary>
+        /// 物品入库详情
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsStorageInfo(int portType, int id)
+        {
+            var data = await _sqlSugar.Queryable<Pm_GoodsStorage>()
+                                      .LeftJoin<Pm_GoodsInfo>((gs, gi) => gs.GoodsId == gi.Id)
+                                      .LeftJoin<Sys_Users>((gs, gi, u) => gs.CreateUserId == u.Id)
+                                      .Where((gs, gi, u) => gs.IsDel == 0)
+                                      .WhereIF(id > 0, (gs, gi, u) => gs.GoodsId == id)
+                                      .Select((gs, gi, u) => new
+                                      {
+                                          gs.Id,
+                                          gs.GoodsId,
+                                          GoodsName = gi.Name,
+                                          gs.Quantity,
+                                          gs.UnitPrice,
+                                          gs.TotalPrice,
+                                          gs.SupplierName,
+                                          gs.SupplierTel,
+                                          gs.SupplierAddress,
+                                          gs.SupplierSource,
+                                          CreateUserName = u.CnName,
+                                          gs.CreateTime,
+                                          gs.Remark
+                                      })
+                                      .FirstAsync();
+
+            _jv.Msg = $"操作成功!";
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            return _jv;
+        }
+
+
+        /// <summary>
+        /// 物品入库 操作(Create Or Edit)
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsStorageOP(int portType, int id)
+        {
+            var data = await _sqlSugar.Queryable<Pm_GoodsStorage>()
+                                      .LeftJoin<Pm_GoodsInfo>((gs, gi) => gs.GoodsId == gi.Id)
+                                      .LeftJoin<Sys_Users>((gs, gi, u) => gs.CreateUserId == u.Id)
+                                      .Where((gs, gi, u) => gs.IsDel == 0)
+                                      .WhereIF(id > 0, (gs, gi, u) => gs.GoodsId == id)
+                                      .Select((gs, gi, u) => new
+                                      {
+                                          gs.Id,
+                                          gs.GoodsId,
+                                          GoodsName = gi.Name,
+                                          gs.Quantity,
+                                          gs.UnitPrice,
+                                          gs.TotalPrice,
+                                          gs.SupplierName,
+                                          gs.SupplierTel,
+                                          gs.SupplierAddress,
+                                          gs.SupplierSource,
+                                          CreateUserName = u.CnName,
+                                          gs.CreateTime,
+                                          gs.Remark
+                                      })
+                                      .FirstAsync();
+
+            _jv.Msg = $"操作成功!";
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            return _jv;
+        }
+
+
         /// <summary>
         /// 物品领用列表
         /// </summary>
@@ -184,6 +357,43 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             return _jv;
         }
 
+        /// <summary>
+        /// 物品领用详情
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsReceiveInfo(int portType, int id)
+        {
+            var data = await _sqlSugar.Queryable<Pm_GoodsReceive>()
+                                      .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, u2u) => gr.GoodsId == id)
+                                      .Select((gr, gi, u1, u2) => new
+                                      {
+                                          gr.Id,
+                                          gr.GroupId,
+                                          gr.GoodsId,
+                                          GoodsName = gi.Name,
+                                          gr.Quantity,
+                                          gr.Reason,
+                                          gr.Remark,
+                                          gr.AuditStatus,
+                                          AuditStatusText = gr.AuditStatus.GetDescription(),
+                                          gr.AuditUserId,
+                                          AuditUserName = u1.CnName,
+                                          gr.AuditTime,
+                                          CreateUserName = u2.CnName,
+                                          gr.CreateTime
+                                      })
+                                      .FirstAsync();
+
 
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
     }
 }