| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据托盘号获取取样类型 |
| | | /// </summary> |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetSampleType(string palletNo) |
| | | { |
| | | 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("未获取到用户信息"); |
| | | } |
| | | |
| | | var type = _pdaSoSvc.GetSampleType(palletNo); |
| | | |
| | | return Ok(new { data = type, code = 0, msg = "获取取样类型" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { data = "", code = 1, msg = "获取取样类型错误:" + e.Message }); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |