| | |
| | | { get; set; } = ApiConfig.IsTestServer ? Cache.SysParam["CreateRcvBySrcASNUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["CreateRcvBySrcASNUrl", "U9CUrl"].PARAM_VALUE; //"http://172.16.80.20/U9C/webapi/Receivement/CreateRcvBySrcASN"; 测试 |
| | | public static string CreateReceivementUrl |
| | | { get; set; } = ApiConfig.IsTestServer ? Cache.SysParam["CreateReceivementUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["CreateReceivementUrl", "U9CUrl"].PARAM_VALUE; //"http://172.16.80.20/U9C/webapi/Receivement/CreateReceivement"; 测试 |
| | | public static string SubmitLineUrl |
| | | { get; set; } = ApiConfig.IsTestServer ? Cache.SysParam["SubmitLineUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["SubmitLineUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/Receivement/SubmitLine; 测试 |
| | | public static string ApproveLineUrl |
| | | { get; set; } = ApiConfig.IsTestServer ? Cache.SysParam["ApproveLineUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["ApproveLineUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/Receivement/ApproveLine; 测试 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 新增收货单-来源ASN单接口 |
| | |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增收货单-无来源接口 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<CreateReceivementInput>> CreateReceivement(CreateReceivementInput input) |
| | | { |
| | | Logger.Interface.Info($"/**\r\n *进入新增收货单-无来源接口....\r\n */\r\n"); //固定写法 |
| | |
| | | Logger.Interface.Info($"/* 新增收货单-无来源接口结束 */\r\n"); //固定写法 |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收货单-行审核总入口接口 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<SubmitLineInput>> ReceivementApproveLine(SubmitLineInput input) { |
| | | Logger.Interface.Info($"/**\r\n *进入收货单-行审核总入口接口....\r\n */\r\n"); //固定写法 |
| | | var action = new ApiAction<SubmitLineInput>(); |
| | | try |
| | | { |
| | | if (input.IsLogin) |
| | | { |
| | | var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={input.userId}{secret}"); |
| | | if (u9CLoginResult.Success) |
| | | { |
| | | input.token = u9CLoginResult.Data; |
| | | Logger.Interface.Info($"U9C登录token: {input.token}"); |
| | | } |
| | | } |
| | | var response = await HttpHelper.PostAsync(ApproveLineUrl, JsonConvert.SerializeObject(input.param), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].IsSucess) |
| | | { |
| | | Logger.Interface.Info($"收货单-行审核总入口接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}"); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); |
| | | Logger.Interface.Info($"收货单-行审核总入口接口失败:{result.Data[0].ErrorMsg}"); |
| | | } |
| | | } |
| | | |
| | | action = await SubmitLine(input); |
| | | if (action.IsSuccessed) { |
| | | action = await ApproveLine(input); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, "收货单-行审核总入口异常"); |
| | | } |
| | | Logger.Interface.Info($"/* 收货单-行审核总方法接口结束 */\r\n"); //固定写法 |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收货单-行提交 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | private async Task<ApiAction<SubmitLineInput>> SubmitLine(SubmitLineInput input) |
| | | { |
| | | Logger.Interface.Info($"/**\r\n *进入收货单-行提交接口....\r\n */\r\n"); //固定写法 |
| | | var action = new ApiAction<SubmitLineInput>(); |
| | | try |
| | | { |
| | | if (input.IsLogin) |
| | | { |
| | | var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={input.userId}{secret}"); |
| | | if (u9CLoginResult.Success) |
| | | { |
| | | input.token = u9CLoginResult.Data; |
| | | Logger.Interface.Info($"U9C登录token: {input.token}"); |
| | | } |
| | | } |
| | | var response = await HttpHelper.PostAsync(SubmitLineUrl, JsonConvert.SerializeObject(input.param), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].IsSucess) |
| | | { |
| | | Logger.Interface.Info($"收货单-行提交接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}"); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); |
| | | Logger.Interface.Info($"收货单-行提交接口失败:{result.Data[0].ErrorMsg}"); |
| | | } |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, "收货单-行提交异常"); |
| | | } |
| | | Logger.Interface.Info($"/* 收货单-行提交接口结束 */\r\n"); //固定写法 |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收货单-行审核 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | private async Task<ApiAction<SubmitLineInput>> ApproveLine(SubmitLineInput input) |
| | | { |
| | | Logger.Interface.Info($"/**\r\n *进入收货单-行审核接口....\r\n */\r\n"); //固定写法 |
| | | var action = new ApiAction<SubmitLineInput>(); |
| | | try |
| | | { |
| | | if (input.IsLogin) |
| | | { |
| | | var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={input.userId}{secret}"); |
| | | if (u9CLoginResult.Success) |
| | | { |
| | | input.token = u9CLoginResult.Data; |
| | | Logger.Interface.Info($"U9C登录token: {input.token}"); |
| | | } |
| | | } |
| | | var response = await HttpHelper.PostAsync(ApproveLineUrl, JsonConvert.SerializeObject(input.param), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].IsSucess) |
| | | { |
| | | Logger.Interface.Info($"收货单-行审核接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}"); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); |
| | | Logger.Interface.Info($"收货单-行审核接口失败:{result.Data[0].ErrorMsg}"); |
| | | } |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, "收货单-行审核异常"); |
| | | } |
| | | Logger.Interface.Info($"/* 收货单-行审核接口结束 */\r\n"); //固定写法 |
| | | return action; |
| | | } |
| | | } |
| | | } |