| | |
| | | public static string CreateRcvLineLocationUrl |
| | | { get; set; } = "http://172.16.80.20/u9c/webapi/CustReceivement/CreateRcvLineLocation"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 创建收货单新增行库位 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<List<U9CReturnData>>> CreateRcvLineLocation(CreateRcvLineLocationInput input) |
| | | public async Task<ApiAction<List<U9CReturnData2>>> CreateRcvLineLocation(CreateRcvLineLocationInput input) |
| | | { |
| | | Logger.Interface.Info($"/**\r\n *进入创建收货单新增行库位接口....\r\n */\r\n"); //固定写法 |
| | | var action = new ApiAction<List<U9CReturnData>>(); |
| | | var action = new ApiAction<List<U9CReturnData2>>(); |
| | | try |
| | | { |
| | | //如果已经登录则不需要再次登录,直接使用传入的token |
| | | if (input.IsLogin) |
| | | { |
| | | var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={input.userId}{secret}"); |
| | | var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={Reviewer}{secret}"); |
| | | if (u9CLoginResult.Success) |
| | | { |
| | | input.token = u9CLoginResult.Data; |
| | |
| | | } |
| | | } |
| | | var response = await HttpHelper.PostAsync(CreateRcvLineLocationUrl, JsonConvert.SerializeObject(input.RcvLineLocationParam), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult>(response.Message); |
| | | var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].m_isSucess) |
| | | if (result.Success && result.Data[0].IsSucess) |
| | | { |
| | | action.Data = result.Data; |
| | | Logger.Interface.Info($"创建收货单新增行库位接口提交Json: {JsonConvert.SerializeObject(input.RcvLineLocationParam)},返回Json: {response.Message}"); |
| | | Logger.Interface.Info($"收货单新增行库位接口提交Json: {JsonConvert.SerializeObject(input.RcvLineLocationParam)},返回Json: {response.Message}"); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"{action.Message}; {result.Data[0].m_errorMsg}"); |
| | | Logger.Interface.Info($"创建收货单新增行库位接口失败:{result.Data[0].m_errorMsg}"); |
| | | action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); |
| | | Logger.Interface.Info($"收货单新增行库位接口失败:{result.Data[0].ErrorMsg}"); |
| | | } |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, "创建收货单新增行库位异常"); |
| | | action.CatchExceptionWithLog(ex, "收货单新增行库位异常"); |
| | | } |
| | | Logger.Interface.Info($"/* 创建收货单新增行库位结束 */\r\n"); //固定写法 |
| | | return action; |