| | |
| | | /// <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 }); |
| | | } |
| | |
| | | /// <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 }); |
| | | } |
| | |
| | | /// </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 }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult AddCustomer(AddCustomerVm model) |
| | | public async Task<IActionResult> AddCustomer(AddCustomerVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult EditCustomer(EditCustomerVm model) |
| | | public async Task<IActionResult> EditCustomer(EditCustomerVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 |
| | |
| | | /// <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) |
| | |
| | | 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 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult DelsCustomer(IdVm model) |
| | | public async Task<IActionResult> DelsCustomer(IdVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 = "删除成功" }); |
| | |
| | | /// <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 }); |
| | | } |
| | |
| | | /// <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 }); |
| | | } |
| | |
| | | /// </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 }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult AddLogisticsInfo(AddLogisticsInfoVm model) |
| | | public async Task<IActionResult> AddLogisticsInfo(AddLogisticsInfoVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult EditLogisticsInfo(EditLogisticsInfoVm model) |
| | | public async Task<IActionResult> EditLogisticsInfo(EditLogisticsInfoVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 |
| | |
| | | /// <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) |
| | |
| | | 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 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult DelsLogisticsInfo(IdVm model) |
| | | public async Task<IActionResult> DelsLogisticsInfo(IdVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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 = "删除成功" }); |
| | |
| | | /// <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 }); |
| | | } |
| | |
| | | /// <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 }); |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult AddUnit(AddEditUnitVm model) |
| | | public async Task<IActionResult> AddUnit(AddEditUnitVm model) |
| | | { |
| | | if (ModelState.IsValid) |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult EditUnit(AddEditUnitVm model) |
| | | public async Task<IActionResult> EditUnit(AddEditUnitVm model) |
| | | { |
| | | if (ModelState.IsValid) |
| | | { |
| | |
| | | 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 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult DelUnit(IdVm model) |
| | | public async Task<IActionResult> DelUnit(IdVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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 = "删除成功" }); |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult DelsUnit(IdVm model) |
| | | public async Task<IActionResult> DelsUnit(IdVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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 = "删除成功" }); |