Exemplo n.º 1
0
        /// <summary>
        /// get entity of WmsLogistics as the logistics of this entryorder represented by _order.
        /// -or- return null if failed in method executation.
        /// </summary>
        /// <returns></returns>
        public virtual WmsLogistics GetLogistics(CWmsOrderBase <TOrderType, TMangoType, TWmsType, TSubOrderType, THandlerType> pOrder)
        {
            Product_PeiSong_ProductMain   deliveryOrder = null;
            CWmsSystemParam_LogisticsItem logistics     = null;
            WmsLogistics retObj = null;

            if (null == pOrder)
            {
                C_WMS.Data.Utility.MyLog.Instance.Warning("Failed in getting entity of WmsLogistics by {0}, pOrder[{1}] is null", typeof(TOrderType), pOrder);
                return(retObj);
            }

            // get entity of deliveryorder by id of entryorder.
            if (null == (deliveryOrder = Mango.MisModelFactory.GetMisEntity <Product_PeiSong_ProductMain>(pOrder.Id)))
            {
                C_WMS.Data.Utility.MyLog.Instance.Warning("Failed in getting entity of WmsLogistics by ID[{0}], CANNOT retrieve deliveryorder by {1}(typeof[{2}])", pOrder?.Id, pOrder, typeof(TOrderType));
            }
            else
            {
                // 根据主配送单中的‘配送人’判读使用第三方物流还是芒果物流
                if (null == (logistics = CWmsMisSystemParamCache.Cache.GetLogisticsByUserId(deliveryOrder.DeliveryUserId.Int().ToString())))
                {
                    retObj = new WmsLogistics(logistics.Code, logistics.Name);
                }
                else
                {
                    C_WMS.Data.Utility.MyLog.Instance.Warning("Failed in getting entity of WmsLogistics by {0}.ID[{1}], CANNOT retrieve cached logistics by [{2}].DeliveryUserId[{3}]. return default logistics.", typeof(TOrderType), pOrder?.Id, deliveryOrder, deliveryOrder.DeliveryUserId);
                    retObj = CWmsDataFactory.GetDefaultLogistic();
                }
            }
            return(retObj);
        } // WmsLogistics GetLogistics()
Exemplo n.º 2
0
        /// <summary>
        /// 更新单据pMangoOrder在Dict709中对应的行的isUpdateOk和isDel. 当pAddOnNotFound为true时,如果Dict709中没有对应的行则插入新行;当pAddOnNotFound为false时,如果Dict709中没有对应的行则操作失败.
        /// 该方法返回WCF的执行结果或TError值
        /// </summary>
        /// <param name="pOrder">待更新的Mis实体对应的单据对象</param>
        /// <param name="pIsUpdateOk">Dict709.IsUpdateOK字段</param>
        /// <param name="pIsDel">Dict709.IsDel字段</param>
        /// <param name="pAddOnNotFound">当pAddOnNotFound为true时,如果Dict709中没有对应的行则插入新行;当pAddOnNotFound为false时,如果Dict709中没有对应的行则操作失败.</param>
        /// <returns></returns>
        virtual public int UpdateDict709(CWmsOrderBase <TOrderType, TMangoType, TWmsType, TSubOrderType, THandlerType> pOrder, TDict285_Values pIsUpdateOk, TDict285_Values pIsDel, bool pAddOnNotFound)
        {
            if (null != AreArray)
            {
                Array.Clear(AreArray, 0, AreArray.Length);
            }
            AreArray = pOrder.SubOrders.Select(x => new AutoResetEvent(false)).ToArray();

            var args = new object[]
            {
                0,                                                                                   // 0st
                pAddOnNotFound,                                                                      // 1st
                new DefDlgt_RunWCF <Product_WMS_Interface>(DlgtFunc_RunWCF <Product_WMS_Interface>), // 2nd
                MangoFactory.GetV_PwiList(pOrder.MapClassId, pOrder.Id, pOrder.SubOrders.Keys),      // 3rd
                pOrder.Id,                                                                           // 4th
                pIsUpdateOk,                                                                         // 5th
                pIsDel                                                                               // 6th
            };

            var dlgt = args[2] as DefDlgt_RunWCF <Product_WMS_Interface>;//  (DlgtFunc_RunWCF<Product_WMS_Interface>);

            dlgt.BeginInvoke((pAddOnNotFound) ? TWCFOperation.EUpdateA : TWCFOperation.EUpdate, args, Acb_RunWCF, args);
            WaitHandle.WaitAll(AreArray);
            return(-1);
        }
Exemplo n.º 3
0
 public virtual CWmsWarehouse GetWarehouse(CWmsOrderBase <TOrderType, TMangoType, TWmsType, TSubOrderType, THandlerType> pOrder)
 {
 }
Exemplo n.º 4
0
 public virtual CWmsWarehouse GetWarehouse(CWmsOrderBase <TOrderType, TMangoType, TWmsType, TSubOrderType, THandlerType> pOrder)
 {
     throw new NotImplementedException("");
 }