hwh
2024-07-04 2dd922eb3ab68c0314f5828fcae1ed7db0e17d9e
Wms/Wms/Controllers/BasisController.cs
@@ -20,6 +20,8 @@
using System.Security.Cryptography;
using System.Data;
using Model.ModelDto.LogDto;
using Utility;
using Model.ModelVm.LogVm;
namespace Wms.Controllers
{
@@ -44,6 +46,7 @@
        private readonly IFunSettingServer _setting; //功能设定
        private readonly IInterfaceServer _interface;//接口管理
        private readonly IOperationSysServer _operation; //操作日志
        private readonly UserManager _userManager;
        /// <summary>
        /// 构造函数
        /// </summary>
@@ -58,7 +61,7 @@
        /// <param name="department">部门</param>
        /// <param name="setting">功能设定</param>
        /// <param name="operation">操作日志</param>
        public BasisController(ICustomerServer customerSvc, ILogisticsInfoServer logisticsSvc, IUserInforServer userInforServer, IRolesServer rolesServer, IRoleRightServer roleRightServer, IRBACServer rBACServer, IUnitServer unitSvc, IPackagServer packagServer, IMaterialsServer mate, IDepartmentServer department, IFunSettingServer setting, IInterfaceServer interfaceS, IOperationSysServer operation)
        public BasisController(ICustomerServer customerSvc, ILogisticsInfoServer logisticsSvc, IUserInforServer userInforServer, IRolesServer rolesServer, IRoleRightServer roleRightServer, IRBACServer rBACServer, IUnitServer unitSvc, IPackagServer packagServer, IMaterialsServer mate, IDepartmentServer department, IFunSettingServer setting, IInterfaceServer interfaceS, IOperationSysServer operation, UserManager userManager)
        {
            _customerSvc = customerSvc;//客户Svc
            _logisticsSvc = logisticsSvc;//物流Svc
@@ -73,6 +76,7 @@
            _setting = setting; //功能设定
            _interface = interfaceS;//接口管理
            _operation = operation; //操作日志
            _userManager = userManager;
        }
        //基本信息管理
@@ -89,15 +93,10 @@
        /// <param name="Status">状态</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<UserInfoDto>> GetUserRoleList(string UserName, string DepartmentNo, string RoleNo, string Status)
        {
            List<UserInfoDto> userdtolist = _userInforServer.GetUserRoleList(UserName, DepartmentNo, RoleNo, Status);
            return Ok(new
            {
                data = userdtolist,
                code = 0,
                mes = "成功"
            });
            return await _userInforServer.GetUserRoleList(UserName, DepartmentNo, RoleNo, Status);
        }
        /// <summary>
@@ -106,15 +105,10 @@
        /// <param name="id">用户id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetUserinfoListById(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysUserInfor> GetUserinfoListById(int id)
        {
            SysUserInfor userinfo = _userInforServer.GetUserInfoById(id);
            return Ok(new
            {
                data = userinfo,
                code = 0,
                msg = "成功"
            });
            return await _userInforServer.GetUserInfoById(id);
        }
@@ -125,38 +119,19 @@
        /// <returns></returns>
        /// <exception cref="System.Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> InsertUserinfo(UserInfoDto UserInfoDto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task InsertUserinfo(UserInfoDto UserInfoDto)
        {
            //捕获异常
            try
            await _userInforServer.InsertUserInfo(UserInfoDto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                UserInfoDto.CreateUser = uid;
                int i = await _userInforServer.InsertUserInfo(UserInfoDto);
                //判断是否新增成功
                if (i == 0)
                {
                    return Ok(new { data = i, code = 1, msg = "新增失败" });
                }
                else if (i == 3)
                {
                    return Ok(new { data = i, code = 3, msg = "用户名或登录名重复" });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "用户管理", UserInfoDto.UserNo, "添加", "添加用户信息 用户号:" + UserInfoDto.UserNo, uid);
                    return Ok(new { data = i, code = 0, msg = "新增成功" });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("新增用户异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "用户管理",
                FkNo = UserInfoDto.UserNo,
                TypeName = "添加",
                Msg = "添加用户信息 用户号:" + UserInfoDto.UserNo
            });
        }
@@ -167,34 +142,21 @@
        /// <returns></returns>
        /// <exception cref="System.Exception">异常</exception>
        [HttpGet]
        public async Task<IActionResult> DeleteUserInfo(int userids)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DeleteUserInfo(int userids)
        {
            //异常
            try
            //获取用户信息
            SysUserInfor user = await _userInforServer.GetUserInfoById(userids);
            await _userInforServer.DeleteUserinfo(user);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取用户信息
                SysUserInfor user = _userInforServer.GetUserInfoById(userids);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                int i = await _userInforServer.DeleteUserinfo(user);
                //判断是否删除成功
                if (i == 0)
                {
                    return Ok(new { data = i, code = 1, msg = "删除失败" });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "用户管理", user.UserNo, "删除", "删除用户信息 用户号:" + user.UserNo, uid);
                    return Ok(new { data = i, code = 0, msg = "删除成功" });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("删除用户信息异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "用户管理",
                FkNo = user.UserNo,
                TypeName = "删除",
                Msg = "删除用户信息 用户号:" + user.UserNo
            });
        }
@@ -205,73 +167,25 @@
        /// <returns></returns>
        /// <exception cref="System.Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> UpdateUserinfo(UserInfoDto userdto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task UpdateUserinfo(UserInfoDto userdto)
        {
            //捕获异常
            try
            await _userInforServer.UpdateUserinfo(userdto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //userdto.UpdateUser = Convert.ToInt32(userId);
                //更改人
                userdto.UpdateUser = uid;
                //编辑用户信息
                int i = await _userInforServer.UpdateUserinfo(userdto);
                //判断是否编辑成功
                if (i == 0)
                {
                    return Ok(new { data = i, code = 1, msg = "编辑失败" });
                }
                else if (i == 3)
                {
                    return Ok(new { data = i, code = 1, msg = "用户名或登录名重复" });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "用户管理", userdto.UserNo, "修改", "修改用户信息 用户号:" + userdto.UserNo, uid);
                    return Ok(new { data = i, code = 0, msg = "编辑成功" });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("编辑用户信息异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "用户管理",
                FkNo = userdto.UserNo,
                TypeName = "编辑",
                Msg = "修改用户信息 用户号:" + userdto.UserNo
            });
        }
        #endregion
        #region 修改密码
        /// <summary>
        /// 修改密码 根据id获取用户原密码
        /// </summary>
        /// <param name="PassWord">用户原密码</param>
        /// <returns></returns>
        [HttpGet]
        public int GetUserUptPassById(string PassWord, int userId)
        {
            ////获取当前操作用户id
            //var claimsIdentity = this.User.Identity as ClaimsIdentity;
            //var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
            //int uid = Convert.ToInt32(userId);
            //根据用户id获取用户密码
            SysUserInfor user = _userInforServer.GetUserInfoById(userId);
            //判断原密码是否正确
            if (user.PassWord == PassWord)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
        ///// <param name="userId">用户id</param>
        /// <summary>
@@ -283,100 +197,32 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpGet]
        public async Task<IActionResult> UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo/*, int userId*/)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task UptUserPassWord(string pwdOld, string pwdNew, string pwdNewTwo/*, int userId*/)
        {
            //捕获异常
            try
            {
                pwdOld = Md5Tools.CalcMd5(pwdOld);
                pwdNew = Md5Tools.CalcMd5(pwdNew);
                pwdNewTwo = Md5Tools.CalcMd5(pwdNewTwo);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //判断原密码是否正确
                int a = GetUserUptPassById(pwdOld, uid);
                if (a == 1)
                {
                    //修改密码
                    int i = await _userInforServer.UptUserPassWord(pwdOld, pwdNew, pwdNewTwo, uid);
                    if (i == 0)
                    {
                        return Ok(new
                        {
                            data = i,
                            code = 1,
                            msg = "修改失败"
                        });
                    }
                    //判断两次新密码是否一致
                    else if (i == 3)
                    {
                        return Ok(new
                        {
                            data = i,
                            code = 0,
                            msg = "修改成功 请重新登录"
                        });
                    }
                    else
                    {
                        return Ok(new
                        {
                            data = i,
                            code = 0,
                            msg = "修改成功 请重新登录"
                        });
                    }
                }
                else
                {
                    //错误
                    return Ok(new
                    {
                        data = a,
                        code = 1,
                        msg = "原密码不正确"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("修改密码异常", ex);
            }
            pwdOld = Md5Tools.CalcMd5(pwdOld);
            pwdNew = Md5Tools.CalcMd5(pwdNew);
            pwdNewTwo = Md5Tools.CalcMd5(pwdNewTwo);
            //获取当前操作用户id
            SysUserInfor user = await _userInforServer.GetUserInfoById(_userManager.UserId);
            if (user == null)
                throw Oops.Bah("找不到用户信息");
            if (user.PassWord != pwdOld)
                throw Oops.Bah("原密码不正确");
            //修改密码
            int i = await _userInforServer.UptUserPassWord(pwdNew, _userManager.UserId);
            if (i <= 0)
                throw Oops.Bah("修改密码失败");
        }
        /// <summary>
        /// x天后提醒用户修改密码
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult IsPassWordTime()
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<int> IsPassWordTime()
        {
            //捕获异常
            try
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //判断原密码是否正确
                int a = _userInforServer.IsPassWordTime(uid);
                return Ok(new
                {
                    data = a,
                    code = 0,
                    msg = "修改失败"
                });
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("修改密码异常", ex);
            }
            return await _userInforServer.IsPassWordTime(_userManager.UserId);
        }
        #endregion
@@ -391,29 +237,10 @@
        /// <param name="RoleName">角色名称</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRolesList(string RoleNo, string RoleName)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<RoleDto>> GetRolesList(string RoleNo, string RoleName)
        {
            //获取当前操作用户id
            var claimsIdentity = this.User.Identity as ClaimsIdentity;
            if (claimsIdentity == null)
            {
                throw new Exception("未获取到用户信息");
            }
            string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
            if (string.IsNullOrWhiteSpace(UserId))
            {
                throw new Exception("未获取到用户信息");
            }
            //查询
            List<RoleDto> roles = _rolesServer.GetRoleList(RoleNo, RoleName, UserId);
            //返回数据
            return Ok(new
            {
                data = roles,
                code = 0,
                msg = "获取成功"
            });
            return await _rolesServer.GetRoleList(RoleNo, RoleName);
        }
        /// <summary>
@@ -422,15 +249,10 @@
        /// <param name="roleid">角色id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRolesListById(int roleid)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysRoles> GetRolesListById(int roleid)
        {
            SysRoles role = _rolesServer.GetRoleInfoById(roleid);
            return Ok(new
            {
                data = role,
                code = 0,
                msg = "获取成功"
            });
            return await _rolesServer.GetRoleInfoById(roleid);
        }
        /// <summary>
@@ -440,52 +262,19 @@
        /// <returns></returns>
        /// <exception cref="System.Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> InsertRoleInfo(RoleDto roledto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task InsertRoleInfo(RoleDto roledto)
        {
            //捕获异常
            try
            await _rolesServer.InsertRoleInfo(roledto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //创建人
                roledto.CreateUser = uid;
                int i = await _rolesServer.InsertRoleInfo(roledto);
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "新增失败"
                    });
                }
                else if (i == 3)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 3,
                        msg = "角色号必须唯一"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "角色权限", roledto.RoleNo, "添加", "添加角色信息 角色号:" + roledto.RoleNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "新增成功"
                    });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("角色新增异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "角色权限",
                FkNo = roledto.RoleNo,
                TypeName = "添加",
                Msg = "添加角色信息 角色号:" + roledto.RoleNo
            });
        }
        /// <summary>
@@ -495,45 +284,21 @@
        /// <returns></returns>
        /// <exception cref="System.Exception"></exception>
        [HttpGet]
        public async Task<IActionResult> DeleteRoleInfo(int roleids)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DeleteRoleInfo(int roleids)
        {
            //捕获异常
            try
            //根据角色id获取角色信息
            SysRoles role = await _rolesServer.GetRoleInfoById(roleids);
            await _rolesServer.DeleteRoleInfo(role);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //根据角色id获取角色信息
                SysRoles role = _rolesServer.GetRoleInfoById(roleids);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                role.UpdateUser = uid;
                int i = await _rolesServer.DeleteRoleInfo(role);
                //判断是否删除成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "删除失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "角色权限", role.RoleNo, "删除", "删除角色信息 角色号:" + role.RoleNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "删除成功"
                    });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("角色删除异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "角色权限",
                FkNo = role.RoleNo,
                TypeName = "删除",
                Msg = "删除角色信息 角色号:" + role.RoleNo
            });
        }
        /// <summary>
@@ -543,45 +308,19 @@
        /// <returns></returns>
        /// <exception cref="System.Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> UpdateRolesInfo(SysRoles role)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task UpdateRolesInfo(SysRoles role)
        {
            //捕获异常
            try
            await _rolesServer.UpdateRoleInfo(role);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                role.UpdateUser = uid;
                int i = await _rolesServer.UpdateRoleInfo(role);
                //判断是否编辑成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "编辑失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "角色权限", role.RoleNo, "修改", "修改角色信息 角色号:" + role.RoleNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "编辑成功"
                    });
                }
            }
            catch (System.Exception ex)
            {
                //抛出异常
                throw new System.Exception("编辑角色异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "角色权限",
                FkNo = role.RoleNo,
                TypeName = "编辑",
                Msg = "修改角色信息 角色号:" + role.RoleNo
            });
        }
        #endregion
@@ -593,16 +332,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRBACLists(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<FunctionMenuDto>> GetRBACLists(int id)
        {
            //List<RoleRightDto> roleright =
            var obj = _rBACServer.GetMenuByroleIdNew(id);
            return Ok(new
            {
                data = obj,
                code = 0,
                msg = "成功"
            });
            return await _rBACServer.GetMenuByroleIdNew(id);
        }
@@ -611,27 +344,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRoleRightRBAC(int id, string MenuNo)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<FunctionMenuDto>> GetRoleRightRBAC(int id, string MenuNo)
        {
            //获取当前操作用户id
            var claimsIdentity = this.User.Identity as ClaimsIdentity;
            if (claimsIdentity == null)
            {
                throw new Exception("未获取到用户信息");
            }
            string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
            if (string.IsNullOrWhiteSpace(UserId))
            {
                throw new Exception("未获取到用户信息");
            }
            List<FunctionMenuDto> menudto = _rBACServer.GetRoleRightRBAC(MenuNo, UserId);
            return Ok(new
            {
                data = menudto,
                code = 0,
                msg = "成功"
            });
            return await _rBACServer.GetRoleRightRBAC(MenuNo, UserId);
        }
        /// <summary>
@@ -639,15 +355,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRoleRightLists(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<RoleRightDto>> GetRoleRightLists(int id)
        {
            List<RoleRightDto> roleRightDtos = _rBACServer.GetRoleRightList(id);
            return Ok(new
            {
                data = roleRightDtos,
                code = 0,
                msg = "成功"
            });
            return await _rBACServer.GetRoleRightList(id);
        }
        /// <summary>
@@ -656,33 +367,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRoleRightList()
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<RoleRightDto>> GetRoleRightList()
        {
            try
            {
                //获取当前登录的用户ID
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(userId))
                {
                    return Ok(new { code = 1, msg = "为获取到当前操作人信息" });
                }
                var roleRightDtos = _roleRightServer.GetRoleMenuList(int.Parse(userId));
                return Ok(new
                {
                    data = roleRightDtos,
                    msg = "成功",
                    code = 0
                });
            }
            catch (Exception e)
            {
                return Ok(new { msg = e.Message, code = 0 });
            }
            return await _roleRightServer.GetRoleMenuList();
        }
        /// <summary>
@@ -691,15 +379,10 @@
        /// <param name="id">角色权限id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetRoleRightOneListById(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<SysRoleRight>> GetRoleRightOneListById(int id)
        {
            List<SysRoleRight> roleRights = _roleRightServer.GetRoleRightOneListById(id);
            return Ok(new
            {
                data = roleRights,
                msg = "成功",
                core = 0
            });
            return await _roleRightServer.GetRoleRightOneListById(id);
        }
        /// <summary>
@@ -710,46 +393,22 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> InsertRoleRight(string MenuNo, int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task InsertRoleRight(string MenuNo, int id)
        {
            //捕获异常
            try
            //根据Id获取角色号
            SysRoles roles = await _rolesServer.GetRoleInfoById(id);
            //保存角色权限信息
            await _roleRightServer.InsertRoleRight(MenuNo, roles.RoleNo);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                //根据Id获取角色号
                SysRoles roles = _rolesServer.GetRoleInfoById(id);
                //保存角色权限信息
                int i = await _roleRightServer.InsertRoleRight(MenuNo, roles.RoleNo, userId);
                //判断是否新增成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        msg = "分配失败",
                        code = 1
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "角色权限", roles.RoleNo, "修改", "分配角色权限 角色号:" + roles.RoleNo, Convert.ToInt32(userId));
                    return Ok(new
                    {
                        data = i,
                        msg = "分配成功",
                        code = 0
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("新增角色权限信息异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "角色权限",
                FkNo = roles.RoleNo,
                TypeName = "编辑",
                Msg = "分配角色权限 角色号:" + roles.RoleNo
            });
        }
        #endregion
@@ -763,15 +422,10 @@
        /// <param name="DepartmentNo">部门号</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetDepartmentList(string DepartmentName, string DepartmentNo)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<DepartmentDto>> GetDepartmentList(string DepartmentName, string DepartmentNo)
        {
            List<DepartmentDto> departmentlist = _department.GetDepartmentList(DepartmentName, DepartmentNo);
            return Ok(new
            {
                data = departmentlist,
                code = 0,
                msg = "获取部门信息列表成功"
            });
            return await _department.GetDepartmentList(DepartmentName, DepartmentNo);
        }
        /// <summary>
@@ -780,15 +434,10 @@
        /// <param name="id">部门id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetDepartmentById(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysDepartment> GetDepartmentById(int id)
        {
            SysDepartment department = _department.GetDepartmentById(id);
            return Ok(new
            {
                data = department,
                msg = "成功",
                code = 0
            });
            return await _department.GetDepartmentById(id);
        }
        /// <summary>
@@ -798,56 +447,19 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> AddDepartment(DepartmentDto departmentdto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task AddDepartment(DepartmentDto departmentdto)
        {
            //捕获异常
            try
            await _department.AddDepartment(departmentdto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                departmentdto.CreateUser = uid;
                int i = await _department.AddDepartment(departmentdto);
                //判断是否新增成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "新增失败"
                    });
                }
                else if (i == 3)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 3,
                        msg = "部门号必须唯一"
                    });
                }
                else
                {
                    await _operation.InsertOperation("基础信息", "部门管理", departmentdto.DepartmentNo, "添加", "添加部门信息 部门号:" + departmentdto.DepartmentNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "新增成功"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("新增部门异常", ex);
            }
                ParentName = "基础信息",
                MenuName = "部门管理",
                FkNo = departmentdto.DepartmentNo,
                TypeName = "添加",
                Msg = "添加部门信息 部门号:" + departmentdto.DepartmentNo
            });
        }
        /// <summary>
@@ -857,46 +469,20 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpGet]
        public async Task<IActionResult> DelDepartment(int Id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelDepartment(int Id)
        {
            //捕获异常
            try
            SysDepartment department = await _department.GetDepartmentById(Id);
            await _department.DelDepartment(department);
            await _operation.InsertOperation(new OperationInputVm()
            {
                SysDepartment department = _department.GetDepartmentById(Id);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                department.UpdateUser = uid;
                int i = await _department.DelDepartment(department);
                //判断是否删除成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "删除失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("基础信息", "部门管理", department.DepartmentNo, "删除", "删除部门信息 部门号:" + department.DepartmentNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "删除成功"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("删除部门异常", ex);
            }
                ParentName = "基础信息",
                MenuName = "部门管理",
                FkNo = department.DepartmentNo,
                TypeName = "删除",
                Msg = "删除部门信息 部门号:" + department.DepartmentNo
            });
        }
        /// <summary>
@@ -906,44 +492,19 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> ExitDepartment(DepartmentDto departmentdto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task ExitDepartment(DepartmentDto departmentdto)
        {
            //捕获异常
            try
            await _department.ExitDepartment(departmentdto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                departmentdto.UpdateUser = uid;
                int i = await _department.ExitDepartment(departmentdto);
                //判断是否编辑成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "编辑失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("基础信息", "部门管理", departmentdto.DepartmentNo, "修改", "编辑部门信息 部门号:" + departmentdto.DepartmentNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "编辑成功"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("编辑部门异常", ex);
            }
                ParentName = "基础信息",
                MenuName = "部门管理",
                FkNo = departmentdto.DepartmentNo,
                TypeName = "编辑",
                Msg = "编辑部门信息 部门号:" + departmentdto.DepartmentNo
            });
        }
        #endregion
@@ -958,15 +519,10 @@
        /// <param name="GroupNo">组号</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetFunSettingList(string FunSetName, string IsEnable, string GroupNo)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<FunSettingDto>> GetFunSettingList(string FunSetName, string IsEnable, string GroupNo)
        {
            List<FunSettingDto> settinglist = _setting.GetFunSettingList(FunSetName, IsEnable, GroupNo);
            return Ok(new
            {
                data = settinglist,
                code = 0,
                msg = "成功"
            });
            return await _setting.GetFunSettingList(FunSetName, IsEnable, GroupNo);
        }
        /// <summary>
@@ -975,15 +531,10 @@
        /// <param name="id">功能id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetFunSettingById(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysFunSetting> GetFunSettingById(int id)
        {
            SysFunSetting settinglist = _setting.GetFunSettingById(id);
            return Ok(new
            {
                data = settinglist,
                code = 0,
                msg = "成功"
            });
            return await _setting.GetFunSettingById(id);
        }
        /// <summary>
@@ -992,18 +543,10 @@
        /// <param name="funSetNo">功能编号</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetFunSettingByNo(string funSetNo)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysFunSetting> GetFunSettingByNo(string funSetNo)
        {
            try
            {
                var models = _setting.GetFunSettingByNo(funSetNo);
                return Ok(new { code = 0, msg = "功能设定信息", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
            return await _setting.GetFunSettingByNo(funSetNo);
        }
        /// <summary>
        /// 新增功能信息
@@ -1012,80 +555,19 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> AddFunSettings(FunSettingDto settingdto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task AddFunSettings(FunSettingDto settingdto)
        {
            //捕获异常
            try
            await _setting.AddFunSettings(settingdto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //创建人
                settingdto.CreateUser = uid;
                //新增
                int i = await _setting.AddFunSettings(settingdto);
                //判断是否新增成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "失败"
                    });
                }
                else if (i == 3)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 3,
                        msg = "功能号必须唯一"
                    });
                }
                else if (i == 4)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 4,
                        msg = "显示顺序范围为1---5"
                    });
                }
                else if (i == 5)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 5,
                        msg = "请输入正确组号"
                    });
                }
                else if (i == 6)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 6,
                        msg = "每一组只能开启一个功能"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "功能设定", settingdto.FunSetNo, "添加", "添加功能设定 功能号:" + settingdto.FunSetNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "成功"
                    });
                }
            }
            catch (Exception ex)
            {
                return Ok(new { data = "", code = 1, msg = "新增功能异常:" + ex.Message });
            }
                ParentName = "系统设置",
                MenuName = "功能设定",
                FkNo = settingdto.FunSetNo,
                TypeName = "添加",
                Msg = "添加功能设定 功能号:" + settingdto.FunSetNo
            });
        }
        /// <summary>
@@ -1095,46 +577,20 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpGet]
        public async Task<IActionResult> DelFunSettings(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelFunSettings(int id)
        {
            //捕获异常
            try
            SysFunSetting funSetting = await _setting.GetFunSettingById(id);
            await _setting.DelFunSettings(funSetting);
            await _operation.InsertOperation(new OperationInputVm()
            {
                SysFunSetting funSetting = _setting.GetFunSettingById(id);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                funSetting.UpdateUser = uid;
                //删除
                int i = await _setting.DelFunSettings(funSetting);
                //判断是否删除成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "功能设定", funSetting.FunSetNo, "删除", "删除功能设定 功能号:" + funSetting.FunSetNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "成功"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("删除功能异常", ex);
            }
                ParentName = "系统设置",
                MenuName = "功能设定",
                FkNo = funSetting.FunSetNo,
                TypeName = "删除",
                Msg = "删除功能设定 功能号:" + funSetting.FunSetNo
            });
        }
        /// <summary>
@@ -1144,79 +600,24 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> ExitFunSettings(FunSettingDto settingdto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task ExitFunSettings(FunSettingDto settingdto)
        {
            //捕获异常
            try
            await _setting.ExitFunSettings(settingdto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更改人
                settingdto.UpdateUser = uid;
                //编辑
                int i = await _setting.ExitFunSettings(settingdto);
                //判断是否编辑成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "失败"
                    });
                }
                else if (i == 6)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 6,
                        msg = "每一组只能开启一个功能"
                    });
                }
                else
                {
                    await _operation.InsertOperation("系统设置", "功能设定", settingdto.FunSetNo, "修改", "修改功能设定 功能号:" + settingdto.FunSetNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "成功"
                    });
                }
            }
            catch (Exception ex)
            {
                return Ok(new { data = "", code = 1, msg = "编辑功能异常:" + ex.Message });
            }
                ParentName = "系统设置",
                MenuName = "功能设定",
                FkNo = settingdto.FunSetNo,
                TypeName = "编辑",
                Msg = "修改功能设定 功能号:" + settingdto.FunSetNo
            });
        }
        #endregion
        #region 物料管理
        ///// <summary>
        ///// 查询物料信息
        ///// </summary>
        ///// <param name="matevm">物料编码视图模型</param>
        ///// <returns></returns>
        //[HttpPost]
        //public IActionResult GetMaterialsList(GetMaterialsVm matevm)
        //{
        //    try
        //    {
        //        var bolls = _mate.GetMaterialsList(matevm.SkuNo, matevm.SkuName, matevm.Type, matevm.IsInspect, matevm.Page, matevm.Limit, out int count);
        //        return Ok(new { code = 0, count, msg = "物料信息", data = bolls });
        //    }
        //    catch (Exception e)
        //    {
        //        return Ok(new { code = 1, msg = e.Message });
        //    }
        //}
        #region yyk
@@ -1235,15 +636,10 @@
        /// <param name="categoryNo">类别编码</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetMateList(string skuNo, string skuName, string auditStatusNo, string type, string isControlled, string isInspect, string environment, string categoryNo)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<MaterialsDto>> GetMateList(string skuNo, string skuName, string auditStatusNo, string type, string isControlled, string isInspect, string environment, string categoryNo)
        {
            List<MaterialsDto> matedto = _mate.GetMateList(skuNo, skuName, auditStatusNo, type, isControlled, isInspect, environment, categoryNo);
            return Ok(new
            {
                data = matedto,
                code = 0,
                msg = "成功"
            });
            return await _mate.GetMateList(skuNo, skuName, auditStatusNo, type, isControlled, isInspect, environment, categoryNo);
        }
        /// <summary>
@@ -1252,15 +648,10 @@
        /// <param name="id">物料id</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetMateById(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SysMaterials> GetMateById(int id)
        {
            SysMaterials mate = _mate.GetMateById(id);
            return Ok(new
            {
                data = mate,
                code = 0,
                msg = "成功"
            });
            return await _mate.GetMateById(id);
        }
        /// <summary>
@@ -1268,31 +659,19 @@
        /// </summary>
        /// <param name="matedto">物料dto</param>
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> AddMate(MaterialsDto matedto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task AddMate(MaterialsDto matedto)
        {
            //捕获异常
            try
            await _mate.AddMate(matedto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //创建人
                matedto.CreateUser = uid;
                //新增
                int i = await _mate.AddMate(matedto);
                await _operation.InsertOperation("基础信息", "物料管理", matedto.SkuNo, "添加", "添加物料信息 物料号:" + matedto.SkuNo, uid);
                return Ok(new { data = i, code = 0, msg = "成功" });
            }
            catch (Exception ex)
            {
                //抛出异常
                return Ok(new { code = 1, msg = "新增物料异常"+ ex.Message });
            }
                ParentName = "基础信息",
                MenuName = "物料管理",
                FkNo = matedto.SkuNo,
                TypeName = "添加",
                Msg = "添加物料信息 物料号:" + matedto.SkuNo
            });
        }
        /// <summary>
@@ -1302,45 +681,19 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpGet]
        public async Task<IActionResult> DelMate(int id)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task DelMate(int id)
        {
            //捕获异常
            try
            SysMaterials mate = await _mate.GetMateById(id);
            await _mate.DelMate(mate);
            await _operation.InsertOperation(new OperationInputVm()
            {
                SysMaterials mate = _mate.GetMateById(id);
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                mate.UpdateUser = uid;
                //删除
                int i = await _mate.DelMate(mate);
                //判断是否删除成功
                if (i == 0)
                {
                    return Ok(new
                    {
                        data = i,
                        code = 1,
                        msg = "失败"
                    });
                }
                else
                {
                    await _operation.InsertOperation("基础信息", "物料管理", mate.SkuNo, "删除", "删除物料信息 物料号:" + mate.SkuNo, uid);
                    return Ok(new
                    {
                        data = i,
                        code = 0,
                        msg = "成功"
                    });
                }
            }
            catch (Exception ex)
            {
                //抛出异常
                throw new Exception("删除物料异常", ex);
            }
                ParentName = "基础信息",
                MenuName = "物料管理",
                FkNo = mate.SkuNo,
                TypeName = "删除",
                Msg = "删除物料信息 物料号:" + mate.SkuNo
            });
        }
        /// <summary>
@@ -1350,43 +703,18 @@
        /// <returns></returns>
        /// <exception cref="Exception">捕获异常</exception>
        [HttpPost]
        public async Task<IActionResult> ExitMate(MaterialsDto matedto)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task ExitMate(MaterialsDto matedto)
        {
            //捕获异常
            try
            await _mate.ExitMate(matedto);
            await _operation.InsertOperation(new OperationInputVm()
            {
                //获取当前操作用户id
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                int uid = Convert.ToInt32(userId);
                //更新人
                matedto.UpdateUser = uid;
                //编辑
                int i = await _mate.ExitMate(matedto);
                //判断是否编辑成功
                if (i == 0)
                {
                    return Ok(new { data = i, code = 1, msg = "修改失败" });
                }
                else if (i == 2)
                {
                    return Ok(new { data = i, code = 2, msg = "临期天数不可大于365及小于30" });
                }
                //else if (i == 4)
                //{
                //    return Ok(new { data = i, code = 4, msg = "低库存不可高于1000" });
                //}
                else
                {
                    await _operation.InsertOperation("基础信息", "物料管理", matedto.SkuNo, "修改", "编辑物料信息 物料号:" + matedto.SkuNo, uid);
                    return Ok(new { data = i, code = 0, msg = "修改成功" });
                }
            }
            catch (Exception ex)
            {
                //抛出异
                return Ok(new { code = 1, msg = "编辑物料异常"+ex.Message });
            }
                ParentName = "基础信息",
                MenuName = "物料管理",
                FkNo = matedto.SkuNo,
                TypeName = "编辑",
                Msg = "编辑物料信息 物料号:" + matedto.SkuNo
            });
        }
        #region 包装 单位
@@ -1396,15 +724,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetUnitList()
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<SysUnit>> GetUnitList()
        {
            List<SysUnit> unitlist = _mate.GetUnitList();
            return Ok(new
            {
                data = unitlist,
                code = 0,
                msg = "成功"
            });
            return await _mate.GetUnitList();
        }
        /// <summary>
@@ -1412,15 +735,10 @@
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetPackagList()
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<SysPackag>> GetPackagList()
        {
            List<SysPackag> packlist = _mate.GetPackagList();
            return Ok(new
            {
                data = packlist,
                code = 0,
                msg = "成功"
            });
            return await _mate.GetPackagList();
        }
        #endregion
@@ -1608,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 });
            }
@@ -1627,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 });
            }
@@ -1645,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 });
            }
@@ -1664,7 +983,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddCustomer(AddCustomerVm model)
        public async Task<IActionResult> AddCustomer(AddCustomerVm model)
        {
            try
            {
@@ -1680,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
@@ -1703,7 +1022,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditCustomer(EditCustomerVm model)
        public async Task<IActionResult> EditCustomer(EditCustomerVm model)
        {
            try
            {
@@ -1719,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
@@ -1742,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)
@@ -1759,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
@@ -1781,7 +1100,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsCustomer(IdVm model)
        public async Task<IActionResult> DelsCustomer(IdVm model)
        {
            try
            {
@@ -1797,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 = "删除成功" });
@@ -1821,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 });
            }
@@ -1840,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 });
            }
@@ -1858,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 });
            }
@@ -1878,7 +1198,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddLogisticsInfo(AddLogisticsInfoVm model)
        public async Task<IActionResult> AddLogisticsInfo(AddLogisticsInfoVm model)
        {
            try
            {
@@ -1894,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
@@ -1917,7 +1237,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditLogisticsInfo(EditLogisticsInfoVm model)
        public async Task<IActionResult> EditLogisticsInfo(EditLogisticsInfoVm model)
        {
            try
            {
@@ -1933,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
@@ -1956,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)
@@ -1973,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
@@ -1996,7 +1316,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsLogisticsInfo(IdVm model)
        public async Task<IActionResult> DelsLogisticsInfo(IdVm model)
        {
            try
            {
@@ -2012,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 = "删除成功" });
@@ -2037,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 });
            }
@@ -2056,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 });
@@ -2081,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)
            {
@@ -2099,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)
                    {
@@ -2127,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)
            {
@@ -2145,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
@@ -2175,7 +1496,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelUnit(IdVm model)
        public async Task<IActionResult> DelUnit(IdVm model)
        {
            try
            {
@@ -2190,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 = "删除成功" });
@@ -2211,7 +1532,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelsUnit(IdVm model)
        public async Task<IActionResult> DelsUnit(IdVm model)
        {
            try
            {
@@ -2226,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 = "删除成功" });
@@ -2434,22 +1755,12 @@
        /// <summary>
        /// 获取操作日志信息列表
        /// </summary>
        /// <param name="menuName">菜单名称</param>
        /// <param name="type">操作类型</param>
        /// <param name="msg">操作内容</param>
        /// <param name="menuNo">菜单号</param>
        /// <param name="parentNo">模块号</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetSysOperationList(string menuName, string type, string msg, string menuNo, string parentNo)
        [HttpPost]
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SqlSugarPagedList<OperationDto>> GetSysOperationList(GetOperationVm model)
        {
            List<OperationDto> operation = _operation.GetSysOperationList(menuName, type, msg, menuNo, parentNo);
            return Ok(new
            {
                data = operation,
                code = 0,
                msg = "成功"
            });
            return await _operation.GetSysOperationList(model);
        }
        /// <summary>
@@ -2458,15 +1769,10 @@
        /// <param name="dicName">字典名称</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetDicTypeList(string dicName)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<List<SysDictionary>> GetDicTypeList(string dicName)
        {
            List<SysDictionary> diclist = _operation.GetDicTypeList(dicName);
            return Ok(new
            {
                data = diclist,
                code = 0,
                msg = "成功"
            });
            return await _operation.GetDicTypeList(dicName);
        }
        #endregion
@@ -2478,18 +1784,10 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetInterfaceList(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SqlSugarPagedList<InterfaceDto>> GetInterfaceList(InterfaceVm model)
        {
            try
            {
                var models = _interface.GetInterfaceList(model, out int count);
                return Ok(new { code = 0, count, msg = "接口列表", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
            return await _interface.GetInterfaceList(model);
        }
        /// <summary>
@@ -2498,18 +1796,10 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetInterfaceDetailList(InterfaceDetailVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        public async Task<SqlSugarPagedList<InterfaceDetailDto>> GetInterfaceDetailList(InterfaceDetailVm model)
        {
            try
            {
                var models = _interface.GetInterfaceDetailList(model, out int count);
                return Ok(new { code = 0, count, msg = "接口明细列表", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
            return await _interface.GetInterfaceDetailList(model);
        }
        /// <summary>
@@ -2518,41 +1808,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task AddInterface(InterfaceVm model)
        {
            try
            await _interface.AddInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.AddInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "添加成功" });
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
                else
                {
                    return Ok(new { code = 0, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "添加",
                Msg = $"添加了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -2561,41 +1829,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult EditInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task EditInterface(InterfaceVm model)
        {
            try
            await _interface.EditInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.EditInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "编辑成功" });
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 0, msg = "部分成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"编辑了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -2604,37 +1850,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelInterface(InterfaceVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelInterface(InterfaceVm model)
        {
            try
            await _interface.DelInterface(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.DelInterface(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"删除了接口编号为{model.InterfaceNo}的接口信息"
            });
        }
        /// <summary>
@@ -2643,37 +1871,19 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult DelInterfaceDetail(InterfaceDetailVm model)
        [ServiceFilter(typeof(ApiResponseActionFilter))]
        [UnitOfWork]
        public async Task DelInterfaceDetail(InterfaceDetailVm model)
        {
            try
            await _interface.DelInterfaceDetail(model);
            await _operation.InsertOperation(new OperationInputVm()
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _interface.DelInterfaceDetail(model);
                if (strMesage == "")
                {
                    return Ok(new { code = 0, msg = "删除成功" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMesage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
                ParentName = "系统设置",
                MenuName = "接口管理",
                FkNo = model.InterfaceNo,
                TypeName = "编辑",
                Msg = $"删除了接口编号为{model.InterfaceNo}的接口信息,本系统字段为{model.Field}的接口信息"
            });
        }
        #endregion
    }