CServiceImpl.cs 3.02 KB
using XingYe_ACS.BaseStruct;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XingYe_ACS.WebApi
{
    public class CServiceImpl
    {
        /// <summary>
        /// ACS任务回传WMS
        /// </summary>
        /// <param name="fTask"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        public static bool ToWebTaskRefresh(FTask task, int status)
        {
            try
            {
                //调用WMS方法;
                WebApiTask webApiTask = new WebApiTask();
                return true;
            }
            catch (Exception Ex)
            {
                throw new Exception("ToWebTaskRefresh:" + Ex.Message.Replace(Environment.NewLine, ""));
            }
        }

        /// <summary>
        /// 连接AGV是否成功回传
        /// </summary>
        /// <param name="agvNo"></param>
        /// <param name="link"></param> 
        /// <returns></returns>
        public static bool ToWebLinkAgvRefresh(string agvNo, bool link)
        {
            try
            {
                //调用WMS方法;
                LinkAgv linkAgv = new LinkAgv();
                linkAgv.agvNo = agvNo;
                linkAgv.link = link;
                ReMessage result = CService.LinkAgvRefresh(linkAgv);
                if (result != null && result.status)
                {
                    string web = string.Format(@"响应码:{0} 响应说明:{1} AGV编号:{2} 连接状态:{3}"
                                        , result.status, result.message, agvNo, link);
                    App.ExFile.MessageLog("ToWebTaskRefresh", "WEB返回的数据(ToWebTaskRefresh)," + web + "\r");
                    return true;
                }
                return false;
            }
            catch (Exception Ex)
            {
                throw new Exception("ToWebTaskRefresh:" + Ex.Message.Replace(Environment.NewLine, ""));
            }
        }

        /// <summary>
        /// 界面返回任务完成
        /// </summary>
        /// <param name="fTask"></param>
        /// <returns></returns>
        public static bool ToWebTaskReturn(FTask fTask)
        {
            try
            {
                return true;
                //调用WMS方法;
                //WebApiTask task = new WebApiTask();
                //ReMessage result = CService.TaskRefresh(task,2);
                //if (result != null && result.status)
                //{
                //    string web = string.Format(@"响应码:{0} 响应说明:{1}"
                //                        , result.status, result.message);
                //    App.ExFile.MessageLog("ToWebTaskReturn", "WEB返回的数据(ToWebTaskReturn)," + web + "\r");
                //    return true;
                //}
                //return false;
            }
            catch (Exception Ex)
            {
                throw new Exception("ToWebTaskReturn:" + Ex.Message.Replace(Environment.NewLine, ""));
            }
        }
    }
}