hwh
2024-07-04 2dd922eb3ab68c0314f5828fcae1ed7db0e17d9e
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 = "删除成功" });