} // int DoRunL(CWmsOrdersSync_EntryOrderImpl)

        /// <summary>
        /// 同步当前主入库订单。若执行成功则返回TError.RunGood,否则返回其他
        /// </summary>
        /// <param name="pImpl">implementor of CWmsOrdersSync_EntryOrder</param>
        /// <returns></returns>
        int DoSyncSingleOrder(CWmsOrdersSync_EntryOrderImpl pImpl)
        {
            if (null == pImpl)
            {
                C_WMS.Data.Utility.MyLog.Instance.Error("CWmsOrdersSync_EntryOrder.在{0}中,输入参数pHandler为空", MethodBase.GetCurrentMethod().Name);
                return(TError.Post_ParamError.Int());
            }

            int err = TError.RunGood.Int();
            HttpRespXml_EntryOrderCreate respObj = null;
            HttpReqXml_EntryOrderCreate  reqObj  = pImpl.GetCurrentEntryOrder_ReqXmlObj();

            #region 根据当前待处理的主入库订单创建RequestXMLObject
            if (null == reqObj)
            {
                C_WMS.Data.Utility.MyLog.Instance.Error("CWmsOrdersSync_EntryOrder.在{0}中,根据当前待处理的主入库订单[{1}]创建RequestXMLObject失败。", MethodBase.GetCurrentMethod().Name, pImpl.CurrentOrder?.GetId());
                return(err = TError.Pro_HaveNoData.Int());
            }
            #endregion

            #region 执行同步 -and- handle response
            if (null != (respObj = mDlgtDoHttpTransaction.Invoke(reqObj)) && respObj.IsSuccess())
            {
                _currentOrderSyncOk = true; // 更新商城中该单据isToWms为‘同步成功’和Dict709中该行的状态为'同步成功'
            } // if ( null  == respObj && respObj.IsSuccess())
            else
            {
                C_WMS.Data.Utility.MyLog.Instance.Error("CWmsOrdersSync_EntryOrder.{0}中,同步单据{3}的HTTP通讯失败.\r\nREQUEST={2}\r\nRESPONSE={1}", MethodBase.GetCurrentMethod().Name, respObj, reqObj, pImpl.CurrentOrder?.GetId());
            } // else
            #endregion
            return(err);
        }
Example #2
0
        /// <summary>
        /// 同步创建商品入库单。返回WMS系统响应的XML内容反序列化后的实体, 若执行失败则返回null
        /// </summary>
        /// <param name="pEntryOrderId">对应的主入库单ID</param>
        /// <param name="pRespXmlObj">返回WMS系统响应的XML内容反序列化后的实体, 若执行失败则返回null</param>
        public void EntryOrderCreate(string pEntryOrderId, out HttpRespXmlBase pRespXmlObj)
        {
            C_WMS.Data.Utility.MyLog.Instance.Info("同步创建商品入库单{0},开始", pEntryOrderId);
            string msg = string.Empty;
            HttpRespXml_EntryOrderCreate tmpResp = null;

            using (var trans = new CWmsEntryOrderCreate())
            {
                trans.DoTransaction(out tmpResp, out msg, pEntryOrderId, "");
                pRespXmlObj = tmpResp;
            }
            C_WMS.Data.Utility.MyLog.Instance.Info("同步创建商品入库单{0},结束。返回: \r\nRESPONSE={1}\r\nerrMsg={2}", pEntryOrderId, pRespXmlObj, msg);
        }