private List<TransferInResultDTO> CreateTransferIn(CreateApprovedTransferInSV bpObj)
        {
            System.Collections.Generic.List<TransferInResultDTO> result = new System.Collections.Generic.List<TransferInResultDTO>();
            //object result2;
            try
            {
                if (bpObj.TransferInLineDTOList == null || bpObj.TransferInLineDTOList.Count == 0)
                {
                    //result.Add(new TransferInResultDTO
                    //{
                    //    IsSuccess = false,
                    //    ErrorInfo = "传入参数不可为空",
                    //    Timestamp = System.DateTime.Now
                    //});
                    //result2 = result;

                    TransferInResultDTO backDTO = new TransferInResultDTO();
                    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 TransferInResultDTO
                        //{
                        //    IsSuccess = false,
                        //    ErrorInfo = errormessage + "请检查传入参数",
                        //    Timestamp = System.DateTime.Now
                        //});
                        //result2 = result;

                        TransferInResultDTO backDTO = new TransferInResultDTO();
                        backDTO.IsSuccess = false;
                        backDTO.ErrorInfo = errormessage + "请检查传入参数";
                        backDTO.Timestamp = System.DateTime.Now;
                        HBHCommon.LoggerError(backDTO.ErrorInfo);
                    }
                    else
                    {
                        System.Collections.Generic.List<CommonArchiveDataDTOData> transinidlist;
                        //using (UBFTransactionScope trans = new UBFTransactionScope(TransactionOption.Required))
                        {
                            try
                            {
                                UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy proxy = new UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy();
                                proxy.TransferInDTOList = (this.GetTransferInDTOList(bpObj));
                                transinidlist = proxy.Do();
                                if (transinidlist == null || transinidlist.Count <= 0)
                                {
                                    //result.Add(new TransferInResultDTO
                                    //{
                                    //    IsSuccess = false,
                                    //    ErrorInfo = "生单失败:没有生成调入单",
                                    //    Timestamp = System.DateTime.Now
                                    //});
                                    //result2 = result;
                                    //return result2;

                                    TransferInResultDTO backDTO = new TransferInResultDTO();
                                    backDTO.IsSuccess = false;
                                    backDTO.ErrorInfo = "生单失败:没有生成调入单";
                                    backDTO.Timestamp = System.DateTime.Now;
                                    HBHCommon.LoggerError(backDTO.ErrorInfo );
                                    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 TransferInResultDTO
                                //{
                                //    IsSuccess = false,
                                //    ErrorInfo = "生单失败:" + e.Message,
                                //    Timestamp = System.DateTime.Now
                                //});
                                //result2 = result;
                                //return result2;

                                TransferInResultDTO backDTO = new TransferInResultDTO();
                                backDTO.IsSuccess = false;
                                backDTO.ErrorInfo = "生单失败:" + e.Message;
                                backDTO.Timestamp = System.DateTime.Now;
                                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
                                return result;
                            }
                        }
                        foreach (CommonArchiveDataDTOData transin in transinidlist)
                        {
                            TransferIn t = TransferIn.Finder.FindByID(transin.ID);
                            if (t != null)
                            {
                                result.Add(new TransferInResultDTO
                                {
                                    IsSuccess = true,
                                    ErrorInfo = "生单成功",
                                    Timestamp = System.DateTime.Now,
                                    ERPDocNo = transin.Code,
                                    TransDocNo = t.DescFlexField.PrivateDescSeg4
                                });
                            }
                        }
                        //result2 = result;
                    }
                }
            }
            catch (System.Exception e)
            {
                //result.Add(new TransferInResultDTO
                //{
                //    IsSuccess = false,
                //    ErrorInfo = e.Message,
                //    Timestamp = System.DateTime.Now
                //});
                //result2 = result;

                TransferInResultDTO backDTO = new TransferInResultDTO();
                backDTO.IsSuccess = false;
                backDTO.ErrorInfo = e.Message;
                backDTO.Timestamp = System.DateTime.Now;
                HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace);
            }
            //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;
        }