public void CreateDssExportHistory(IList <DssExportHistory> dssExportHistoryList, DssOutboundControl dssOutboundControl)
        {
            if (dssExportHistoryList != null && dssExportHistoryList.Count > 0)
            {
                int newMark1 = 0;
                if (dssOutboundControl.Id != 3)
                {
                    newMark1 = dssExportHistoryList.Max(d => d.OriginalId);
                }
                else if (dssOutboundControl.Id == 3)//RCT-TR中取费零星销售的最大ID
                {
                    var dssList = (from dss in dssExportHistoryList where dss.Comments != "ISS-UNP2RCT-TR" select dss).ToList();
                    if (dssList != null && dssList.Count > 0)
                    {
                        newMark1 = dssList.Max(d => d.OriginalId);
                    }
                }
                int newMark2 = 0;
                // bool errFlag = false;
                //  int markID = 0;
                if (dssOutboundControl.Id == 9)
                {
                    Fileter(dssExportHistoryList);                            //ISS-UNP中删除零星销售
                }
                if (dssExportHistoryList != null && dssExportHistoryList.Count > 0)
                {
                    dssExportHistoryMgr.CreateDssExportHistory(dssExportHistoryList);
                    #region
                    //dssExportHistoryList = (from l in dssExportHistoryList orderby l.OriginalId select l).ToList();
                    //try
                    //{
                    //    foreach (DssExportHistory dss in dssExportHistoryList)
                    //    {

                    //        dssExportHistoryMgr.CreateDssExportHistory(dss);
                    //        if (dss.DssExportHistoryDetails != null && dss.DssExportHistoryDetails.Count > 0)
                    //        {
                    //            markID = dss.DssExportHistoryDetails.Max(d => d.OriginalId);
                    //        }
                    //        markID = Math.Max(markID, dss.OriginalId);
                    //    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    errFlag = true;
                    //}
                    #endregion

                    #region New Mark
                    var query = from d in dssExportHistoryList
                                where d.DssExportHistoryDetails != null && d.DssExportHistoryDetails.Count > 0
                                from dd in d.DssExportHistoryDetails
                                select dd;
                    if (query != null && query.Count() > 0)
                    {
                        newMark2 = query.Max(d => d.OriginalId);
                    }
                }
                DssOutboundControl newDssOutboundControl = this.dssOutboundControlMgr.LoadDssOutboundControl(dssOutboundControl.Id);
                newMark1 = Math.Max(newMark1, newDssOutboundControl.Mark);
                //if (!errFlag)
                newDssOutboundControl.Mark = Math.Max(newMark1, newMark2);
                dssOutboundControl.Mark    = newDssOutboundControl.Mark;//修正logBug
                // else
                // newDssOutboundControl.Mark = markID;
                #endregion
                try
                {
                    dssOutboundControlMgr.UpdateDssOutboundControl(newDssOutboundControl);
                }
                catch (Exception ex)
                {
                    log.Error(ex.Message + " Markid" + newDssOutboundControl.Mark);
                    bool isupd = false;
                    int  i     = 0;
                    while (!isupd && i < 100)
                    {
                        dssOutboundControlMgr.UpdateDssOutboundControl(newDssOutboundControl);
                        DssOutboundControl errDSC = this.dssOutboundControlMgr.LoadDssOutboundControl(newDssOutboundControl.Id);
                        i++;
                        if (errDSC.Mark == newDssOutboundControl.Mark)
                        {
                            isupd = true;
                        }
                    }
                }
            }
        }