服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-04-12 33b8cbd1b0419d59ef861ee401dacd1cb2bed410
Tiger.Business/WMS/MengQi/Biz.Mq.Customer.cs
@@ -1,4 +1,5 @@
using Rhea.Common;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
@@ -18,6 +19,28 @@
        public partial class MqCustomer : ICustomer
        {
            /// <summary>
            /// 获取分页
            /// </summary>
            /// <param name="pageList"></param>
            /// <returns></returns>
            public async Task<ApiAction<PageAble<Customer>>> GetCustomers(PageAble<Customer> pageList)
            {
                var res = new ApiAction<PageAble<Customer>>();
                try
                {
                    RefAsync<int> total = 0;
                    pageList.data = await Db.Queryable<Customer>().WhereIF(!string.IsNullOrEmpty(pageList.sqlcmd), x => x.CustomerCode.Contains(pageList.sqlcmd)).OrderBy(x=>x.CustomerCode).ToPageListAsync(pageList.pageIndex, pageList.pageSize, total);
                    pageList.totals = total;
                }
                catch (Exception ex)
                {
                    res.CatchExceptionWithLog(ex, "获取客户信息异常");
                }
                res.Data = pageList;
                return res;
            }
            /// <summary>
            /// 获取客户信息
            /// </summary>
            /// <returns></returns>
@@ -36,9 +59,21 @@
                return res;
            }
            public async Task<Result> SaveImportCustomerInfo(DataTable dt)
            public async Task<ApiAction> SaveImportCustomerInfo(List<Customer> list)
            {
                throw new NotImplementedException();
                var res = new ApiAction();
                //更新机型记录
                var db = Db;
                var dbTran = await db.UseTranAsync(async () =>
                {
                    await db.Saveable(list).ExecuteCommandAsync();
                });
                if (!dbTran.IsSuccess)
                {
                    res.IsSuccessed = false;
                    res.Message = $"导入异常";
                }
                return res;
            }
        }
    }