Example #1
0
        public override void AfterDo(object bp, ref object result)
        {
            if (result != null
                )
            {
                //HBHTransferSV transSV = bp as HBHTransferSV;

                //if (transSV != null)
                //{
                //    svID = transSV.ID;
                //}

                List <TransferInResultDTO> resultTransfer = result as List <TransferInResultDTO>;
                List <ShipBackDTO>         resultShipBack = result as List <ShipBackDTO>;
                List <SoBackDTO>           resultSOBack   = result as List <SoBackDTO>;

                if (resultTransfer != null)
                {
                    TransferInResultDTO first = resultTransfer.GetFirst();

                    if (first != null)
                    {
                        HBHCommon.HBHCommonSVAfter(svID, resultTransfer, first.IsSuccess, first.ErrorInfo, first.ERPDocNo);
                    }
                }
                else if (resultShipBack != null)
                {
                    if (resultShipBack != null)
                    {
                        ShipBackDTO first = resultShipBack.GetFirst();

                        if (first != null)
                        {
                            HBHCommon.HBHCommonSVAfter(svID, result, first.IsSuccess, first.ErrorInfo, first.ERPDocNo);
                        }
                    }
                }
                else if (resultSOBack != null)
                {
                    if (resultSOBack != null)
                    {
                        SoBackDTO first = resultSOBack.GetFirst();

                        if (first != null)
                        {
                            HBHCommon.HBHCommonSVAfter(svID, result, first.IsSuccess, first.ErrorInfo, first.ERPDocNo);
                        }
                    }
                }
                else
                {
                    HBHCommon.HBHCommonSVAfter(svID, result, true, string.Empty, string.Empty);
                }
            }
        }
        private System.Collections.Generic.List <ShipBackDTO> CreateDispatch(DispatchOutWhCarSV bpObj)
        {
            System.Collections.Generic.List <ShipBackDTO> result = new System.Collections.Generic.List <ShipBackDTO>();
            //object result2;
            try
            {
                if (bpObj.CarShipLineDTOs == null || bpObj.CarShipLineDTOs.Count == 0)
                {
                    string msg = "传入参数不可为空";
                    result.Add(new ShipBackDTO
                    {
                        IsSuccess = false,
                        ErrorInfo = msg,
                        Timestamp = System.DateTime.Now
                    });
                    //result2 = result;
                    HBHCommon.LoggerError(msg);
                }
                else
                {
                    System.Collections.Generic.List <CarShipLineDTO> shiplist       = new System.Collections.Generic.List <CarShipLineDTO>();
                    System.Collections.Generic.List <CarShipLineDTO> transferinlist = new System.Collections.Generic.List <CarShipLineDTO>();
                    string errormessage = this.ValidateParamNullOrEmpty(bpObj, ref shiplist, ref transferinlist);
                    if (!string.IsNullOrEmpty(errormessage))
                    {
                        string msg = "请检查传入参数";
                        result.Add(new ShipBackDTO
                        {
                            IsSuccess = false,
                            ErrorInfo = errormessage + "请检查传入参数",
                            Timestamp = System.DateTime.Now
                        });
                        //result2 = result;
                        HBHCommon.LoggerError(msg);
                    }
                    else
                    {
                        System.Collections.Generic.List <DocKeyDTOData>            shipidlist    = new System.Collections.Generic.List <DocKeyDTOData>();
                        System.Collections.Generic.List <CommonArchiveDataDTOData> transinidlist = new System.Collections.Generic.List <CommonArchiveDataDTOData>();
                        if (shiplist != null && shiplist.Count > 0)
                        {
                            try
                            {
                                CreateShipSVProxy proxy = new CreateShipSVProxy();
                                proxy.ShipDTOs = (this.GetShipDTOList(shiplist));
                                shipidlist     = proxy.Do();

                                // 整车生成开立的出货单;
                            }
                            catch (System.Exception e)
                            {
                                //result.Add(new ShipBackDTO
                                //{
                                //    IsSuccess = false,
                                //    ErrorInfo = "生成出货单失败:" + e.Message,
                                //    Timestamp = System.DateTime.Now
                                //});
                                //result2 = result;
                                //return result2;
                                ShipBackDTO backDTO = new ShipBackDTO();
                                backDTO.IsSuccess = false;
                                backDTO.ErrorInfo = "生成出货单失败:" + e.Message;
                                backDTO.Timestamp = System.DateTime.Now;
                                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                                result.Add(backDTO);
                                return(result);
                            }
                            if (shipidlist == null || shipidlist.Count <= 0)
                            {
                                //result.Add(new ShipBackDTO
                                //{
                                //    IsSuccess = false,
                                //    ErrorInfo = "生单失败:没有生成出货单",
                                //    Timestamp = System.DateTime.Now
                                //});
                                //result2 = result;
                                //return result2;

                                ShipBackDTO backDTO = new ShipBackDTO();
                                backDTO.IsSuccess = false;
                                backDTO.ErrorInfo = "生单失败:没有生成出货单";
                                backDTO.Timestamp = System.DateTime.Now;
                                HBHCommon.LoggerError(backDTO.ErrorInfo);
                                result.Add(backDTO);
                                return(result);
                            }
                        }
                        if (transferinlist != null && transferinlist.Count > 0)
                        {
                            //using (UBFTransactionScope trans = new UBFTransactionScope(TransactionOption.Required))
                            {
                                try
                                {
                                    UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy proxy2 = new UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy();
                                    proxy2.TransferInDTOList = (this.GetTransferInDTOList(transferinlist));
                                    transinidlist            = proxy2.Do();
                                    if (transinidlist == null || transinidlist.Count <= 0)
                                    {
                                        //result.Add(new ShipBackDTO
                                        //{
                                        //    IsSuccess = false,
                                        //    ErrorInfo = "生单失败:没有生成调入单",
                                        //    Timestamp = System.DateTime.Now
                                        //});
                                        //result2 = result;
                                        //return result2;

                                        ShipBackDTO backDTO = new ShipBackDTO();
                                        backDTO.IsSuccess = false;
                                        backDTO.ErrorInfo = "生单失败:没有生成调入单";
                                        backDTO.Timestamp = System.DateTime.Now;
                                        HBHCommon.LoggerError(backDTO.ErrorInfo);
                                        result.Add(backDTO);
                                        return(result);
                                    }
                                    TransferInBatchApproveSRVProxy approveproxy = new TransferInBatchApproveSRVProxy();
                                    approveproxy.DocList    = (transinidlist);
                                    approveproxy.ApprovedBy = (Context.LoginUser);
                                    approveproxy.ApprovedOn = (System.DateTime.Now);
                                    approveproxy.Do();
                                    //trans.Commit();
                                }
                                catch (System.Exception e)
                                {
                                    //trans.Rollback();
                                    //result.Add(new ShipBackDTO
                                    //{
                                    //    IsSuccess = false,
                                    //    ErrorInfo = "生成调入单失败:" + e.Message,
                                    //    Timestamp = System.DateTime.Now
                                    //});
                                    //result2 = result;
                                    //return result2;
                                    ShipBackDTO backDTO = new ShipBackDTO();
                                    backDTO.IsSuccess = false;
                                    backDTO.ErrorInfo = "生成调入单失败:" + e.Message;
                                    backDTO.Timestamp = System.DateTime.Now;
                                    HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                                    result.Add(backDTO);
                                    return(result);
                                }
                            }
                        }
                        foreach (DocKeyDTOData shipid in shipidlist)
                        {
                            Ship ship = Ship.Finder.FindByID(shipid.DocID);
                            if (ship != null)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单出货单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo  = shipid.DocNO,
                                    DMSDocNo  = ship.DescFlexField.PubDescSeg7
                                });
                            }
                        }
                        foreach (CommonArchiveDataDTOData transin in transinidlist)
                        {
                            TransferIn t = TransferIn.Finder.FindByID(transin.ID);
                            if (t != null)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单调入单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo  = transin.Code,
                                    DMSDocNo  = t.TransInLines[0].DescFlexSegments.PubDescSeg5
                                });
                            }
                        }
                        //result2 = result;
                    }
                }
            }
            catch (System.Exception e)
            {
                //result.Add(new ShipBackDTO
                //{
                //    IsSuccess = false,
                //    ErrorInfo = e.Message,
                //    Timestamp = System.DateTime.Now
                //});
                //result2 = result;

                ShipBackDTO backDTO = new ShipBackDTO();
                backDTO.IsSuccess = false;
                backDTO.ErrorInfo = e.Message;
                backDTO.Timestamp = System.DateTime.Now;
                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                result.Add(backDTO);
            }
            //return result2;
            return(result);
        }
        private System.Collections.Generic.List<ShipBackDTO> CreateDispatch(DispatchOutWhCarSV bpObj)
        {
            System.Collections.Generic.List<ShipBackDTO> result = new System.Collections.Generic.List<ShipBackDTO>();
            //object result2;
            try
            {
                if (bpObj.CarShipLineDTOs == null || bpObj.CarShipLineDTOs.Count == 0)
                {
                    string msg = "传入参数不可为空";
                    result.Add(new ShipBackDTO
                    {
                        IsSuccess = false,
                        ErrorInfo = msg,
                        Timestamp = System.DateTime.Now
                    });
                    //result2 = result;
                    HBHCommon.LoggerError(msg);
                }
                else
                {
                    System.Collections.Generic.List<CarShipLineDTO> shiplist = new System.Collections.Generic.List<CarShipLineDTO>();
                    System.Collections.Generic.List<CarShipLineDTO> transferinlist = new System.Collections.Generic.List<CarShipLineDTO>();
                    string errormessage = this.ValidateParamNullOrEmpty(bpObj, ref shiplist, ref transferinlist);
                    if (!string.IsNullOrEmpty(errormessage))
                    {
                        string msg = "请检查传入参数";
                        result.Add(new ShipBackDTO
                        {
                            IsSuccess = false,
                            ErrorInfo = errormessage + "请检查传入参数",
                            Timestamp = System.DateTime.Now
                        });
                        //result2 = result;
                        HBHCommon.LoggerError(msg);
                    }
                    else
                    {
                        System.Collections.Generic.List<DocKeyDTOData> shipidlist = new System.Collections.Generic.List<DocKeyDTOData>();
                        System.Collections.Generic.List<CommonArchiveDataDTOData> transinidlist = new System.Collections.Generic.List<CommonArchiveDataDTOData>();
                        if (shiplist != null && shiplist.Count > 0)
                        {
                            try
                            {
                                CreateShipSVProxy proxy = new CreateShipSVProxy();
                                proxy.ShipDTOs = (this.GetShipDTOList(shiplist));
                                shipidlist = proxy.Do();

                                // 整车生成开立的出货单;
                            }
                            catch (System.Exception e)
                            {
                                //result.Add(new ShipBackDTO
                                //{
                                //    IsSuccess = false,
                                //    ErrorInfo = "生成出货单失败:" + e.Message,
                                //    Timestamp = System.DateTime.Now
                                //});
                                //result2 = result;
                                //return result2;
                                ShipBackDTO backDTO = new ShipBackDTO();
                                backDTO.IsSuccess = false;
                                backDTO.ErrorInfo = "生成出货单失败:" + e.Message;
                                backDTO.Timestamp = System.DateTime.Now;
                                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                                result.Add(backDTO);
                                return result;
                            }
                            if (shipidlist == null || shipidlist.Count <= 0)
                            {
                                //result.Add(new ShipBackDTO
                                //{
                                //    IsSuccess = false,
                                //    ErrorInfo = "生单失败:没有生成出货单",
                                //    Timestamp = System.DateTime.Now
                                //});
                                //result2 = result;
                                //return result2;

                                ShipBackDTO backDTO = new ShipBackDTO();
                                backDTO.IsSuccess = false;
                                backDTO.ErrorInfo = "生单失败:没有生成出货单";
                                backDTO.Timestamp = System.DateTime.Now;
                                HBHCommon.LoggerError(backDTO.ErrorInfo );
                                result.Add(backDTO);
                                return result;
                            }
                        }
                        if (transferinlist != null && transferinlist.Count > 0)
                        {
                            //using (UBFTransactionScope trans = new UBFTransactionScope(TransactionOption.Required))
                            {
                                try
                                {
                                    UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy proxy2 = new UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy();
                                    proxy2.TransferInDTOList = (this.GetTransferInDTOList(transferinlist));
                                    transinidlist = proxy2.Do();
                                    if (transinidlist == null || transinidlist.Count <= 0)
                                    {
                                        //result.Add(new ShipBackDTO
                                        //{
                                        //    IsSuccess = false,
                                        //    ErrorInfo = "生单失败:没有生成调入单",
                                        //    Timestamp = System.DateTime.Now
                                        //});
                                        //result2 = result;
                                        //return result2;

                                        ShipBackDTO backDTO = new ShipBackDTO();
                                        backDTO.IsSuccess = false;
                                        backDTO.ErrorInfo = "生单失败:没有生成调入单";
                                        backDTO.Timestamp = System.DateTime.Now;
                                        HBHCommon.LoggerError(backDTO.ErrorInfo);
                                        result.Add(backDTO);
                                        return result;
                                    }
                                    TransferInBatchApproveSRVProxy approveproxy = new TransferInBatchApproveSRVProxy();
                                    approveproxy.DocList = (transinidlist);
                                    approveproxy.ApprovedBy = (Context.LoginUser);
                                    approveproxy.ApprovedOn = (System.DateTime.Now);
                                    approveproxy.Do();
                                    //trans.Commit();
                                }
                                catch (System.Exception e)
                                {
                                    //trans.Rollback();
                                    //result.Add(new ShipBackDTO
                                    //{
                                    //    IsSuccess = false,
                                    //    ErrorInfo = "生成调入单失败:" + e.Message,
                                    //    Timestamp = System.DateTime.Now
                                    //});
                                    //result2 = result;
                                    //return result2;
                                    ShipBackDTO backDTO = new ShipBackDTO();
                                    backDTO.IsSuccess = false;
                                    backDTO.ErrorInfo = "生成调入单失败:" + e.Message;
                                    backDTO.Timestamp = System.DateTime.Now;
                                    HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                                    result.Add(backDTO);
                                    return result;
                                }
                            }
                        }
                        foreach (DocKeyDTOData shipid in shipidlist)
                        {
                            Ship ship = Ship.Finder.FindByID(shipid.DocID);
                            if (ship != null)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单出货单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo = shipid.DocNO,
                                    DMSDocNo = ship.DescFlexField.PubDescSeg7
                                });
                            }
                        }
                        foreach (CommonArchiveDataDTOData transin in transinidlist)
                        {
                            TransferIn t = TransferIn.Finder.FindByID(transin.ID);
                            if (t != null)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单调入单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo = transin.Code,
                                    DMSDocNo = t.TransInLines[0].DescFlexSegments.PubDescSeg5
                                });
                            }
                        }
                        //result2 = result;
                    }
                }
            }
            catch (System.Exception e)
            {
                //result.Add(new ShipBackDTO
                //{
                //    IsSuccess = false,
                //    ErrorInfo = e.Message,
                //    Timestamp = System.DateTime.Now
                //});
                //result2 = result;

                ShipBackDTO backDTO = new ShipBackDTO();
                backDTO.IsSuccess = false;
                backDTO.ErrorInfo = e.Message;
                backDTO.Timestamp = System.DateTime.Now;
                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                result.Add(backDTO);
            }
            //return result2;
            return result;
        }
Example #4
0
        private List<ShipBackDTO> CreateRMA(CreateRMASV bpObj)
        {
            System.Collections.Generic.List<ShipBackDTO> result = new System.Collections.Generic.List<ShipBackDTO>();
            //object result2;
            try
            {
                if (bpObj.RMALineDTOs == null || bpObj.RMALineDTOs.Count == 0)
                {
                    //result.Add(new ShipBackDTO
                    //{
                    //    IsSuccess = false,
                    //    ErrorInfo = "传入参数不可为空",
                    //    Timestamp = System.DateTime.Now
                    //});
                    //result2 = result;

                    ShipBackDTO backDTO = new ShipBackDTO();
                    backDTO.IsSuccess = false;
                    backDTO.ErrorInfo = "传入参数不可为空";
                    backDTO.Timestamp = System.DateTime.Now;
                    HBHCommon.LoggerError(backDTO.ErrorInfo);
                    result.Add(backDTO);
                }
                else
                {
                    string errormessage = this.ValidateParamNullOrEmpty(bpObj);
                    if (!string.IsNullOrEmpty(errormessage))
                    {
                        //result.Add(new ShipBackDTO
                        //{
                        //    IsSuccess = false,
                        //    ErrorInfo = errormessage + "请检查传入参数",
                        //    Timestamp = System.DateTime.Now
                        //});
                        //result2 = result;
                        ShipBackDTO backDTO = new ShipBackDTO();
                        backDTO.IsSuccess = false;
                        backDTO.ErrorInfo = errormessage + "请检查传入参数" ;
                        backDTO.Timestamp = System.DateTime.Now;
                        HBHCommon.LoggerError(backDTO.ErrorInfo);
                        result.Add(backDTO);
                    }
                    else
                    {
                        System.Collections.Generic.List<DocKeyDTOData> rmaidlist = null;
                        try
                        {
                            CreateRMASRVProxy proxy = new CreateRMASRVProxy();
                            proxy.RMADTOs = (this.GetRMADTOList(bpObj));
                            //proxy.ContextDTO = (new ContextDTOData());
                            //proxy.ContextDTO.OrgID = (Context.LoginOrg.ID);
                            //proxy.ContextDTO.OrgCode = (Context.LoginOrg.Code);
                            //proxy.ContextDTO.EntCode = (bpObj.RMALineDTOs[0].EnterpriseCode);
                            //proxy.ContextDTO.UserID = (long.Parse(Context.LoginUserID));
                            //proxy.ContextDTO.UserCode = (Context.LoginUser);
                            //proxy.ContextDTO.CultureName = (Context.LoginLanguageCode);
                            rmaidlist = proxy.Do();
                        }
                        catch (System.Exception e)
                        {
                            //result.Add(new ShipBackDTO
                            //{
                            //    IsSuccess = false,
                            //    ErrorInfo = "生单失败:" + e.Message,
                            //    Timestamp = System.DateTime.Now
                            //});
                            //result2 = result;
                            //return result2;

                            ShipBackDTO backDTO = new ShipBackDTO();
                            backDTO.IsSuccess = false;
                            backDTO.ErrorInfo = "生单失败:" + e.Message;
                            backDTO.Timestamp = System.DateTime.Now;
                            HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                            result.Add(backDTO);
                            return result;
                        }
                        if (rmaidlist == null || rmaidlist.Count <= 0)
                        {
                            //result.Add(new ShipBackDTO
                            //{
                            //    IsSuccess = false,
                            //    ErrorInfo = "生单失败:没有生成退回处理单",
                            //    Timestamp = System.DateTime.Now
                            //});
                            //result2 = result;

                            ShipBackDTO backDTO = new ShipBackDTO();
                            backDTO.IsSuccess = false;
                            backDTO.ErrorInfo = "生单失败:没有生成退回处理单";
                            backDTO.Timestamp = System.DateTime.Now;
                            HBHCommon.LoggerError(backDTO.ErrorInfo);
                            result.Add(backDTO);
                        }
                        else
                        {
                            foreach (DocKeyDTOData rmaid in rmaidlist)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo = rmaid.DocNO
                                });
                            }
                            //result2 = result;
                        }
                    }
                }
            }
            catch (System.Exception e)
            {
                //result.Add(new ShipBackDTO
                //{
                //    IsSuccess = false,
                //    ErrorInfo = e.Message,
                //    Timestamp = System.DateTime.Now
                //});
                //result2 = result;

                ShipBackDTO backDTO = new ShipBackDTO();
                backDTO.IsSuccess = false;
                backDTO.ErrorInfo = e.Message;
                backDTO.Timestamp = System.DateTime.Now;
                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                result.Add(backDTO);
            }
            //return result2;
            return result;
        }
Example #5
0
        private List <ShipBackDTO> CreateRMA(CreateRMASV bpObj)
        {
            System.Collections.Generic.List <ShipBackDTO> result = new System.Collections.Generic.List <ShipBackDTO>();
            //object result2;
            try
            {
                if (bpObj.RMALineDTOs == null || bpObj.RMALineDTOs.Count == 0)
                {
                    //result.Add(new ShipBackDTO
                    //{
                    //    IsSuccess = false,
                    //    ErrorInfo = "传入参数不可为空",
                    //    Timestamp = System.DateTime.Now
                    //});
                    //result2 = result;

                    ShipBackDTO backDTO = new ShipBackDTO();
                    backDTO.IsSuccess = false;
                    backDTO.ErrorInfo = "传入参数不可为空";
                    backDTO.Timestamp = System.DateTime.Now;
                    HBHCommon.LoggerError(backDTO.ErrorInfo);
                    result.Add(backDTO);
                }
                else
                {
                    string errormessage = this.ValidateParamNullOrEmpty(bpObj);
                    if (!string.IsNullOrEmpty(errormessage))
                    {
                        //result.Add(new ShipBackDTO
                        //{
                        //    IsSuccess = false,
                        //    ErrorInfo = errormessage + "请检查传入参数",
                        //    Timestamp = System.DateTime.Now
                        //});
                        //result2 = result;
                        ShipBackDTO backDTO = new ShipBackDTO();
                        backDTO.IsSuccess = false;
                        backDTO.ErrorInfo = errormessage + "请检查传入参数";
                        backDTO.Timestamp = System.DateTime.Now;
                        HBHCommon.LoggerError(backDTO.ErrorInfo);
                        result.Add(backDTO);
                    }
                    else
                    {
                        System.Collections.Generic.List <DocKeyDTOData> rmaidlist = null;
                        try
                        {
                            CreateRMASRVProxy proxy = new CreateRMASRVProxy();
                            proxy.RMADTOs = (this.GetRMADTOList(bpObj));
                            //proxy.ContextDTO = (new ContextDTOData());
                            //proxy.ContextDTO.OrgID = (Context.LoginOrg.ID);
                            //proxy.ContextDTO.OrgCode = (Context.LoginOrg.Code);
                            //proxy.ContextDTO.EntCode = (bpObj.RMALineDTOs[0].EnterpriseCode);
                            //proxy.ContextDTO.UserID = (long.Parse(Context.LoginUserID));
                            //proxy.ContextDTO.UserCode = (Context.LoginUser);
                            //proxy.ContextDTO.CultureName = (Context.LoginLanguageCode);
                            rmaidlist = proxy.Do();
                        }
                        catch (System.Exception e)
                        {
                            //result.Add(new ShipBackDTO
                            //{
                            //    IsSuccess = false,
                            //    ErrorInfo = "生单失败:" + e.Message,
                            //    Timestamp = System.DateTime.Now
                            //});
                            //result2 = result;
                            //return result2;

                            ShipBackDTO backDTO = new ShipBackDTO();
                            backDTO.IsSuccess = false;
                            backDTO.ErrorInfo = "生单失败:" + e.Message;
                            backDTO.Timestamp = System.DateTime.Now;
                            HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                            result.Add(backDTO);
                            return(result);
                        }
                        if (rmaidlist == null || rmaidlist.Count <= 0)
                        {
                            //result.Add(new ShipBackDTO
                            //{
                            //    IsSuccess = false,
                            //    ErrorInfo = "生单失败:没有生成退回处理单",
                            //    Timestamp = System.DateTime.Now
                            //});
                            //result2 = result;

                            ShipBackDTO backDTO = new ShipBackDTO();
                            backDTO.IsSuccess = false;
                            backDTO.ErrorInfo = "生单失败:没有生成退回处理单";
                            backDTO.Timestamp = System.DateTime.Now;
                            HBHCommon.LoggerError(backDTO.ErrorInfo);
                            result.Add(backDTO);
                        }
                        else
                        {
                            foreach (DocKeyDTOData rmaid in rmaidlist)
                            {
                                result.Add(new ShipBackDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo  = rmaid.DocNO
                                });
                            }
                            //result2 = result;
                        }
                    }
                }
            }
            catch (System.Exception e)
            {
                //result.Add(new ShipBackDTO
                //{
                //    IsSuccess = false,
                //    ErrorInfo = e.Message,
                //    Timestamp = System.DateTime.Now
                //});
                //result2 = result;

                ShipBackDTO backDTO = new ShipBackDTO();
                backDTO.IsSuccess = false;
                backDTO.ErrorInfo = e.Message;
                backDTO.Timestamp = System.DateTime.Now;
                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                result.Add(backDTO);
            }
            //return result2;
            return(result);
        }