hwh
2024-07-04 2dd922eb3ab68c0314f5828fcae1ed7db0e17d9e
客户、物流、单位
20个文件已修改
650 ■■■■ 已修改文件
HTML/js/public.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Utility/Extension/ApplicationBuilderExtensions.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/CustomerServer.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/DictionaryServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/ExceptionServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/LogisticsInfoServer.cs 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/PackagServer.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/PalletsServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageAreaServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageLocatServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageRoadwayServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/UnitServer.cs 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/WareHouseServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.DAL/BaseRepository.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ISysServer/ICustomerServer.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ISysServer/ILogisticsInfoServer.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ISysServer/IUnitServer.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IDAL/IBaseRepository.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BasisController.cs 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/js/public.js
@@ -39,6 +39,15 @@
    if (!$.cookie('token')) {
      callbackFun("登录人信息已失效");
    }
    if(isExpired = isTokenExpired($.cookie('token'))){
      try{
        parent.window.location.href = '/views/Login.html';
      }
      catch(error){
        window.location.href = '/views/Login.html';
      }
      return;
    }
  } 
  $.ajax({
    url: url,
@@ -57,9 +66,7 @@
      // console.log(status);
      callbackFun(res);
    },
    error: function (res, status, error) {
      // console.log(res);
      // console.log(status);
    error: function (res, status, error) {
      callbackFun(res.responseJSON, status, error);
      // layer.msg(res.statusText, {
      //   icon: 2,
@@ -68,6 +75,23 @@
    },
  });
}
function isTokenExpired(token) {
  const tokenParts = token.split('.');
  if (tokenParts.length !== 3) {
    return true; // JWT 格式不正确
  }
  const payloadBase64 = tokenParts[1];
  const payload = JSON.parse(atob(payloadBase64));
  if (!payload || !payload.exp) {
    return true; // 没有有效载荷或者没有过期时间
  }
  const now = Date.now() / 1000; // 当前时间戳(秒)
  const expiration = payload.exp;
  return now >= expiration;
}
function synData(url, data, type, callbackFun) {
  var deferred = $.Deferred();
  if (type != "get") {
Wms/Utility/Extension/ApplicationBuilderExtensions.cs
@@ -53,16 +53,23 @@
                    if (!string.IsNullOrEmpty(token))
                    {
                        var handler = new JwtSecurityTokenHandler();
                        var jwtToken = handler.ReadJwtToken(token);
                        var claim = jwtToken.Payload.Claims.FirstOrDefault(s => s.Type == "LoginName");
                        //foreach (var claim in jwtToken.Payload.Claims)
                        //{
                        //    Console.WriteLine($"{claim.Type}: {claim.Value}");
                        //}
                        if (claim != null)
                            diagnosticContext.Set("_UserName", claim.Value);
                        else
                            diagnosticContext.Set("_UserName", "");
                        try
                        {
                            var jwtToken = handler.ReadJwtToken(token);
                            var claim = jwtToken.Payload.Claims.FirstOrDefault(s => s.Type == "LoginName");
                            //foreach (var claim in jwtToken.Payload.Claims)
                            //{
                            //    Console.WriteLine($"{claim.Type}: {claim.Value}");
                            //}
                            if (claim != null)
                                diagnosticContext.Set("_UserName", claim.Value);
                            else
                                diagnosticContext.Set("_UserName", "");
                        }
                        catch (Exception)
                        {
                        }
                    }
                    //请求body
                    var requestContent = "{}";
Wms/WMS.BLL/SysServer/CustomerServer.cs
@@ -25,7 +25,7 @@
        }
        public List<CustomerDto> GetCustomerList(string no,string name, int? type, string linkMan, string phone, int page, int limit, out int count)
        public async Task<List<CustomerDto>> GetCustomerList(string no, string name, int? type, string linkMan, string phone, int page, int limit, RefAsync<int> count)
        {
            try
            {
@@ -37,10 +37,10 @@
                    .AndIF(!string.IsNullOrWhiteSpace(phone), it => it.Phone.Contains(phone.Trim()))
                    .ToExpression();//注意 这一句 不能少
                var data = CustomerRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = await CustomerRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.CreateUserInfo)
                    .Includes(x => x.UpdateUserInfo)
                    .ToList();
                    .ToListAsync();
                count = counts;
                return data.Select(m => new CustomerDto()
@@ -68,11 +68,11 @@
            }
        }
        public SysCustomer GetCustomer(int id)
        public async Task<SysCustomer> GetCustomer(int id)
        {
            try
            {
                var data = CustomerRst.GetOneById(id);
                var data = await CustomerRst.GetOneByIdAsync(id);
                return data;
            }
            catch (Exception e)
@@ -81,11 +81,11 @@
            }
        }
        public List<SysCustomer> GetCustomerSelect()
        public async Task<List<SysCustomer>> GetCustomerSelect()
        {
            try
            {
                var data = CustomerRst.GetAllAsync().ToList();
                var data = await CustomerRst.GetAllAsync();
                return data;
            }
            catch (Exception e)
@@ -94,17 +94,17 @@
            }
        }
        public bool AddCustomer(string no, string name, int type, string address, string linkMan, string phone, string bankAccount, string creditRating, string demo, int userId)
        public async Task<bool> AddCustomer(string no, string name, int type, string address, string linkMan, string phone, string bankAccount, string creditRating, string demo, int userId)
        {
            try
            {
                //判断是否重复
                var customer = CustomerRst.GetAllWhereAsync(m => m.CustomerNo == no && m.IsDel == "0").First();
                var customer = CustomerRst.GetAllWhere(m => m.CustomerNo == no && m.IsDel == "0").First();
                if (customer != null)
                {
                    throw new Exception("相同编码的客户已存在,请勿重复添加");
                }
                var num = CustomerRst.Add(new SysCustomer()
                var num = await CustomerRst.AddAsync(new SysCustomer()
                {
                    CustomerNo = no,
                    CustomerName = name,
@@ -125,12 +125,12 @@
            }
        }
        public bool EditCustomer(int id, string no, string name, int type, string address, string linkMan, string phone,
        public async Task<bool> EditCustomer(int id, string no, string name, int type, string address, string linkMan, string phone,
            string bankAccount, string creditRating, string demo, int userId)
        {
            try
            {
                var customer = CustomerRst.GetOneById(id);
                var customer = await CustomerRst.GetOneByIdAsync(id);
                if (customer == null)
                {
                    throw new Exception("未查询到客户信息");
@@ -147,7 +147,7 @@
                customer.Demo = demo;
                customer.UpdateUser = userId;
                customer.UpdateTime = DateTime.Now;
                var num = CustomerRst.Edit(customer);
                var num = await CustomerRst.EditAsync(customer);
                return num > 0;
            }
            catch (Exception e)
@@ -156,35 +156,21 @@
            }
        }
        public bool DelCustomer(int id, int userId)
        public async Task<bool> DelCustomer(int id, int userId)
        {
            try
            {
                var num = CustomerRst.Remove(id, userId);
                return num > 0;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var num = await CustomerRst.RemoveAsync(id, userId);
            return num > 0;
        }
        public bool DelsCustomer(List<int> ids, int userId)
        public async Task<bool> DelsCustomer(List<int> ids, int userId)
        {
            try
            var list = await CustomerRst.GetAllWhere(m => ids.Contains(m.Id)).ToListAsync();
            for (int i = 0; i < list.Count; i++)
            {
                var list = CustomerRst.GetAllWhereAsync(m => ids.Contains(m.Id)).ToList();
                for (int i = 0; i < list.Count; i++)
                {
                    _operation.InsertOperation("基础信息", "客户管理", list[i].CustomerNo, "删除", "删除客户信息 客户号:" + list[i].CustomerNo, userId);
                }
                var num = CustomerRst.RemoveAll(list, userId);
                return num > 0;
                await _operation.InsertOperation("基础信息", "客户管理", list[i].CustomerNo, "删除", "删除客户信息 客户号:" + list[i].CustomerNo, userId);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var num = await CustomerRst.RemoveAllAsync(list, userId);
            return num > 0;
        }
    }
}
Wms/WMS.BLL/SysServer/DictionaryServer.cs
@@ -31,7 +31,7 @@
        {
            try
            {
                var data = _dic.GetAllWhereAsync(m => m.ParentNo == parentNo && m.Level == "1").OrderBy(m => m.Ord).ToList();
                var data = _dic.GetAllWhere(m => m.ParentNo == parentNo && m.Level == "1").OrderBy(m => m.Ord).ToList();
                return data;
            }
            catch (Exception e)
Wms/WMS.BLL/SysServer/ExceptionServer.cs
@@ -57,7 +57,7 @@
                    .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type)
                    .ToExpression();//注意 这一句 不能少
                var data = await ExceptionRst.GetAllByOrderPageAsync(item, limit, page, out int counts).ToListAsync();
                var data = await ExceptionRst.GetAllByOrderPage(item, limit, page, out int counts).ToListAsync();
                return data;
            }
            catch (Exception e)
Wms/WMS.BLL/SysServer/LogisticsInfoServer.cs
@@ -24,7 +24,7 @@
            _operation = operation;
        }
        public List<LogisticsInfoDto> GetLogisticsInfoList(string name, string linkMan, string phone, string licensePlate, string type, int page, int limit, out int count)
        public async Task<List<LogisticsInfoDto>> GetLogisticsInfoList(string name, string linkMan, string phone, string licensePlate, string type, int page, int limit, RefAsync<int> count)
        {
            try
            {
@@ -36,9 +36,9 @@
                    .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type)
                    .ToExpression();//注意 这一句 不能少
                var data = LogisticsInfoRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = await LogisticsInfoRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.CreateUserInfo)
                    .Includes(x => x.UpdateUserInfo).ToList();
                    .Includes(x => x.UpdateUserInfo).ToListAsync();
                count = counts;
                return data.Select(m => new LogisticsInfoDto()
                {
@@ -64,117 +64,74 @@
            }
        }
        public SysLogisticsInfo GetLogisticsInfo(int id)
        public async Task<SysLogisticsInfo> GetLogisticsInfo(int id)
        {
            try
            {
                var data = LogisticsInfoRst.GetOneById(id);
                return data;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var data = await LogisticsInfoRst.GetOneByIdAsync(id);
            return data;
        }
        public List<SysLogisticsInfo> GetLogisticsInfoSelect()
        public async Task<List<SysLogisticsInfo>> GetLogisticsInfoSelect()
        {
            try
            {
                var data = LogisticsInfoRst.GetAllAsync().ToList();
                return data;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var data = await LogisticsInfoRst.GetAllAsync();
            return data;
        }
        public bool AddLogisticsInfo(AddLogisticsInfoVm model, int userId)
        public async Task<bool> AddLogisticsInfo(AddLogisticsInfoVm model, int userId)
        {
            try
            var num = await LogisticsInfoRst.AddAsync(new SysLogisticsInfo()
            {
                var num = LogisticsInfoRst.Add(new SysLogisticsInfo()
                {
                    CarrierName = model.CarrierName,
                    Address = model.Address,
                    LinkMan = model.LinkMan,
                    Phone = model.Phone,
                    BankAccount = model.BankAccount,
                    CreditRating = model.CreditRating,
                    LicensePlate = model.LicensePlate,
                    Type = model.Type,
                    Demo = model.Demo,
                    CreateUser = userId
                });
                return num > 0;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
                CarrierName = model.CarrierName,
                Address = model.Address,
                LinkMan = model.LinkMan,
                Phone = model.Phone,
                BankAccount = model.BankAccount,
                CreditRating = model.CreditRating,
                LicensePlate = model.LicensePlate,
                Type = model.Type,
                Demo = model.Demo,
                CreateUser = userId
            });
            return num > 0;
        }
        public bool EditLogisticsInfo(EditLogisticsInfoVm model, int userId)
        public async Task<bool> EditLogisticsInfo(EditLogisticsInfoVm model, int userId)
        {
            try
            var logistics = await LogisticsInfoRst.GetOneByIdAsync(model.Id);
            if (logistics == null)
            {
                var logistics = LogisticsInfoRst.GetOneById(model.Id);
                if (logistics == null)
                {
                    throw new Exception("未查询到物流信息");
                }
                throw new Exception("未查询到物流信息");
            }
                logistics.CarrierName = model.CarrierName;
                logistics.Address = model.Address;
                logistics.LinkMan = model.LinkMan;
                logistics.Phone = model.Phone;
                logistics.BankAccount = model.BankAccount;
                logistics.CreditRating = model.CreditRating;
                logistics.LicensePlate = model.LicensePlate;
                logistics.Type = model.Type;
                logistics.Demo = model.Demo;
                logistics.UpdateUser = userId;
                logistics.UpdateTime = DateTime.Now;
                var num = LogisticsInfoRst.Edit(logistics);
                return num > 0;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            logistics.CarrierName = model.CarrierName;
            logistics.Address = model.Address;
            logistics.LinkMan = model.LinkMan;
            logistics.Phone = model.Phone;
            logistics.BankAccount = model.BankAccount;
            logistics.CreditRating = model.CreditRating;
            logistics.LicensePlate = model.LicensePlate;
            logistics.Type = model.Type;
            logistics.Demo = model.Demo;
            logistics.UpdateUser = userId;
            logistics.UpdateTime = DateTime.Now;
            var num = await LogisticsInfoRst.EditAsync(logistics);
            return num > 0;
        }
        public bool DelLogisticsInfo(int id, int userId)
        public async Task<bool> DelLogisticsInfo(int id, int userId)
        {
            try
            {
                var num = LogisticsInfoRst.Remove(id, userId);
                return num > 0;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var num = await LogisticsInfoRst.RemoveAsync(id, userId);
            return num > 0;
        }
        public bool DelsLogisticsInfo(List<int> ids, int userId)
        public async Task<bool> DelsLogisticsInfo(List<int> ids, int userId)
        {
            try
            var list = await LogisticsInfoRst.GetAllWhere(m => ids.Contains(m.Id)).ToListAsync();
            for (int i = 0; i < list.Count; i++)
            {
                var list = LogisticsInfoRst.GetAllWhereAsync(m => ids.Contains(m.Id)).ToList();
                for (int i = 0; i < list.Count; i++)
                {
                    _operation.InsertOperation("基础信息", "物流管理", list[i].CarrierName, "删除", "删除物流信息 公司名称:" + list[i].CarrierName, Convert.ToInt32(userId));
                }
                var num = LogisticsInfoRst.RemoveAll(list, userId);
                return num > 0;
                await _operation.InsertOperation("基础信息", "物流管理", list[i].CarrierName, "删除", "删除物流信息 公司名称:" + list[i].CarrierName, Convert.ToInt32(userId));
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var num = LogisticsInfoRst.RemoveAll(list, userId);
            return num > 0;
        }
    }
}
Wms/WMS.BLL/SysServer/PackagServer.cs
@@ -39,7 +39,7 @@
                    .AndIF(level != null, it => it.Level.Equals(level))
                    .ToExpression();//注意 这一句 不能少
                var data = PackagRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = PackagRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.CreateUserInfo)
                    .Includes(x => x.UpdateUserInfo).ToList();
                count = counts;
@@ -98,13 +98,13 @@
        {
            try
            {
                var rowCount = PackagRst.GetAllWhereAsync(m => m.PackagNo == model.PackagNo).Count();
                var rowCount = PackagRst.GetAllWhere(m => m.PackagNo == model.PackagNo).Count();
                if (rowCount > 0)
                {
                    throw new Exception("包装编号已存在!");
                }
                rowCount = PackagRst.GetAllWhereAsync(m => m.PackagName == model.PackagName).Count();
                rowCount = PackagRst.GetAllWhere(m => m.PackagName == model.PackagName).Count();
                if (rowCount > 0)
                {
                    throw new Exception("包装名称已存在!");
@@ -202,7 +202,7 @@
            {
                if (string.IsNullOrEmpty(model.PackagName))
                {
                    var date = PackagRst.GetAllWhereAsync(m => m.Id != model.Id && (m.PackagName == model.PackagName)).Count();
                    var date = PackagRst.GetAllWhere(m => m.Id != model.Id && (m.PackagName == model.PackagName)).Count();
                    if (date > 0)
                    {
                        throw new Exception("包装名称已存在!");
Wms/WMS.BLL/SysServer/PalletsServer.cs
@@ -46,7 +46,7 @@
                    .ToExpression();//注意 这一句 不能少
                var data = PalletsRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = PalletsRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.CreateUserInfo)
                    .ToList();
                count = counts;
@@ -77,12 +77,12 @@
                if (!string.IsNullOrWhiteSpace(palletNo))
                {
                    var code = PalletsRst.GetAllWhereAsync(m => m.PalletNo == palletNo).First();
                    var code = PalletsRst.GetAllWhere(m => m.PalletNo == palletNo).First();
                    return code.PalletNo;
                }
                else
                {
                    var code = PalletsRst.GetAllAsync().OrderByDescending(m => m.PalletNo).First();
                    var code = PalletsRst.GetAll().OrderByDescending(m => m.PalletNo).First();
                    if (code != null)
                    {
Wms/WMS.BLL/SysServer/StorageAreaServer.cs
@@ -49,7 +49,7 @@
                    .ToExpression();//注意 这一句 不能少
                var data = AreaRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = AreaRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.WareHouseInfo)
                    .Includes(x => x.TemperatureInfo)
                    .Includes(x => x.CreateUserInfo)
@@ -125,7 +125,7 @@
        {
            try
            {
                var data = AreaRst.GetAllAsync().ToList();
                var data = AreaRst.GetAll().ToList();
                if (!string.IsNullOrWhiteSpace(wareHouseNo))
                {
                    data = data.Where(m => m.WareHouseNo == wareHouseNo).ToList();
@@ -225,7 +225,7 @@
            try
            {
                //判断除当前id信息以外是否含有编号和名称
                var bol = AreaRst.GetAllAsync()
                var bol = AreaRst.GetAll()
                    .Any(m => m.Id != id && m.AreaName == name.Trim());
                if (bol)
                {
Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -59,7 +59,7 @@
                    .ToExpression();//注意 这一句 不能少
                var data = LocatRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                var data = LocatRst.GetAllByOrderPage(item, limit, page, out int counts)
                    .Includes(x => x.WareHouseInfo)
                    .Includes(x => x.AreaInfo)
                    .Includes(x => x.RoadwayInfo)
Wms/WMS.BLL/SysServer/StorageRoadwayServer.cs
@@ -42,7 +42,7 @@
                   .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type)
                   .ToExpression();//注意 这一句 不能少
                var data = RoadwayRst.GetAllByOrderPageAsync(item, limit, page,out int counts)
                var data = RoadwayRst.GetAllByOrderPage(item, limit, page,out int counts)
                    .Includes(x => x.WareHouseInfo)
                    .Includes(x => x.TemperatureInfo)
                    .Includes(x => x.CreateUserInfo)
@@ -99,7 +99,7 @@
        {
            try
            {
                var data = RoadwayRst.GetAllAsync().ToList();
                var data = RoadwayRst.GetAll().ToList();
                if (!string.IsNullOrWhiteSpace(wareHouseNo))
                {
                    data = data.Where(m => m.WareHouseNo == wareHouseNo).ToList();
@@ -137,7 +137,7 @@
                    throw new Exception("为查询到当前巷道信息");
                }
                //判断除当前id信息以外是否含有编号和名称
                var bol = RoadwayRst.GetAllAsync().Any(m => m.Id != id && m.RoadwayNo== roadway.RoadwayNo && m.RoadwayName == roadwayName.Trim());
                var bol = RoadwayRst.GetAll().Any(m => m.Id != id && m.RoadwayNo== roadway.RoadwayNo && m.RoadwayName == roadwayName.Trim());
                if (bol)
                {
                    throw new Exception("当前巷道号或巷道名称已存在");
Wms/WMS.BLL/SysServer/UnitServer.cs
@@ -33,55 +33,39 @@
        /// <param name="limit"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public List<UnitDto> GetUnitList(string unitNo, string unitName, int page, int limit, out int count)
        public async Task<List<UnitDto>> GetUnitList(string unitNo, string unitName, int page, int limit, RefAsync<int> count)
        {
            try
            Expression<Func<SysUnit, bool>> item = Expressionable.Create<SysUnit>() //创建表达式
                .AndIF(!string.IsNullOrWhiteSpace(unitNo), it => it.UnitNo.Contains(unitNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(unitName), it => it.UnitName.Contains(unitName.Trim()))
                .ToExpression();//注意 这一句 不能少
            var data = await UnitRst.GetAllByOrderPage(item, limit, page, out int counts)
                .Includes(x => x.CreateUserInfo)
                .Includes(x => x.UpdateUserInfo).ToListAsync();
            count = counts;
            return data.Select(m => new UnitDto()
            {
                Expression<Func<SysUnit, bool>> item = Expressionable.Create<SysUnit>() //创建表达式
                    .AndIF(!string.IsNullOrWhiteSpace(unitNo), it => it.UnitNo.Contains(unitNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(unitName), it => it.UnitName.Contains(unitName.Trim()))
                    .ToExpression();//注意 这一句 不能少
                var data = UnitRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
                    .Includes(x => x.CreateUserInfo)
                    .Includes(x => x.UpdateUserInfo).ToList();
                count = counts;
                return data.Select(m => new UnitDto()
                {
                    Id = m.Id,
                    UnitNo = m.UnitNo,
                    UnitName = m.UnitName,
                    Abbrev = m.Abbrev,
                    CreateTime = m.CreateTime,
                    CreateUserName = m.CreateUserInfo == null ? "" : m.CreateUserInfo.RealName,
                    UpdateTime = m.UpdateTime,
                    UpdateUserName = m.UpdateUserInfo == null ? "" : m.UpdateUserInfo.RealName
                }).ToList();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
                Id = m.Id,
                UnitNo = m.UnitNo,
                UnitName = m.UnitName,
                Abbrev = m.Abbrev,
                CreateTime = m.CreateTime,
                CreateUserName = m.CreateUserInfo == null ? "" : m.CreateUserInfo.RealName,
                UpdateTime = m.UpdateTime,
                UpdateUserName = m.UpdateUserInfo == null ? "" : m.UpdateUserInfo.RealName
            }).ToList();
        }
        /// <summary>
        /// 获取单条单位信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public SysUnit GetUnit(int id)
        public async Task<SysUnit> GetUnit(int id)
        {
            try
            {
                var data = UnitRst.GetOneById(id);
                return data;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            var data = await UnitRst.GetOneByIdAsync(id);
            return data;
        }
        /// <summary>
        /// 添加单位信息
@@ -90,13 +74,13 @@
        /// <param name="abbrev">缩写</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        public bool AddUnit(string unitName, string abbrev, int userId)
        public async Task<bool> AddUnit(string unitName, string abbrev, int userId)
        {
            try
            {
                if (string.IsNullOrEmpty(abbrev))
                {
                    var date = UnitRst.GetAllWhereAsync(m => m.UnitName == unitName).Count();
                    var date = await UnitRst.GetAllWhere(m => m.UnitName == unitName).CountAsync();
                    if (date > 0)
                    {
                        throw new Exception("单位名称重复");
@@ -104,7 +88,7 @@
                }
                else
                {
                    var date = UnitRst.GetAllWhereAsync(m => m.UnitName == unitName || m.Abbrev == abbrev).Count();
                    var date = await UnitRst.GetAllWhere(m => m.UnitName == unitName || m.Abbrev == abbrev).CountAsync();
                    if (date > 0)
                    {
                        throw new Exception("单位名称或英文缩写重复");
@@ -112,9 +96,9 @@
                }
                //自动UnitCode处理
                var unitList = UnitRst.GetAllAsync().OrderByDescending(m => m.UnitNo);
                var unitList = UnitRst.GetAll().OrderByDescending(m => m.UnitNo);
                var code = "01";
                if (unitList != null && unitList.Count()>0)
                if (unitList != null && unitList.Count() > 0)
                {
                    var unitCode = unitList.First().UnitNo;
                    var str = unitCode.Substring(0, 1);
@@ -122,7 +106,7 @@
                    code = str == "0" ? (str2 == "9" ? (int.Parse(str2) + 1).ToString() : "0" + (int.Parse(str2) + 1)) : (int.Parse(unitCode) + 1).ToString();
                }
                var num = UnitRst.Add(new SysUnit()
                var num = await UnitRst.AddAsync(new SysUnit()
                {
                    UnitNo = code,
                    UnitName = unitName,
@@ -131,7 +115,7 @@
                });
                if (num > 0)
                {
                    _operation.InsertOperation("基础信息", "计量单位", code, "添加", "添加计量单位 单位号:" + code, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "计量单位", code, "添加", "添加计量单位 单位号:" + code, Convert.ToInt32(userId));
                }
                return num > 0;
            }
@@ -148,83 +132,69 @@
        /// <param name="abbrev">缩写</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        public bool EditUnit(int id, string unitName, string abbrev, int userId)
        public async Task<bool> EditUnit(int id, string unitName, string abbrev, int userId)
        {
            try
            if (string.IsNullOrEmpty(abbrev))
            {
                if (string.IsNullOrEmpty(abbrev))
                var date = await UnitRst.GetAllWhere(m => m.Id != id && m.UnitName == unitName).CountAsync();
                if (date > 0)
                {
                    var date = UnitRst.GetAllWhereAsync(m => m.Id != id && m.UnitName == unitName).Count();
                    if (date > 0)
                    {
                        throw new Exception("单位名称重复");
                    }
                    throw new Exception("单位名称重复");
                }
                else
                {
                    var date = UnitRst.GetAllWhereAsync(m => m.Id != id && (m.UnitName == unitName || m.Abbrev == abbrev)).Count();
                    if (date > 0)
                    {
                        throw new Exception("单位名称或英文缩写重复");
                    }
                }
                //自动UnitCode处理
                var unit = UnitRst.GetOneById(id);
                if (unit == null)
                {
                    throw new Exception("未查询到单位信息");
                }
                unit.UnitName = unitName;
                unit.Abbrev = abbrev;
                unit.UpdateUser = userId;
                unit.UpdateTime = DateTime.Now;
                var num = UnitRst.Edit(unit);
                return num > 0;
            }
            catch (Exception e)
            else
            {
                throw new Exception(e.Message);
                var date = await UnitRst.GetAllWhere(m => m.Id != id && (m.UnitName == unitName || m.Abbrev == abbrev)).CountAsync();
                if (date > 0)
                {
                    throw new Exception("单位名称或英文缩写重复");
                }
            }
            //自动UnitCode处理
            var unit = UnitRst.GetOneById(id);
            if (unit == null)
            {
                throw new Exception("未查询到单位信息");
            }
            unit.UnitName = unitName;
            unit.Abbrev = abbrev;
            unit.UpdateUser = userId;
            unit.UpdateTime = DateTime.Now;
            var num = await UnitRst.EditAsync(unit);
            return num > 0;
        }
        public bool DelUnit(int id, int userId)
        public async Task<bool> DelUnit(int id, int userId)
        {
            try
            var unit = UnitRst.GetOneById(id);
            if (unit == null)
            {
                var unit = UnitRst.GetOneById(id);
                if (unit == null)
                {
                    throw new Exception("未查询到单位信息");
                }
                int num = UnitRst.Remove(id, userId);
                if (num > 0)
                {
                    _operation.InsertOperation("基础信息", "计量单位", unit.UnitNo, "删除", "删除计量单位 单位号:" + unit.UnitNo, Convert.ToInt32(userId));
                }
                throw new Exception("未查询到单位信息");
            }
            int num = await UnitRst.RemoveAsync(id, userId);
            if (num > 0)
            {
                await _operation.InsertOperation("基础信息", "计量单位", unit.UnitNo, "删除", "删除计量单位 单位号:" + unit.UnitNo, Convert.ToInt32(userId));
            }
                return num > 0;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            return num > 0;
        }
        public bool DelsUnit(List<int> ids, int userId)
        public async Task<bool> DelsUnit(List<int> ids, int userId)
        {
            try
            {
                var list = UnitRst.GetAllWhereAsync(m => ids.Contains(m.Id)).ToList();
                var list = await UnitRst.GetAllWhere(m => ids.Contains(m.Id)).ToListAsync();
                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        _operation.InsertOperation("基础信息", "计量单位", list[i].UnitNo, "删除", "删除计量单位 单位号:" + list[i].UnitNo, Convert.ToInt32(userId));
                        await _operation.InsertOperation("基础信息", "计量单位", list[i].UnitNo, "删除", "删除计量单位 单位号:" + list[i].UnitNo, Convert.ToInt32(userId));
                    }
                }
                var num = UnitRst.RemoveAll(list, userId);
                var num = await UnitRst.RemoveAllAsync(list, userId);
                return num > 0;
            }
            catch (Exception e)
Wms/WMS.BLL/SysServer/WareHouseServer.cs
@@ -42,7 +42,7 @@
                    .ToExpression();//注意 这一句 不能少
                
                var data = WareHouseRst.GetAllByOrderPageAsync(item, limit, page,out int counts)
                var data = WareHouseRst.GetAllByOrderPage(item, limit, page,out int counts)
                    .Includes(x => x.TypeInfo)
                    .Includes(x => x.TemperatureInfo)
                    .Includes(x => x.CreateUserInfo)
@@ -108,7 +108,7 @@
            try
            {
                //判断除当前id信息以外是否含有编号和名称
                var bol = await WareHouseRst.GetAllAsync()
                var bol = await WareHouseRst.GetAll()
                    .AnyAsync(m => m.Id != id && (m.WareHouseNo == no.Trim() || m.WareHouseName == name.Trim()));
                if (bol)
                {
@@ -155,7 +155,7 @@
        {
            try
            {
                var list = await WareHouseRst.GetAllAsync().ToListAsync();
                var list = await WareHouseRst.GetAll().ToListAsync();
                return list;
            }
            catch (Exception e)
Wms/WMS.DAL/BaseRepository.cs
@@ -120,37 +120,41 @@
            return model.FirstOrDefault();
        }
        
        public SqlSugar.ISugarQueryable<T> GetAllAsync()
        public SqlSugar.ISugarQueryable<T> GetAll()
        {
            var data =_db.Queryable<T>().Where(m=>m.IsDel =="0");
            return data;
        }
        public SqlSugar.ISugarQueryable<T> GetAllWhereAsync(System.Linq.Expressions.Expression<Func<T, bool>> predicate)
        public async Task<List<T>> GetAllAsync()
        {
            var data = GetAllAsync().Where(predicate);
            return await _db.Queryable<T>().Where(m => m.IsDel == "0").ToListAsync();
        }
        public SqlSugar.ISugarQueryable<T> GetAllWhere(System.Linq.Expressions.Expression<Func<T, bool>> predicate)
        {
            var data = GetAll().Where(predicate);
            return data;
        }
        public SqlSugar.ISugarQueryable<T> GetAllByOrderAsync(System.Linq.Expressions.Expression<Func<T, bool>> predicate, bool asc = true)
        public SqlSugar.ISugarQueryable<T> GetAllByOrder(System.Linq.Expressions.Expression<Func<T, bool>> predicate, bool asc = true)
        {
            var type = OrderByType.Asc;
            if (!asc)
            {
                type = OrderByType.Desc;
            }
            var data = GetAllWhereAsync(predicate).OrderBy(m => m.CreateTime, type);
            var data = GetAllWhere(predicate).OrderBy(m => m.CreateTime, type);
            return data;
        }
        public SqlSugar.ISugarQueryable<T> GeTAllByPageAsync(System.Linq.Expressions.Expression<Func<T, bool>> predicate, int pageSize, int pageIndex,out int count )
        public SqlSugar.ISugarQueryable<T> GeTAllByPage(System.Linq.Expressions.Expression<Func<T, bool>> predicate, int pageSize, int pageIndex,out int count )
        {
            var list = GetAllWhereAsync(predicate);
            var list = GetAllWhere(predicate);
            count = list.Count();
            var data = list.Skip(pageSize * (pageIndex - 1)).Take(pageSize);
            return data;
        }
        public SqlSugar.ISugarQueryable<T> GetAllByOrderPageAsync(System.Linq.Expressions.Expression<Func<T, bool>> predicate, int pageSize, int pageIndex, out int count , bool asc = true)
        public SqlSugar.ISugarQueryable<T> GetAllByOrderPage(System.Linq.Expressions.Expression<Func<T, bool>> predicate, int pageSize, int pageIndex, out int count , bool asc = true)
        {
            var list = GetAllByOrderAsync(predicate, asc);
            var list = GetAllByOrder(predicate, asc);
            count = list.Count();
            var data = list.Skip(pageSize * (pageIndex-1)).Take(pageSize);
Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs
@@ -133,7 +133,7 @@
        {
            try
            {
                var locateList = GetAllWhereAsync(m => id.Contains(m.Id)).ToList();
                var locateList = GetAllWhere(m => id.Contains(m.Id)).ToList();
                if (locateList.Count == 0)
                {
                    throw new Exception($"为查询到id为{id}的储位信息");
Wms/WMS.IBLL/ISysServer/ICustomerServer.cs
@@ -1,4 +1,5 @@
using Model.ModelDto.SysDto;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
@@ -21,19 +22,19 @@
        /// <param name="limit"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        List<CustomerDto> GetCustomerList(string no, string name,int? type,string linkMan,string phone ,int page,int limit,out int count);
        Task<List<CustomerDto>> GetCustomerList(string no, string name,int? type,string linkMan,string phone ,int page,int limit,RefAsync<int> count);
        /// <summary>
        /// 查询单条客户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        SysCustomer GetCustomer(int id);
        Task<SysCustomer> GetCustomer(int id);
        /// <summary>
        /// 查询全部客户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<SysCustomer> GetCustomerSelect();
        Task<List<SysCustomer>> GetCustomerSelect();
        /// <summary>
        /// 添加客户信息
        /// </summary>
@@ -47,7 +48,7 @@
        /// <param name="creditRating">信用等级</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool AddCustomer(string no,string name, int type,string address, string linkMan, string phone,string bankAccount,string creditRating, string demo,int userId);
        Task<bool> AddCustomer(string no,string name, int type,string address, string linkMan, string phone,string bankAccount,string creditRating, string demo,int userId);
        /// <summary>
        /// 编辑客户信息
@@ -63,20 +64,20 @@
        /// <param name="creditRating">信用等级</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool EditCustomer(int id,string no,string name, int type, string address, string linkMan, string phone, string bankAccount, string creditRating, string demo, int userId);
        Task<bool> EditCustomer(int id,string no,string name, int type, string address, string linkMan, string phone, string bankAccount, string creditRating, string demo, int userId);
        /// <summary>
        /// 删除单条客户信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool DelCustomer(int id,int userId);
        Task<bool> DelCustomer(int id,int userId);
        /// <summary>
        /// 删除单条客户信息
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool DelsCustomer(List<int> ids, int userId);
        Task<bool> DelsCustomer(List<int> ids, int userId);
    }
}
Wms/WMS.IBLL/ISysServer/ILogisticsInfoServer.cs
@@ -1,5 +1,6 @@
using Model.ModelDto.SysDto;
using Model.ModelVm.SysVm;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
@@ -22,39 +23,39 @@
        /// <param name="limit"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        List<LogisticsInfoDto> GetLogisticsInfoList(string name,string linkMan,string phone,string licensePlate,string type,int page,int limit,out int count);
        Task<List<LogisticsInfoDto>> GetLogisticsInfoList(string name, string linkMan, string phone, string licensePlate, string type, int page, int limit, RefAsync<int> count);
        /// <summary>
        /// 查询单条物流信息
        /// </summary>
        /// <param name="id"></param> 
        /// <returns></returns>
        SysLogisticsInfo GetLogisticsInfo(int id);
        Task<SysLogisticsInfo> GetLogisticsInfo(int id);
        /// <summary>
        /// 查询全部物流信息
        /// </summary> 
        /// <returns></returns>
        List<SysLogisticsInfo> GetLogisticsInfoSelect();
        Task<List<SysLogisticsInfo>> GetLogisticsInfoSelect();
        /// <summary>
        /// 添加物流信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool AddLogisticsInfo(AddLogisticsInfoVm model, int userId);
        Task<bool> AddLogisticsInfo(AddLogisticsInfoVm model, int userId);
        /// <summary>
        /// 编辑物流信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool EditLogisticsInfo(EditLogisticsInfoVm model, int userId);
        Task<bool> EditLogisticsInfo(EditLogisticsInfoVm model, int userId);
        /// <summary>
        /// 删除单条物流信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool DelLogisticsInfo(int id,int userId);
        Task<bool> DelLogisticsInfo(int id, int userId);
        /// <summary>
        /// 删除物流信息(多条信息)
@@ -62,6 +63,6 @@
        /// <param name="ids"></param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool DelsLogisticsInfo(List<int> ids,int userId);
        Task<bool> DelsLogisticsInfo(List<int> ids, int userId);
    }
}
Wms/WMS.IBLL/ISysServer/IUnitServer.cs
@@ -3,6 +3,7 @@
using System.Text;
using System.Threading.Tasks;
using Model.ModelDto.SysDto;
using SqlSugar;
using WMS.Entity.SysEntity;
namespace WMS.IBLL.ISysServer
@@ -18,13 +19,13 @@
        /// <param name="limit"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        List<UnitDto> GetUnitList(string unitNo,string unitName,int page,int limit,out int count);
        Task<List<UnitDto>> GetUnitList(string unitNo,string unitName,int page,int limit, RefAsync<int> count);
        /// <summary>
        /// 获取单条单位信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        SysUnit GetUnit(int id);
        Task<SysUnit> GetUnit(int id);
        /// <summary>
        /// 添加单位信息
        /// </summary>
@@ -32,7 +33,7 @@
        /// <param name="abbrev">缩写</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool AddUnit(string unitName,string abbrev,int userId);
        Task<bool> AddUnit(string unitName,string abbrev,int userId);
        /// <summary>
        /// 编辑单位信息
        /// </summary>
@@ -41,20 +42,20 @@
        /// <param name="abbrev">缩写</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool EditUnit(int id, string unitName, string abbrev, int userId);
        Task<bool> EditUnit(int id, string unitName, string abbrev, int userId);
        /// <summary>
        /// 删除单位信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool DelUnit(int id,int userId);
        Task<bool> DelUnit(int id,int userId);
        /// <summary>
        /// 删除单位信息(多删除)
        /// </summary>
        /// <param name="ids">id集合</param>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool DelsUnit(List<int> ids, int userId);
        Task<bool> DelsUnit(List<int> ids, int userId);
    }
}
Wms/WMS.IDAL/IBaseRepository.cs
@@ -28,8 +28,8 @@
        Task SaveAsync();
        ISugarQueryable<T> GetAllAsync();
        ISugarQueryable<T> GetAll();
        Task<List<T>> GetAllAsync();
        T GetOneById(int id);
        Task<T> GetOneByIdAsync(int id);
@@ -37,9 +37,9 @@
        T GetModel(string sqlString);
        
        ISugarQueryable<T> GetAllWhereAsync(Expression<Func<T, bool>> predicate);
        ISugarQueryable<T> GeTAllByPageAsync(Expression<Func<T, bool>> predicate,int pageSize,int pageIndex, out int count);
        ISugarQueryable<T> GetAllByOrderAsync(Expression<Func<T, bool>> predicate, bool asc = true);
        ISugarQueryable<T> GetAllByOrderPageAsync(Expression<Func<T, bool>> predicate, int pageSize , int pageIndex , out int count,bool asc = true);
        ISugarQueryable<T> GetAllWhere(Expression<Func<T, bool>> predicate);
        ISugarQueryable<T> GeTAllByPage(Expression<Func<T, bool>> predicate,int pageSize,int pageIndex, out int count);
        ISugarQueryable<T> GetAllByOrder(Expression<Func<T, bool>> predicate, bool asc = true);
        ISugarQueryable<T> GetAllByOrderPage(Expression<Func<T, bool>> predicate, int pageSize , int pageIndex , out int count,bool asc = true);
    }
}
Wms/Wms/Controllers/BasisController.cs
@@ -926,11 +926,12 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetCustomerList(GetCustomerVm model)
        public async Task<IActionResult> GetCustomerList(GetCustomerVm model)
        {
            try
            {
                var bolls = _customerSvc.GetCustomerList(model.CustomerNo, model.CustomerName, model.Type, model.LinkMan, model.Phone, model.Page, model.Limit, out int count);
                RefAsync<int> count = new RefAsync<int>();
                var bolls = await _customerSvc.GetCustomerList(model.CustomerNo, model.CustomerName, model.Type, model.LinkMan, model.Phone, model.Page, model.Limit, count);
                return Ok(new { code = 0, count, msg = "客户信息", data = bolls });
            }
@@ -945,11 +946,11 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetCustomer(IdVm model)
        public async Task<IActionResult> GetCustomer(IdVm model)
        {
            try
            {
                var bolls = _customerSvc.GetCustomer(model.Id);
                var bolls = await _customerSvc.GetCustomer(model.Id);
                return Ok(new { code = 0, count = 0, msg = "客户信息", data = bolls });
            }
@@ -963,11 +964,11 @@
        /// </summary> 
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetCustomerSelect()
        public async Task<IActionResult> GetCustomerSelect()
        {
            try
            {
                var bolls = _customerSvc.GetCustomerSelect();
                var bolls = await _customerSvc.GetCustomerSelect();
                return Ok(new { code = 0, count = 0, msg = "客户信息", data = bolls });
            }
@@ -982,7 +983,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddCustomer(AddCustomerVm model)
        public async Task<IActionResult> AddCustomer(AddCustomerVm model)
        {
            try
            {
@@ -998,11 +999,11 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _customerSvc.AddCustomer(model.CustomerNo, model.CustomerName, model.Type, model.Address, model.LinkMan, model.Phone, model.BankAccount, model.CreditRating, model.Demo, int.Parse(userId));
                var bolls = await _customerSvc.AddCustomer(model.CustomerNo, model.CustomerName, model.Type, model.Address, model.LinkMan, model.Phone, model.BankAccount, model.CreditRating, model.Demo, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "客户管理", model.CustomerNo, "添加", "添加客户信息 客户号:" + model.CustomerNo, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "客户管理", model.CustomerNo, "添加", "添加客户信息 客户号:" + model.CustomerNo, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "添加成功" });
                }
                else
@@ -1021,7 +1022,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditCustomer(EditCustomerVm model)
        public async Task<IActionResult> EditCustomer(EditCustomerVm model)
        {
            try
            {
@@ -1037,11 +1038,11 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _customerSvc.EditCustomer(model.Id, model.CustomerNo, model.CustomerName, model.Type, model.Address, model.LinkMan, model.Phone, model.BankAccount, model.CreditRating, model.Demo, int.Parse(userId));
                var bolls = await _customerSvc.EditCustomer(model.Id, model.CustomerNo, model.CustomerName, model.Type, model.Address, model.LinkMan, model.Phone, model.BankAccount, model.CreditRating, model.Demo, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "客户管理", model.CustomerNo, "编辑", "编辑客户信息 客户号:" + model.CustomerNo, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "客户管理", model.CustomerNo, "编辑", "编辑客户信息 客户号:" + model.CustomerNo, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "编辑成功" });
                }
                else
@@ -1060,11 +1061,11 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelCustomer(IdVm model)
        public async Task<IActionResult> DelCustomer(IdVm model)
        {
            try
            {
                SysCustomer customer = _customerSvc.GetCustomer(model.Id);
                SysCustomer customer = await _customerSvc.GetCustomer(model.Id);
                //获取当前登录的用户ID
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
@@ -1077,10 +1078,10 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _customerSvc.DelCustomer(model.Id, int.Parse(userId));
                var bolls = await _customerSvc.DelCustomer(model.Id, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "客户管理", customer.CustomerNo, "删除", "删除客户信息 客户号:" + customer.CustomerNo, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "客户管理", customer.CustomerNo, "删除", "删除客户信息 客户号:" + customer.CustomerNo, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
@@ -1099,7 +1100,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsCustomer(IdVm model)
        public async Task<IActionResult> DelsCustomer(IdVm model)
        {
            try
            {
@@ -1115,7 +1116,7 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _customerSvc.DelsCustomer(model.Ids, int.Parse(userId));
                var bolls = await _customerSvc.DelsCustomer(model.Ids, int.Parse(userId));
                if (bolls)
                {
                    return Ok(new { code = 0, msg = "删除成功" });
@@ -1139,11 +1140,12 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetLogisticsInfoList(GetLogisticsInfoVm model)
        public async Task<IActionResult> GetLogisticsInfoList(GetLogisticsInfoVm model)
        {
            try
            {
                var bolls = _logisticsSvc.GetLogisticsInfoList(model.CarrierName, model.LinkMan, model.Phone, model.LicensePlate, model.Type, model.Page, model.Limit, out int count);
                RefAsync<int> count = new RefAsync<int>();
                var bolls = await _logisticsSvc.GetLogisticsInfoList(model.CarrierName, model.LinkMan, model.Phone, model.LicensePlate, model.Type, model.Page, model.Limit, count);
                return Ok(new { code = 0, count, msg = "物流信息", data = bolls });
            }
@@ -1158,11 +1160,11 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetLogisticsInfo(IdVm model)
        public async Task<IActionResult> GetLogisticsInfo(IdVm model)
        {
            try
            {
                var bolls = _logisticsSvc.GetLogisticsInfo(model.Id);
                var bolls = await _logisticsSvc.GetLogisticsInfo(model.Id);
                return Ok(new { code = 0, data = bolls });
            }
@@ -1176,11 +1178,11 @@
        /// </summary> 
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetLogisticsInfoSelect()
        public async Task<IActionResult> GetLogisticsInfoSelect()
        {
            try
            {
                var bolls = _logisticsSvc.GetLogisticsInfoSelect();
                var bolls = await _logisticsSvc.GetLogisticsInfoSelect();
                return Ok(new { code = 0, data = bolls });
            }
@@ -1196,7 +1198,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddLogisticsInfo(AddLogisticsInfoVm model)
        public async Task<IActionResult> AddLogisticsInfo(AddLogisticsInfoVm model)
        {
            try
            {
@@ -1212,11 +1214,11 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _logisticsSvc.AddLogisticsInfo(model, int.Parse(userId));
                var bolls = await _logisticsSvc.AddLogisticsInfo(model, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "物流管理", model.CarrierName, "添加", "添加物流信息 公司名称:" + model.CarrierName, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "物流管理", model.CarrierName, "添加", "添加物流信息 公司名称:" + model.CarrierName, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "添加成功" });
                }
                else
@@ -1235,7 +1237,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditLogisticsInfo(EditLogisticsInfoVm model)
        public async Task<IActionResult> EditLogisticsInfo(EditLogisticsInfoVm model)
        {
            try
            {
@@ -1251,11 +1253,11 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _logisticsSvc.EditLogisticsInfo(model, int.Parse(userId));
                var bolls = await _logisticsSvc.EditLogisticsInfo(model, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "物流管理", model.CarrierName, "编辑", "编辑物流信息 公司名称:" + model.CarrierName, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "物流管理", model.CarrierName, "编辑", "编辑物流信息 公司名称:" + model.CarrierName, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "编辑成功" });
                }
                else
@@ -1274,11 +1276,11 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelLogisticsInfo(IdVm model)
        public async Task<IActionResult> DelLogisticsInfo(IdVm model)
        {
            try
            {
                SysLogisticsInfo logisit = _logisticsSvc.GetLogisticsInfo(model.Id);
                SysLogisticsInfo logisit = await _logisticsSvc.GetLogisticsInfo(model.Id);
                //获取当前登录的用户ID
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
@@ -1291,11 +1293,11 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _logisticsSvc.DelLogisticsInfo(model.Id, int.Parse(userId));
                var bolls = await _logisticsSvc.DelLogisticsInfo(model.Id, int.Parse(userId));
                if (bolls)
                {
                    _operation.InsertOperation("基础信息", "物流管理", logisit.CarrierName, "删除", "删除物流信息 公司名称:" + logisit.CarrierName, Convert.ToInt32(userId));
                    await _operation.InsertOperation("基础信息", "物流管理", logisit.CarrierName, "删除", "删除物流信息 公司名称:" + logisit.CarrierName, Convert.ToInt32(userId));
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
@@ -1314,7 +1316,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsLogisticsInfo(IdVm model)
        public async Task<IActionResult> DelsLogisticsInfo(IdVm model)
        {
            try
            {
@@ -1330,7 +1332,7 @@
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _logisticsSvc.DelsLogisticsInfo(model.Ids, int.Parse(userId));
                var bolls = await _logisticsSvc.DelsLogisticsInfo(model.Ids, int.Parse(userId));
                if (bolls)
                {
                    return Ok(new { code = 0, msg = "删除成功" });
@@ -1355,11 +1357,12 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetUnitList(GetUnitVm model)
        public async Task<IActionResult> GetUnitList(GetUnitVm model)
        {
            try
            {
                var list = _unitSvc.GetUnitList(model.UnitNo, model.UnitName, model.Page, model.Limit, out int count);
                RefAsync<int> count = new RefAsync<int>();
                var list = await _unitSvc.GetUnitList(model.UnitNo, model.UnitName, model.Page, model.Limit, count);
                return Ok(new { code = 0, count, msg = "物流信息", data = list });
            }
@@ -1374,11 +1377,11 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetUnit(IdVm model)
        public async Task<IActionResult> GetUnit(IdVm model)
        {
            try
            {
                var data = _unitSvc.GetUnit(model.Id);
                var data = await _unitSvc.GetUnit(model.Id);
                if (data != null)
                {
                    return Ok(new { code = 0, data });
@@ -1399,7 +1402,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddUnit(AddEditUnitVm model)
        public async Task<IActionResult> AddUnit(AddEditUnitVm model)
        {
            if (ModelState.IsValid)
            {
@@ -1417,7 +1420,7 @@
                        return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                    }
                    var bolls = _unitSvc.AddUnit(model.UnitName, model.Abbrev, int.Parse(userId));
                    var bolls = await _unitSvc.AddUnit(model.UnitName, model.Abbrev, int.Parse(userId));
                    if (bolls)
                    {
@@ -1445,7 +1448,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditUnit(AddEditUnitVm model)
        public async Task<IActionResult> EditUnit(AddEditUnitVm model)
        {
            if (ModelState.IsValid)
            {
@@ -1463,12 +1466,12 @@
                        return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                    }
                    var bolls = _unitSvc.EditUnit(model.Id, model.UnitName, model.Abbrev, int.Parse(userId));
                    var bolls = await _unitSvc.EditUnit(model.Id, model.UnitName, model.Abbrev, int.Parse(userId));
                    if (bolls)
                    {
                        SysUnit unit = _unitSvc.GetUnit(model.Id);
                        _operation.InsertOperation("基础信息", "计量单位", unit.UnitNo, "编辑", "编辑计量单位 单位名称:" + unit.UnitNo, Convert.ToInt32(userId));
                        SysUnit unit = await _unitSvc.GetUnit(model.Id);
                        await _operation.InsertOperation("基础信息", "计量单位", unit.UnitNo, "编辑", "编辑计量单位 单位名称:" + unit.UnitNo, Convert.ToInt32(userId));
                        return Ok(new { code = 0, msg = "编辑成功" });
                    }
                    else
@@ -1493,7 +1496,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelUnit(IdVm model)
        public async Task<IActionResult> DelUnit(IdVm model)
        {
            try
            {
@@ -1508,7 +1511,7 @@
                {
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _unitSvc.DelUnit(model.Id, int.Parse(userId));
                var bolls = await _unitSvc.DelUnit(model.Id, int.Parse(userId));
                if (bolls)
                {
                    return Ok(new { code = 0, msg = "删除成功" });
@@ -1529,7 +1532,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsUnit(IdVm model)
        public async Task<IActionResult> DelsUnit(IdVm model)
        {
            try
            {
@@ -1544,7 +1547,7 @@
                {
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var bolls = _unitSvc.DelsUnit(model.Ids, int.Parse(userId));
                var bolls = await _unitSvc.DelsUnit(model.Ids, int.Parse(userId));
                if (bolls)
                {
                    return Ok(new { code = 0, msg = "删除成功" });