private LogisticsStatus GetLogisticsStatus(SqlDataReader dr)
        {
            LogisticsStatus result = null;

            try
            {
                result                 = new LogisticsStatus();
                result.guid            = Guid.NewGuid();
                result.customsCode     = Convert.ToString(dr["customsCode"]);
                result.appType         = Convert.ToInt32(AppType.Add);
                result.appTime         = DateTime.UtcNow;
                result.appStatus       = Convert.ToInt32(AppStatus.Declare);
                result.appUid          = Convert.ToString(dr["appUid"]);
                result.appUname        = Convert.ToString(dr["appUname"]);
                result.logisticsCode   = Convert.ToString(dr["logisticsCode"]);
                result.logisticsName   = Convert.ToString(dr["logisticsName"]);
                result.logisticsNo     = Convert.ToString(dr["logisticsNo"]);
                result.logisticsStatus = Convert.ToString(dr["logisticsRL"]); //L
                result.ieFlag          = OrderType.E;
                result.trafMode        = "9";
                result.trafName        = Convert.ToString(dr["trafName"]);
                result.voyageNo        = Convert.ToString(dr["voyageNo"]);
                result.billNo          = Convert.ToString(dr["billNo"]);
                result.note            = "";
            }
            catch (Exception ex)
            {
                throw new Exception("GetLogisticsStatus Exception : " + ex.ToString());
            }
            return(result);
        }
Пример #2
0
        public bool Create503Message(LogisticsStatus logisticsStatus)
        {
            bool          isSuccess     = true;
            BaseSubscribe baseSubscribe = null;
            XElement      xele          = null;
            XNamespace    ns            = null;

            try
            {
                Logs.Debug("Create503Message Start! OrderNo_" + logisticsStatus.logisticsNo);
                baseSubscribe = GetBaseSubscribe();
                ns            = "http://www.chinaport.gov.cn/ceb";
                xele          = new XElement(ns + "CEB503Message");
                xele.SetAttributeValue(XNamespace.Xmlns + "ceb", ns);
                xele = logisticsStatus.ToXElememt(xele, ns);
                xele = baseSubscribe.ToXElememt(xele, ns);
                FileUtilities.CreateFolder(ConfigurationInfo.PathSend);
                xele.Save(ConfigurationInfo.PathSend + "\\" + logisticsStatus.logisticsNo + "_" + logisticsStatus.logisticsStatus + "_503.xml");
                Logs.Debug("Create503Message End! OrderNo_" + logisticsStatus.logisticsNo);
            }
            catch (Exception ex)
            {
                Logs.Error("Create503Message Exception: " + ex.ToString());
                isSuccess = false;
            }
            return(isSuccess);
        }
Пример #3
0
 public static string LogisticsStatusText(LogisticsStatus statusValue)
 {
     switch (statusValue)
     {
         case LogisticsStatus.Delete: return "ɾ³ý";
         case LogisticsStatus.Enable: return "ÆôÓÃ";
         case LogisticsStatus.Disable: return "½ûÓÃ";
     }
     return "";
 }
Пример #4
0
        public static string LogisticsStatusText(LogisticsStatus statusValue)
        {
            switch (statusValue)
            {
            case LogisticsStatus.Delete: return("ɾ³ý");

            case LogisticsStatus.Enable: return("ÆôÓÃ");

            case LogisticsStatus.Disable: return("½ûÓÃ");
            }
            return("");
        }
Пример #5
0
        public bool CreateMessage503L(string orderNoFake)
        {
            bool            success         = true;
            LogisticsStatus logisticsStatus = null;
            MessageSql      mssql           = null;
            MessageService  msService       = null;
            XElement        xele            = null;
            XNamespace      ns = null;

            try
            {
                mssql           = new MessageSql();
                logisticsStatus = new LogisticsStatus();
                mssql.QueryDate503ByOrderNo(orderNoFake, ref logisticsStatus);
                if (logisticsStatus.guid != new Guid() && CheckNeedSendLogistics(logisticsStatus.logisticsCode))
                {
                    string      url         = GetRequestHostByCode(logisticsStatus.logisticsCode);
                    RestRequest restRequest = new RestRequest(string.Format("{0}:{1}/Logistics/Create503", url, ConfigurationInfo.RestPort), Utilities.JsonSerialize(logisticsStatus));
                    success = Convert.ToBoolean(restRequest.Execute());
                }
                else
                {
                    success = false;
                }
                if (success)
                {
                    mssql.UpdateSchedule503(orderNoFake, null);

                    ns   = "http://www.chinaport.gov.cn/ceb";
                    xele = new XElement(ns + "CEB503Message");
                    xele.SetAttributeValue(XNamespace.Xmlns + "ceb", ns);
                    xele = logisticsStatus.ToXElememt(xele, ns);

                    string destPath = FileUtilities.GetNewFolderName(true, ConfigurationInfo.PathBackUp, "503") + "\\" + FileUtilities.GetNewFileName(logisticsStatus.logisticsNo, "Create", "L") + ".xml";

                    xele.Save(destPath);

                    msService = new MessageService();
                    msService.DealMessage503(false, true, logisticsStatus.guid.ToString(), logisticsStatus.logisticsNo, destPath, "L");
                }
                else
                {
                    success = false;
                    Logs.Info("CreateMessage503L Response Error! Date:" + Utilities.JsonSerialize(logisticsStatus));
                }
            }
            catch (Exception ex)
            {
                success = false;
                Logs.Error("CreateMessage503L Exception: " + ex.ToString());
            }
            return(success);
        }
 public void QueryDate503ByOrderNo(string orderNo, ref LogisticsStatus logisticsStatus)
 {
     try
     {
         SqlDataReader dr = a_sqlServer.ExePROC("MessageCenterQuery", ConvertToSqlParameters(5032, orderNo, ""));
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 logisticsStatus = GetLogisticsStatus(dr);
                 logisticsStatus.logisticsStatus = "L";
             }
         }
     }
     catch (Exception ex)
     {
         Logs.Error("Query503DataByOrderNo Exception : " + ex.ToString());
     }
 }
Пример #7
0
        public bool UploadLogistics503(LogisticsStatus info)
        {
            LogisticsControl control = new LogisticsControl();

            return(control.Create503Message(info));
        }