| | |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加区域信息 |
| | | /// </summary> |
| | | /// <param name="model">模型</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult InsertStorageArea(SysStorageArea model) |
| | | { |
| | | 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 = "为获取到当前操作人信息" }); |
| | | } |
| | | model.CreateUser = int.Parse(userId); |
| | | string bolls = _areaSvc.InsertStorageArea(model); |
| | | var arr = bolls.Split(":"); |
| | | if (arr[0] != "-1" ) |
| | | { |
| | | SysStorageArea area = _areaSvc.GetStorageMaxArea(); |
| | | _operation.InsertOperation("仓库设置", "区域管理", area.AreaNo, "添加", "添加区域信息 区域号:" + area.AreaNo, Convert.ToInt32(userId)); |
| | | return Ok(new { code = 0, msg = bolls, data = "" }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 1, msg = bolls, data = "" }); |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改区域信息 |
| | | /// </summary> |