1
zxx
2025-07-07 3428deadb4b60ef25dbd06fbf53905fc51c7616e
1
4个文件已修改
117 ■■■■■ 已修改文件
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/api/ApiModel.cs
@@ -310,6 +310,9 @@
        /// 额外信息2
        /// </summary>
        public string extraInfo2 { get; set; }
        //
        public string StatusChangeTime { get; set; }
    }
    public class orderReroute
@@ -347,28 +350,36 @@
    ////反馈小米
    //public class XiaoMiOrderStatusReport
    //{
    //    public string StatusChangeTime { get; set; }
    //    public int orderID { get; set; }
    //    public int orderName { get; set; }
    //    public string orderStatus { get; set; }
    //    public int errorCode { get; set; }
    //    public string extraInfo1 { get; set; }
    //    public string agvIDList { get; set; }
    //    public int priority { get; set; }
    //    public string currentDes { get; set; }
    //    public string currentCmd { get; set; }
    //    public int errorCode { get; set; }
    //    public string extraInfo1 { get; set; }
    //    //public statusParameter extraInfo1 { get; set; }
    //    public string extraInfo2 { get; set; }
    //    public string deadLine { get; set; }
    //    public string agvIDList { get; set; }
    //    public string currentCmd { get; set; }
    //    public string createdTime { get; set; }
    //    public string createdUser { get; set; }
    //    public string orderName { get; set; }
    //    public string StatusChangeTime { get; set; }
    //}
    //public class statusParameter
    //{
    //    public string wcstaskCode { get; set; }
    //    public string rcstaskCode { get; set; }
    //    public string sku { get; set; }
    //    public string boxType{ get; set; }
    //    public string num { get; set; }
    //}
    /// <summary>
    /// 返回给GZ
    /// </summary>
    public class GzResult
        /// <summary>
        /// 返回给GZ
        /// </summary>
        public class GzResult
    {
        public int resultCode { get; set; }
        public bool success { get; set; }
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/GZRobot.cs
@@ -195,7 +195,8 @@
                agv.ForkliftNo = model.agvIDList;
                WCSCore.OperateAgvTaskStatus(agv);
                ////小米状态上报
                //xiaoMiRequestApi(model);
            }
@@ -299,41 +300,41 @@
        }
        ///// <summary>
        ///// 调用小米状态回报接口
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public static int xiaoMiRequestApi(orderStatusReportParme model)
        //{
        //    var msg = "";
        //    var orderId = 0;
        //    var request = JsonConvert.SerializeObject(model);
        //    var response = apiHelper.Post(baseUrl + "api/om/order/", request);
        //    msg = $"[xiaoMiRequestApi] request={request} response={response}";
        //    Console.WriteLine(msg);
        //    if (response != ""&& model.orderStatus == "6")
        //    {
        //        try
        //        {
        //            var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response);
        //            if (dataResult.code == 0)
        //            {
        //                orderId = dataResult.data[0].in_order_id;
        //            }
        //        }
        //        catch (Exception ex)
        //        {
        //        }
        //    }
        //    else
        //    {
        //        msg = "[xiaoMiRequestApi]状态汇报失败";
        //        Console.WriteLine(msg);
        //    }
        /// <summary>
        /// 调用小米状态回报接口
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int xiaoMiRequestApi(orderStatusReportParme model)
        {
            var msg = "";
            var orderId = 0;
            var request = JsonConvert.SerializeObject(model);
            var response = apiHelper.Post(baseUrl + "api/om/order/", request);
            msg = $"[xiaoMiRequestApi] request={request} response={response}";
            Console.WriteLine(msg);
            if (response != "" && model.orderStatus == "6")
            {
                try
                {
                    var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response);
                    if (dataResult.code == 0)
                    {
                        orderId = dataResult.data[0].in_order_id;
                    }
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                msg = "[xiaoMiRequestApi]状态汇报失败";
                Console.WriteLine(msg);
            }
        //    return orderId;
        //}
            return orderId;
        }
    }
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/RcsHelper.cs
@@ -35,7 +35,16 @@
                    var dataResult = JsonConvert.DeserializeObject<RcsResult>(response);
                    if (dataResult.code == 0)
                    {
                        result = true;
                        var db = new SqlHelper<WCSTask>().GetInstance();
                        //存订单号
                        var task = db.Queryable<WCSTask>().Where(a => a.S_CODE == model.ts_name).First();
                        task.S_WORKSHOP_NO = dataResult.data.in_order_id;
                        var res = db.Updateable(task).UpdateColumns(it => it.S_WORKSHOP_NO).ExecuteCommand() > 0;
                        if (res)
                        {
                            result = true;
                        }
                    }
                }
                catch (Exception ex)
HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/models/WCSTask.cs
@@ -53,7 +53,7 @@
        public string S_OP_NAME { get; set; }
        //存小米任务号
        //存小米返回订单号
        public string S_WORKSHOP_NO { get; set; }
        public string S_WORKSHOP_NAME { get; set; }
        //public int N_START_LAYER { get; internal set; }