Ejemplo n.º 1
0
        /// <summary>
        /// 批量设置 申报失败订单作废
        /// </summary>
        /// <param name="soSysNoList">订单编号列表</param>
        public virtual void BatchOperationUpdateSOStatusToReject(List <int> soSysNoList)
        {
            if (soSysNoList == null || soSysNoList.Count < 1)
            {
                BizExceptionHelper.Throw("SO_BatchOperation_IsNull");
            }
            else
            {
                List <BatchActionItem <int> > actionItemList = new List <BatchActionItem <int> >();
                foreach (int sosysno in soSysNoList)
                {
                    BatchActionItem <int> item = new BatchActionItem <int>();
                    item.Data = sosysno;
                    item.ID   = sosysno.ToString();
                    actionItemList.Add(item);
                }

                BatchActionResult <int> result = BatchActionManager.DoBatchAction <int>(actionItemList, (sosysno) =>
                {
                    var process = ObjectFactory <SOProcessor> .NewInstance();
                    var soInfo  = soProcessor.GetSOBySOSysNo(sosysno);
                    if (soInfo != null)
                    {
                        process.ProcessSO(new SOAction.SOCommandInfo
                        {
                            Command   = SOAction.SOCommand.Abandon,
                            SOInfo    = soInfo,
                            Parameter = new object[] { true, true, null, true, SOStatus.Reject }
                        });
                    }
                });

                result.ThrowErrorException();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 批量设置申报通过
        /// </summary>
        /// <param name="soSysNoList">订单编号列表</param>
        public virtual void BatchOperationUpdateSOStatusToReported(List <int> soSysNoList)
        {
            if (soSysNoList == null || soSysNoList.Count < 1)
            {
                BizExceptionHelper.Throw("SO_BatchOperation_IsNull");
            }
            else
            {
                List <BatchActionItem <int> > actionItemList = new List <BatchActionItem <int> >();
                foreach (int sosysno in soSysNoList)
                {
                    BatchActionItem <int> item = new BatchActionItem <int>();
                    item.Data = sosysno;
                    item.ID   = sosysno.ToString();
                    actionItemList.Add(item);
                }

                BatchActionResult <int> result = BatchActionManager.DoBatchAction <int>(actionItemList, (sosysno) =>
                {
                    ObjectFactory <SOProcessor> .NewInstance().UpdateSOStatusToReported(sosysno);
                });

                result.ThrowErrorException();
            }
        }