| | |
| | | using HH.WCS.Mobox3.AnGang.models; |
| | | using Newtonsoft.Json; |
| | | using static HH.WCS.Mobox3.AnGang.api.ApiModel; |
| | | using static System.Net.WebRequestMethods; |
| | | |
| | | namespace HH.WCS.Mobox3.AnGang.dispatch { |
| | | /// <summary> |
| | |
| | | var dataResult = JsonConvert.DeserializeObject<gzResult<IOStatesInfoResult>>(result); |
| | | } |
| | | |
| | | // DOC 1. 创建订单 WMS->RCS |
| | | public static int CreateOrder(string taskNo, int priority, string param, string ts = "churuku", string created_user = "hanhe") { |
| | | LogHelper.Info($"CreateOrder参数信息:taskNo:{taskNo},priority:{priority},param:{param},ts:{ts},created_user:{created_user}", "API"); |
| | | var msg = ""; |
| | |
| | | if (response != "") { |
| | | try { |
| | | var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response); |
| | | if (dataResult.code == 0) { |
| | | // 原代码部分 |
| | | //if (dataResult.code == 0) { |
| | | // orderId = dataResult.data[0].in_order_id; |
| | | //} |
| | | // 尊重文档的版本 |
| | | // 返回参数中,code目前不再使用,可通过msg字段判断是否成功,如果msg为”success”则表示成功,否则为报错信息或不存在。http code为422时候的报错为系统报错,其中的msg无法全部获取。 |
| | | // SELFNOTE: 直接调用HttpHelper.Post方法,无法获取header,暂时不考虑 |
| | | if (dataResult.msg == "success") { |
| | | orderId = dataResult.data[0].in_order_id; |
| | | } |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | // DOC 2. 取消订单 WMS->RCS |
| | | public static bool CancelGZOrder(int orderId) { |
| | | bool result = false; |
| | | string msg = ""; |
| | |
| | | msg = $"[guozi-CancelOrder] request={requests};response={response}"; |
| | | if (response != "") { |
| | | var dataResult = JsonConvert.DeserializeObject<CancelGZOrderResult>(response); |
| | | if (dataResult.code == 0) { |
| | | msg = "[guozi-CancelOrder]取消订单成功"; |
| | | Console.WriteLine(msg); |
| | | // 原代码版本 |
| | | //if (dataResult.code == 0) { |
| | | // msg = "[guozi-CancelOrder]取消订单成功"; |
| | | // Console.WriteLine(msg); |
| | | // result = true; |
| | | // return result; |
| | | //} |
| | | |
| | | // 尊重文档的版本 |
| | | if (dataResult.msg == "success") { // 目前只取消一个任务,成功无需再检查success_list和error_list |
| | | Console.WriteLine("[guozi-CancelOrder]取消订单成功"); |
| | | result = true; |
| | | return result; |
| | | } |
| | | |
| | | } |
| | | else { |
| | | msg = "[guozi-CancelOrder]取消订单失败"; |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | // DOC 3. 订单状态推送 RCS->WMS |
| | | /// <summary> |
| | | /// 订单状态反馈 |
| | | /// </summary> |
| | |
| | | return result; |
| | | } |
| | | |
| | | // DOC 6. 交互表查询 |
| | | /// <summary> |
| | | /// 获取交互信息 |
| | | /// </summary> |
| | |
| | | return list; |
| | | } |
| | | |
| | | // DOC 6. 交互表查询(更新终点货位) |
| | | public static bool UpdateInteractInfo(UpdateInteractInfo interactInfo) { |
| | | string msg = ""; |
| | | var result = false; |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | // DOC 5. 称重信息查询 |
| | | public static List<CustomData> CustomBuf() { |
| | | var res = new List<CustomData>(); |
| | | string msg = ""; |
| | |
| | | public class UpdateInteractInfo |
| | | { |
| | | public int interaction_info_id { get; set; } |
| | | public string type_name { get; set; } = "GET_DST"; |
| | | public string info_status { get; set; } |
| | | public string return_value { get; set; } |
| | | public string return_value { get; set; } = ""; |
| | | } |
| | | public class interaction_state |
| | | { |