Browse Source

签证费用录入 --> 新增添加“签证描述验证”
收款账单 --> 汇率保留四位小数

LEIYI 6 months ago
parent
commit
af3bfd1d5e

+ 8 - 5
OASystem/EntitySync/Program.cs

@@ -135,11 +135,14 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Grp_HotelReservationsContent),  //酒店费用子表
     //typeof(Grp_VisitingClients),  //拜访团组客户
     //typeof(Grp_ApprovalTravelDetails),  //公务出访表
-     //typeof(Sys_Countries),  //洲
-     //typeof(Sys_Continent),  //国家
-     //typeof(Sys_Cities),  //城市
-     //typeof(Grp_GroupModelFile),//团组文件 
-     typeof(Grp_VisaCommission),//签证费用录入 
+    //typeof(Sys_Countries),  //洲
+    //typeof(Sys_Continent),  //国家
+    //typeof(Sys_Cities),  //城市
+    //typeof(Grp_GroupModelFile),//团组文件 
+    //typeof(Grp_VisaCommission),//签证费用录入 
+    typeof(Pm_GoodsReceive),//物品领用表 
+    typeof(Pm_GoodsStorage),//物品入库表 
+    typeof(Pm_GoodsInfo),//物品详细表 
 
 });
 Console.WriteLine("数据库结构同步完成!");

+ 11 - 3
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1125,7 +1125,7 @@ namespace OASystem.API.Controllers
 
                                     string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/晚");
-                                    SetCells(ChildTable, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
+                                    SetCells(ChildTable, doc, rowIndex, 3, "汇率" + (item.SubTotal / item.Cost).ToString("#0.0000"));
                                     SetCells(ChildTable, doc, rowIndex, 4, "CNY " + item.SubTotal + "\r\n");
                                     rowIndex++;
                                     zsinfo += item.Place + "  " + days + "晚 " + item.Cost.ToString("#0.00") + currencyCode + "/晚" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY " + item.SubTotal * days + "\r\n";
@@ -1162,7 +1162,7 @@ namespace OASystem.API.Controllers
 
                                     string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable1, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
-                                    SetCells(ChildTable1, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
+                                    SetCells(ChildTable1, doc, rowIndex, 3, "汇率" + (item.SubTotal / item.Cost).ToString("#0.0000"));
                                     SetCells(ChildTable1, doc, rowIndex, 4, "CNY " + item.SubTotal);
                                     rowIndex++;
                                     hsinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY " + item.SubTotal * days + "\r\n";
@@ -1199,7 +1199,7 @@ namespace OASystem.API.Controllers
 
                                     string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable2, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
-                                    SetCells(ChildTable2, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
+                                    SetCells(ChildTable2, doc, rowIndex, 3, "汇率" + (item.SubTotal / item.Cost).ToString("#0.0000"));
                                     SetCells(ChildTable2, doc, rowIndex, 4, "CNY " + item.SubTotal + "\r\n");
                                     rowIndex++;
                                     gzinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY " + item.SubTotal * days + "\r\n";
@@ -1333,6 +1333,14 @@ namespace OASystem.API.Controllers
             Aspose.Words.Tables.Cell lshCell = table.Rows[rows].Cells[cells];
             //将单元格中的第一个段落移除
             lshCell.FirstParagraph.Remove();
+
+
+            //if (cells == 0) lshCell.CellFormat.Width = 120;
+            //else if (cells == 1) lshCell.CellFormat.Width = 50;
+            //else if (cells == 2) lshCell.CellFormat.Width = 120;
+            //else if (cells == 3) lshCell.CellFormat.Width = 100;
+            //else if (cells == 4) lshCell.CellFormat.Width = 120;
+
             //新建一个段落
             Paragraph p = new Paragraph(doc);
             var r = new Run(doc, val);

+ 1 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -11514,7 +11514,7 @@ ORDER by  gctggrc.id DESC
                 return Ok(JsonView(StatusCodes.Status400BadRequest, $"团组汇率-->酒店模块 {_currency} 币种未设置汇率,不支持预定成本Excel导出", ""));
 
             }
-
+            
             if (!_currency.ToUpper().Equals("CNY"))
             {
                 _rate = _GroupCostParameter.Rate;

+ 64 - 1
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -43,6 +43,7 @@ namespace OASystem.API.Controllers
         private string url;
         private string path;
         private readonly IHubContext<ChatHub, IChatClient> _hubContext;
+        private readonly GoodsRepository _goodsRep;
 
         /// <summary>
         /// 初始化
@@ -52,7 +53,7 @@ namespace OASystem.API.Controllers
         /// <param name="usersRep"></param>
         /// <param name="mapper"></param>
         public PersonnelModuleController(IQiYeWeChatApiService qiYeWeChatApiService, WageSheetRepository wageSheetRep, UsersRepository usersRep, IMapper mapper,
-            TaskAllocationRepository taskAllocationRep, IHubContext<ChatHub, IChatClient> hubContext)
+            TaskAllocationRepository taskAllocationRep, IHubContext<ChatHub, IChatClient> hubContext, GoodsRepository goodsRep)
         {
             _mapper = mapper;
             _usersRep = usersRep;
@@ -69,6 +70,7 @@ namespace OASystem.API.Controllers
 
             this._taskAllocationRep = taskAllocationRep;
             _hubContext = hubContext;
+            _goodsRep = goodsRep;
         }
 
         #region 工资表单
@@ -1767,5 +1769,66 @@ namespace OASystem.API.Controllers
         }
 
         #endregion
+
+        #region 物资进销存
+
+        /// <summary>
+        /// 物资进销存
+        /// 基础数据类型
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsInitDataSource()
+        {
+            return Ok(await _goodsRep.InitDataSource());
+        }
+
+        /// <summary>
+        /// 物资进销存
+        /// 物品列表
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsList(GoodsListDTO _dto)
+        {
+            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false,MsgTips.Port));
+            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+
+            return Ok(await _goodsRep.GoodsList(_dto));
+        }
+
+
+        /// <summary>
+        /// 物资进销存
+        /// 物品入库列表
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsStorageList(GoodsStorageListDTO _dto)
+        {
+            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+            
+            return Ok(await _goodsRep.GoodsStorageList(_dto));
+        }
+
+        /// <summary>
+        /// 物资进销存
+        /// 物品领用列表
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GoodsReceiveList(GoodsReceiveListDTO _dto)
+        {
+            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+
+            return Ok(await _goodsRep.GoodsReceiveList(_dto));
+        }
+        #endregion
     }
 }

+ 52 - 0
OASystem/OASystem.Domain/Dtos/PersonnelModule/GoodsDTO.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.PersonnelModule
+{
+    /// <summary>
+    /// 物品DTO
+    /// </summary>
+    public class GoodsDTO
+    {
+    }
+
+    /// <summary>
+    /// 物品List DTO
+    /// </summary>
+    public class GoodsListDTO : DtoBase 
+    {
+        /// <summary>
+        /// 类型Id
+        /// 全部类型:""
+        /// 其他类型:"1,2,3,4,5"
+        /// </summary>
+        public string TypeIds { get; set; }
+        public string GoodsName { get; set; }
+    }
+
+    /// <summary>
+    /// 物品入库List DTO
+    /// </summary>
+    public class GoodsStorageListDTO : DtoBase
+    {
+        /// <summary>
+        /// 物品Id
+        /// </summary>
+        public int GoodsId { get; set; }
+    }
+
+    /// <summary>
+    /// 物品领用List DTO
+    /// </summary>
+    public class GoodsReceiveListDTO : DtoBase
+    {
+
+        /// <summary>
+        /// 物品Id
+        /// </summary>
+        public int GoodsId { get; set; }
+    }
+}

+ 64 - 0
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsInfo.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.PersonnelModule
+{
+    /// <summary>
+    /// 物品详细表
+    /// </summary>
+    [SugarTable(tableName: "Pm_GoodsInfo", tableDescription: "物品详细表")]
+    public class Pm_GoodsInfo : EntityBase
+    {
+        /// <summary>
+        /// 类型Id
+        /// SetData Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "类型Id", IsNullable = true, ColumnDataType = "int")]
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 物品名称
+        /// </summary>
+        [SugarColumn(ColumnDescription = "物品名称", IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? Name { get; set; }
+
+        /// <summary>
+        /// 累计入库数量
+        /// </summary>
+        [SugarColumn(ColumnDescription = "累计入库数量", IsNullable = true, ColumnDataType = "int")]
+        public int SQ_Total { get; set; }
+
+        /// <summary>
+        /// 累计出库数量
+        /// </summary>
+        [SugarColumn(ColumnDescription = "累计出库数量", IsNullable = true, ColumnDataType = "int")]
+        public int OQ_Total { get; set; }
+
+        /// <summary>
+        /// 累计金额
+        /// </summary>
+        [SugarColumn(ColumnDescription = "累计金额", IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public int PriceTotal { get; set; }
+
+        /// <summary>
+        /// 现有库存
+        /// </summary>
+        [SugarColumn(ColumnDescription = "现有库存", IsNullable = true, ColumnDataType = "int")]
+        public int StockQuantity { get; set; }
+
+        /// <summary>
+        /// 最后操作人
+        /// </summary>
+        [SugarColumn(ColumnDescription = "最后操作人", IsNullable = true, ColumnDataType = "int")]
+        public int LastUpdateUserId { get; set; }
+
+        /// <summary>
+        /// 最后操作时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "最后操作时间", IsNullable = true, ColumnDataType = "datetime")]
+        public DateTime LastUpdateTime { get; set; }
+    }
+}

+ 75 - 0
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsReceive.cs

@@ -0,0 +1,75 @@
+using OASystem.Domain.Enums;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.PersonnelModule
+{
+
+    /// <summary>
+    /// 物品领用表
+    /// </summary>
+    [SugarTable(tableName: "Pm_GoodsReceive", tableDescription: "物品领用表")]
+    public class Pm_GoodsReceive: EntityBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// Grp_DelegationInfo Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "团组Id", IsNullable = true, ColumnDataType = "int")]
+        public int GroupId { get; set; }
+
+        /// <summary>
+        /// 商品Id
+        /// Pm_GoodsInfo Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "商品Id", IsNullable = true, ColumnDataType = "int")]
+        public int GoodsId { get; set; }
+
+        /// <summary>
+        /// 领用数量
+        /// </summary>
+        [SugarColumn(ColumnDescription = "领用数量", IsNullable = true, ColumnDataType = "int")]
+        public int Quantity { get; set; }
+
+        /// <summary>
+        /// 领用原因
+        /// </summary>
+        [SugarColumn(ColumnDescription = "申请人Id", IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? Reason { get; set; }
+
+        ///// <summary>
+        ///// 申请人Id
+        ///// Sys_User Id
+        ///// </summary>
+        //[SugarColumn(ColumnDescription = "申请人Id", IsNullable = true, ColumnDataType = "int")]
+        //public int ApplicantId { get; set; }
+
+        ///// <summary>
+        ///// 申请人时间
+        ///// </summary>
+        //[SugarColumn(ColumnDescription = "申请人时间", IsNullable = true, ColumnDataType = "datetime")]
+        //public DateTime ApplicantTime { get; set; }
+
+        /// <summary>
+        /// 审核状态
+        /// </summary>
+        [SugarColumn(ColumnDescription = "审核状态", IsNullable = true, ColumnDataType = "int")]
+        public GoodsAuditEnum AuditStatus { get; set; } = GoodsAuditEnum.Pending;
+
+        /// <summary>
+        /// 审核人 Id
+        /// Sys_User Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "审核人Id", IsNullable = true, ColumnDataType = "int")]
+        public int AuditUserId { get; set; }
+
+        /// <summary>
+        /// 审核时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "审核时间", IsNullable = true, ColumnDataType = "datetime")]
+        public DateTime AuditTime { get; set; }
+    }
+}

+ 65 - 0
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsStorage.cs

@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.PersonnelModule
+{
+    /// <summary>
+    /// 物品入库表
+    /// </summary>
+    [SugarTable(tableName: "Pm_GoodsStorage", tableDescription: "物品入库表")]
+    public class Pm_GoodsStorage : EntityBase
+    {
+        /// <summary>
+        /// 商品Id
+        /// Pm_GoodsInfo Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "商品Id", IsNullable = true, ColumnDataType = "int")]
+        public int GoodsId { get; set; }
+
+        /// <summary>
+        /// 此次入库数量
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次入库数量", IsNullable = true, ColumnDataType = "int")]
+        public int Quantity { get; set; }
+
+        /// <summary>
+        /// 此次物品单价
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次数量单价", IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal UnitPrice { get; set; }
+
+        /// <summary>
+        /// 此次物品总价
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次物品总价", IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal TotalPrice { get; set; }
+
+        /// <summary>
+        /// 此次供应商名称
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次供应商名称", IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? SupplierName { get; set; }
+
+        /// <summary>
+        /// 此次供应商电话
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次供应商电话", IsNullable = true, ColumnDataType = "varchar(20)")]
+        public string? SupplierTel { get; set; }
+
+        /// <summary>
+        /// 此次供应商地址
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次供应商地址", IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? SupplierAddress { get; set; }
+
+        /// <summary>
+        /// 此次供应商来源
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次供应商来源", IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? SupplierSource { get; set; }
+
+    }
+}

+ 31 - 0
OASystem/OASystem.Domain/Enums/GoodsAuditEnum.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Enums
+{
+    /// <summary>
+    /// 物品审核
+    /// </summary>
+    public enum GoodsAuditEnum :int
+    {
+        /// <summary>
+        /// 等待审核
+        /// </summary>
+        [Description("等待审核")]
+        Pending,
+        /// <summary>
+        /// 已通过审核
+        /// </summary>
+        [Description("已通过")]
+        Approved,
+        /// <summary>
+        /// 已拒绝审核
+        /// </summary>
+        [Description("已拒绝")]
+        Rejected 
+    }
+}

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

@@ -0,0 +1,58 @@
+using OASystem.Domain.Entities.PersonnelModule;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.PersonnelModule
+{
+    /// <summary>
+    /// 物品详细信息 View
+    /// </summary>
+    public class GoodsInfoView:Pm_GoodsInfo
+    {
+    }
+
+    /// <summary>
+    /// 物品类型View
+    /// </summary>
+    [SugarTable("Sys_SetDataType")]
+    public class GoodsTypeView
+    {
+        /// <summary>
+        /// 物品类型Id
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+        public int Id { get; set; }
+
+        public string Name { get; set; }
+
+        [Navigate(NavigateType.OneToMany, nameof(GoodsSubTypeView.STid))]
+        public List<GoodsSubTypeView> SubTypeItems { get; set; }
+
+        public string Remark { get; set; }
+        
+        public int IsDel { get; set; }
+    }
+
+    /// <summary>
+    /// 物品Sub类型
+    /// View
+    /// </summary>
+    [SugarTable("Sys_SetData")]
+    public class GoodsSubTypeView
+    {
+        /// <summary>
+        /// 物品类型Id
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+        public int Id { get; set; }
+
+        public int STid { get; set; }
+
+        public string Name { get; set; }
+
+        public int IsDel { get; set; }
+    }
+}

+ 6 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -357,7 +357,12 @@ From Grp_VisaInfo as v With(Nolock) left Join Grp_CreditCardPayment as c With(No
 
                 if (dto.Status == 1)//添加
                 {
-                    Grp_VisaInfo grp_Visa = _sqlSugar.Queryable<Grp_VisaInfo>().First(a => a.IsDel == 0 && a.VisaCurrency == dto.VisaCurrency && a.VisaPrice == dto.VisaPrice && a.VisaClient == dto.VisaClient);
+                    Grp_VisaInfo grp_Visa = _sqlSugar.Queryable<Grp_VisaInfo>().First(a => a.IsDel == 0 &&   
+                                                                                           a.VisaDescription.Equals(dto.VisaDescription) && 
+                                                                                           a.VisaCurrency == dto.VisaCurrency && 
+                                                                                           a.VisaPrice == dto.VisaPrice && 
+                                                                                           a.VisaClient == dto.VisaClient
+                                                                                     );
                     if (grp_Visa != null)
                     {
                         return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };

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

@@ -0,0 +1,189 @@
+using OASystem.Domain.Entities.PersonnelModule;
+using OASystem.Domain.ViewModels.PersonnelModule;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AutoMapper;
+using OASystem.Domain.Dtos.PersonnelModule;
+
+namespace OASystem.Infrastructure.Repositories.PersonnelModule
+{
+    /// <summary>
+    /// 物品进销存 
+    /// 仓储
+    /// </summary>
+    public class GoodsRepository:BaseRepository<Pm_GoodsInfo,GoodsInfoView>
+    {
+        private readonly IMapper _mapper;
+        private JsonView _jv;
+        public GoodsRepository(SqlSugarClient sqlSugar,IMapper mapper):base(sqlSugar)
+        {
+            _mapper = mapper;
+            _jv = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "无效请求!" };
+        }
+
+        /// <summary>
+        /// 基础数据
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> InitDataSource()
+        {
+
+            var typeData = await _sqlSugar.Queryable<GoodsTypeView>()
+                                          .Includes(x => x.SubTypeItems.Where(z => z.IsDel == 0)
+                                                                       //.Select(z => new {
+                                                                       //     z.Id,
+                                                                       //     z.STid,
+                                                                       //     z.Name
+                                                                       //})
+                                                                       .ToList())
+                                          .Where(x => x.IsDel == 0 &&
+                                                      x.Remark.Equals("GoodsType"))
+                                          //.Select(x => new { 
+                                          //        x.Id,
+                                          //        x.Name,
+                                          //        x.SubTypeItems
+                                          //})
+                                          .ToListAsync();
+
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = typeData;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
+
+       /// <summary>
+       /// 物品列表
+       /// </summary>
+       /// <param name="_dto"></param>
+       /// <returns></returns>
+        public async Task<JsonView> GoodsList(GoodsListDTO _dto)
+        {
+            var ids = new List<int>();
+            if (!string.IsNullOrEmpty(_dto.TypeIds))
+            {
+                var strArray = _dto.TypeIds.Split(',');
+                foreach (var str in strArray)
+                {
+                    if (int.TryParse(str, out int id))
+                    {
+                        ids.Add(id);
+                    }
+                }
+            }
+
+            RefAsync<int> total = 0;
+            var data = await _sqlSugar.Queryable<Pm_GoodsInfo>()
+                                      .LeftJoin<Sys_SetData>((gi, sd) => gi.Type == sd.Id)
+                                      .LeftJoin<Sys_Users>((gi, sd, u) => gi.LastUpdateUserId == u.Id)
+                                      .Where((gi, sd, u) => gi.IsDel == 0)
+                                      .WhereIF(ids.Count > 0, (gi, sd, u) => ids.Contains(gi.Type))
+                                      .WhereIF(!string.IsNullOrEmpty(_dto.GoodsName), (gi, sd, u) => gi.Name.Contains(_dto.GoodsName))
+                                      .Select((gi, sd, u) => new
+                                      {
+                                          gi.Id,
+                                          gi.Name,
+                                          gi.Type,
+                                          TypeName = sd.Name,
+                                          gi.StockQuantity,
+                                          LastUpdateUserName = u.CnName,
+                                          gi.LastUpdateTime,
+                                          gi.Remark,
+                                      })
+                                      .OrderByDescending(gi => gi.LastUpdateTime)
+                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+
+
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            _jv.Count = total;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
+
+        /// <summary>
+        /// 物品入库列表
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsStorageList(GoodsStorageListDTO _dto)
+        {
+            RefAsync<int> total = 0;
+            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(_dto.GoodsId > 0, (gs, gi, u) => gs.GoodsId == _dto.GoodsId)
+                                      .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,
+                                      })
+                                      .OrderByDescending(gs => gs.CreateTime)
+                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+
+
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            _jv.Count = total;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
+
+        /// <summary>
+        /// 物品领用列表
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
+        public async Task<JsonView> GoodsReceiveList(GoodsReceiveListDTO _dto)
+        {
+            RefAsync<int> total = 0;
+            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(_dto.GoodsId > 0, (gr, gi, u1, u2u) => gr.GoodsId == _dto.GoodsId)
+                                      .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
+                                      })
+                                      .OrderByDescending(gs => gs.CreateTime)
+                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+
+
+            _jv.Code = StatusCodes.Status200OK;
+            _jv.Data = data;
+            _jv.Count = total;
+            _jv.Msg = $"操作成功";
+            return _jv;
+        }
+
+
+    }
+}