| | |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 入库单据导入 |
| | | /// </summary> |
| | | /// <param name="models"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult ImportArrivalNotice(ArrivalNoticeVms models) |
| | | { |
| | | try |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | |
| | | models.CreateUser = int.Parse(UserId); |
| | | string strMessage = _arrivalNoticeSvc.ImportArrivalNotice(models); |
| | | |
| | | if (strMessage.Contains("-1")) |
| | | { |
| | | return Ok(new { code = 1, msg = strMessage }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 0, msg = strMessage }); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | [HttpPost] |
| | | public IActionResult EditArrivalNotice(ArrivalNoticeVm model) |