From 2dd922eb3ab68c0314f5828fcae1ed7db0e17d9e Mon Sep 17 00:00:00 2001 From: hwh <332078369@qq.com> Date: 星期四, 04 七月 2024 08:06:26 +0800 Subject: [PATCH] 客户、物流、单位 --- Wms/Wms/Controllers/BasisController.cs | 103 ++++++++++++++++++++++++++------------------------- 1 files changed, 53 insertions(+), 50 deletions(-) diff --git a/Wms/Wms/Controllers/BasisController.cs b/Wms/Wms/Controllers/BasisController.cs index c832558..1c2411a 100644 --- a/Wms/Wms/Controllers/BasisController.cs +++ b/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); //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D 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); //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D 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 = "鍒犻櫎鎴愬姛" }); -- Gitblit v1.8.0