| | |
| | | return WebResponseContent.Instance.Error("该出库单据非ERP推送,无法取消"); |
| | | } |
| | | string ids =""; |
| | | foreach (var item in outboundOrderDetails) |
| | | try |
| | | { |
| | | ids = item.LinId; |
| | | var postContent = new MultipartFormDataContent(); |
| | | postContent.Add(new StringContent(ids), "ids"); |
| | | string result = string.Empty; |
| | | HttpClient client = null; |
| | | try |
| | | foreach (var item in outboundOrderDetails) |
| | | { |
| | | ids = item.LinId; |
| | | var postContent = new MultipartFormDataContent(); |
| | | postContent.Add(new StringContent(ids), "ids"); |
| | | string result = string.Empty; |
| | | HttpClient client = null; |
| | | using (client = new HttpClient()) |
| | | { |
| | | // 2. 发送请求 |
| | |
| | | _outboundRepository.OutboundOrderRepository.DeleteAndMoveIntoHty(outboundOrder, OperateType.人工取消); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | // 假设ERP返回成功时返回成功响应 |
| | | return WebResponseContent.Instance.OK(result); |
| | | |
| | | } |
| | | catch (HttpRequestException ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // 处理HTTP请求相关异常 |
| | | return WebResponseContent.Instance.Error($"HTTP请求错误: {ex.Message}"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // 处理其他异常 |
| | | return WebResponseContent.Instance.Error($"处理失败: {ex.Message}"); |
| | | } |
| | | // 假设ERP返回成功时返回成功响应 |
| | | return WebResponseContent.Instance.OK(); |
| | | |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | catch (HttpRequestException ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // 处理HTTP请求相关异常 |
| | | return WebResponseContent.Instance.Error($"HTTP请求错误: {ex.Message}"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // 处理其他异常 |
| | | return WebResponseContent.Instance.Error($"处理失败: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | } |