コード例 #1
0
        public IHttpActionResult GetOnline(string projectID)
        {
            var closure    = ClosureInfo.GetByProjectId(projectID);
            var store      = StoreBasicInfo.GetStore(closure.USCode);
            var toolEntity = ClosureTool.Get(closure.ProjectId);
            var woEntity   = ClosureWOCheckList.Get(closure.ProjectId);

            List <StoreBEInfo> remoteBeList   = new List <StoreBEInfo>();
            List <StoreBEInfo> attachedBeList = new List <StoreBEInfo>();
            StoreBEInfo        mds            = null;
            StoreBEInfo        mcCafe         = null;
            StoreBEInfo        hour24         = null;

            if (store.StoreBEInfoList.Count > 0)
            {
                foreach (var beInfo in store.StoreBEInfoList)
                {
                    switch (beInfo.BETypeName)
                    {
                    case "Remote Kiosk":
                        remoteBeList.Add(beInfo);
                        break;

                    case "Attach Kiosk":
                        attachedBeList.Add(beInfo);
                        break;

                    case "MDS":
                        mds = beInfo;
                        break;

                    case "McCafe":
                        mcCafe = beInfo;
                        break;

                    case "24 Hour":
                        hour24 = beInfo;
                        break;
                    }
                }
            }
            return(Ok(new
            {
                Store = store,
                ClosureTool = toolEntity,
                WOCheckList = woEntity,
                RemoteBeList = remoteBeList,
                AttachedBeList = attachedBeList,
                MDS = mds,
                McCafe = mcCafe,
                Hour24 = hour24
            }));
        }
コード例 #2
0
        public IHttpActionResult DownLoadTemplate(string projectID)
        {
            var    current = System.Web.HttpContext.Current;
            string path    = SiteFilePath.Template_DIRECTORY + "\\" + SiteFilePath.Executive_Summary_Template;

            string tempFilePath = current.Server.MapPath("~/") + "Temp\\" + Guid.NewGuid() + ".xlsx";

            File.Copy(path, tempFilePath);
            var fileInfo      = new FileInfo(tempFilePath);
            var excelDirector = new ExcelDataInputDirector(fileInfo, ExcelDataInputType.ClosureExecutiveSummary);

            var closure   = ClosureInfo.GetByProjectId(projectID);
            var store     = StoreBasicInfo.GetStore(closure.USCode);
            var inputInfo = new ExcelInputDTO
            {
                StoreNameCN   = store.StoreBasicInfo.NameZHCN,
                USCode        = store.StoreBasicInfo.StoreCode,
                City          = store.StoreBasicInfo.CityENUS,
                Market        = store.StoreBasicInfo.MarketENUS,
                OpenDate      = store.StoreBasicInfo.OpenDate,
                Floor         = store.StoreSTLocation.Floor,
                TotalArea     = store.StoreSTLocation.TotalArea,
                TotalSeatsNo  = store.StoreSTLocation.TotalSeatsNo,
                BE            = store.StoreBEInfoList.Count,
                RentType      = store.StoreContractInfo.RentType,
                RentStructure = store.StoreContractInfo.RentStructure
            };


            var leaseRecapID = StoreContractInfo.SearchByProject(projectID).FirstOrDefault().LeaseRecapID ?? 0;
            var storeAtt     = StoreContractInfoAttached.Search(c => c.LeaseRecapID == leaseRecapID.ToString()).OrderByDescending(e => e.CreateDate).FirstOrDefault();

            if (storeAtt != null)
            {
                inputInfo.LeasingTerm = store.StoreContractInfo.LeasePurchaseTerm;
            }
            if (store.StoreContractInfo.RentCommencementDate.HasValue)
            {
                inputInfo.RentCommencementDate = store.StoreContractInfo.RentCommencementDate.Value;
            }

            if (store.StoreContractInfo.EndDate.HasValue)
            {
                inputInfo.LeaseExpirationDate = store.StoreContractInfo.EndDate.Value;
            }


            var toolEntity = ClosureTool.Get(closure.ProjectId);

            if (toolEntity != null)
            {
                if (toolEntity.TotalSales_Adjustment_RMB != null)
                {
                    inputInfo.TotalSales_TTM = string.Format("{0:f}", toolEntity.TotalSales_Adjustment_RMB);
                }
                if (toolEntity.CompSales_Adjustment != null)
                {
                    inputInfo.SalesComp_TTM = string.Format("{0:f}", toolEntity.CompSales_Adjustment);
                }
                if (toolEntity.CompCG_Adjustment != null)
                {
                    inputInfo.GCComp_TTM = string.Format("{0:f}", toolEntity.CompCG_Adjustment);
                }
                if (toolEntity.PAC_RMB_Adjustment != null)
                {
                    inputInfo.PAC_TTM = string.Format("{0:f}", toolEntity.PAC_RMB_Adjustment);
                }
                if (toolEntity.SOI_Adjustment != null)
                {
                    inputInfo.SOI_TTM = string.Format("{0:f}", toolEntity.SOI_Adjustment);
                }
                if (toolEntity.CashFlow_RMB_Adjustment != null)
                {
                    inputInfo.CASHFLOW_TTM = string.Format("{0:f}", toolEntity.CashFlow_RMB_Adjustment);
                }
                if (toolEntity.TotalSales_TTMY1 != null)
                {
                    inputInfo.TotalSales_TTMY1 = string.Format("{0:f}", toolEntity.TotalSales_TTMY1);
                }
                if (toolEntity.CompSales_TTMY1 != null)
                {
                    inputInfo.CompSales_TTMY1 = string.Format("{0:f}", toolEntity.CompSales_TTMY1);
                }
                if (toolEntity.CompGC_TTMY1 != null)
                {
                    inputInfo.CompGC_TTMY1 = string.Format("{0:f}", toolEntity.CompGC_TTMY1);
                }
                if (toolEntity.PAC_TTMY1 != null)
                {
                    inputInfo.PAC_TTMY1 = string.Format("{0:f}", toolEntity.PAC_TTMY1);
                }
                if (toolEntity.SOI_TTMY1 != null)
                {
                    inputInfo.SOI_TTMY1 = string.Format("{0:f}", toolEntity.SOI_TTMY1);
                }
                if (toolEntity.CashFlow_TTMY1 != null)
                {
                    inputInfo.CashFlow_TTMY1 = string.Format("{0:f}", toolEntity.CashFlow_TTMY1);
                }
                if (toolEntity.TotalSales_TTMY2 != null)
                {
                    inputInfo.TotalSales_TTMY2 = string.Format("{0:f}", toolEntity.TotalSales_TTMY2);
                }
                if (toolEntity.CompSales_TTMY2 != null)
                {
                    inputInfo.CompSales_TTMY2 = string.Format("{0:f}", toolEntity.CompSales_TTMY2);
                }
                if (toolEntity.CompGC_TTMY2 != null)
                {
                    inputInfo.CompGC_TTMY2 = string.Format("{0:f}", toolEntity.CompGC_TTMY2);
                }
                if (toolEntity.PAC_TTMY2 != null)
                {
                    inputInfo.PAC_TTMY2 = string.Format("{0:f}", toolEntity.PAC_TTMY2);
                }
                if (toolEntity.SOI_TTMY2 != null)
                {
                    inputInfo.SOI_TTMY2 = string.Format("{0:f}", toolEntity.SOI_TTMY2);
                }
                if (toolEntity.CashFlow_TTMY2 != null)
                {
                    inputInfo.CashFlow_TTMY2 = string.Format("{0:f}", toolEntity.CashFlow_TTMY2);
                }


                List <StoreBEInfo> remoteBeList   = new List <StoreBEInfo>();
                List <StoreBEInfo> attachedBeList = new List <StoreBEInfo>();
                StoreBEInfo        mds            = null;
                StoreBEInfo        mcCafe         = null;
                StoreBEInfo        hour24         = null;
                if (store.StoreBEInfoList.Count > 0)
                {
                    foreach (var beInfo in store.StoreBEInfoList)
                    {
                        switch (beInfo.BETypeName)
                        {
                        case "Remote Kiosk":
                            remoteBeList.Add(beInfo);
                            break;

                        case "Attached Kiosk":
                            attachedBeList.Add(beInfo);
                            break;

                        case "MDS":
                            mds = beInfo;
                            break;

                        case "McCafe":
                            mcCafe = beInfo;
                            break;

                        case "24 Hour":
                            hour24 = beInfo;
                            break;
                        }
                    }
                }
                if (remoteBeList.Count > 0)
                {
                    inputInfo.RemoteKiosk1_Status   = remoteBeList[0].IsSingleContract == 1 ? "Yes" : "No";
                    inputInfo.RemoteKiosk1_OpenDate = remoteBeList[0].LaunchDate;
                    if (remoteBeList.Count > 1)
                    {
                        inputInfo.RemoteKiosk2_Status   = remoteBeList[1].IsSingleContract == 1 ? "Yes" : "No";
                        inputInfo.RemoteKiosk2_OpenDate = remoteBeList[1].LaunchDate;

                        if (remoteBeList.Count > 2)
                        {
                            inputInfo.RemoteKiosk3_Status   = remoteBeList[2].IsSingleContract == 1 ? "Yes" : "No";
                            inputInfo.RemoteKiosk3_OpenDate = remoteBeList[2].LaunchDate;
                        }
                    }
                }

                if (attachedBeList.Count > 0)
                {
                    inputInfo.AttachedKiosk1_Status   = attachedBeList[0].IsSingleContract == 1 ? "Yes" : "No";
                    inputInfo.AttachedKiosk1_OpenDate = attachedBeList[0].LaunchDate;
                    if (attachedBeList.Count > 1)
                    {
                        inputInfo.AttachedKiosk2_Status   = attachedBeList[1].IsSingleContract == 1 ? "Yes" : "No";
                        inputInfo.AttachedKiosk2_OpenDate = attachedBeList[1].LaunchDate;

                        if (attachedBeList.Count > 2)
                        {
                            inputInfo.AttachedKiosk3_Status   = attachedBeList[2].IsSingleContract == 1 ? "Yes" : "No";
                            inputInfo.AttachedKiosk3_OpenDate = attachedBeList[2].LaunchDate;
                        }
                    }
                }
                if (mds != null)
                {
                    inputInfo.MDS_Status   = mds.IsSingleContract == 1 ? "Yes" : "No";
                    inputInfo.MDS_OpenDate = mds.LaunchDate;
                }
                if (mcCafe != null)
                {
                    inputInfo.McCafe_Status   = mcCafe.IsSingleContract == 1 ? "Yes" : "No";
                    inputInfo.McCafe_OpenDate = mcCafe.LaunchDate;
                }
                if (hour24 != null)
                {
                    inputInfo.TwentyFourHour_Status   = hour24.IsSingleContract == 1 ? "Yes" : "No";
                    inputInfo.TwentyFourHour_OpenDate = hour24.LaunchDate;
                }


                var woEntity = ClosureWOCheckList.Get(closure.ProjectId);
                if (woEntity != null)
                {
                    if (woEntity.LHI_NBV != null)
                    {
                        inputInfo.LHI_NBV = string.Format("{0:f}", woEntity.LHI_NBV);
                    }
                    if (woEntity.ESSD_NBV != null)
                    {
                        inputInfo.ESSD_NBV = string.Format("{0:f}", woEntity.ESSD_NBV);
                    }
                    if (woEntity.TotalCost_NBV != null)
                    {
                        inputInfo.TotalCost_NBV = string.Format("{0:f}", woEntity.TotalCost_NBV);
                    }
                }
            }

            excelDirector.Input(inputInfo);


            current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + DataConverter.ToHexString(SiteFilePath.Executive_Summary_Template));
            current.Response.ContentType = "application/octet-stream";
            current.Response.WriteFile("" + tempFilePath + "");
            current.Response.End();
            return(Ok());
        }
コード例 #3
0
        public IHttpActionResult GenExecutiveSummaty(ClosureExecutiveSummary entity)
        {
            if (!ClosureExecutiveSummary.Any(i => i.ProjectId == entity.ProjectId && i.IsHistory == false))
            {
                if (entity.Id == Guid.Empty || entity.Id == null)
                {
                    entity.Id = Guid.NewGuid();
                }
                entity.CreateTime     = DateTime.Now;
                entity.CreatorAccount = ClientCookie.UserCode;
                ClosureExecutiveSummary.Add(entity);
            }
            else
            {
                ClosureExecutiveSummary.Update(entity);
            }

            var    current          = System.Web.HttpContext.Current;
            string path             = SiteFilePath.Template_DIRECTORY + "\\" + SiteFilePath.Executive_Summary_Template;
            string internalFileName = Guid.NewGuid() + ".xlsx";
            string filePath         = SiteFilePath.UploadFiles_DIRECTORY + "\\" + internalFileName;

            File.Copy(path, filePath);
            var fileInfo         = new FileInfo(filePath);
            var excelPMTDirector = new ExcelDataInputDirector(fileInfo, ExcelDataInputType.ClosureExecutiveSummary);

            var closure   = ClosureInfo.GetByProjectId(entity.ProjectId);
            var store     = StoreBasicInfo.GetStore(closure.USCode);
            var inputInfo = new ExcelInputDTO
            {
                StoreNameCN        = store.StoreBasicInfo.NameZHCN,
                USCode             = store.StoreBasicInfo.StoreCode,
                City               = store.StoreBasicInfo.CityENUS,
                Market             = store.StoreBasicInfo.MarketENUS,
                OpenDate           = store.StoreBasicInfo.OpenDate,
                Floor              = store.StoreSTLocation.Floor,
                TotalArea          = store.StoreSTLocation.TotalArea,
                TotalSeatsNo       = store.StoreSTLocation.TotalSeatsNo,
                BE                 = store.StoreBEInfoList.Count,
                RentType           = store.StoreContractInfo.RentType,
                RentStructure      = store.StoreContractInfo.RentStructure,
                MiniMarket         = entity.MiniMarket,
                StoreLocation      = entity.StoreLocation,
                CurrentSituation   = entity.CurrentSituation,
                NegotiationHistory = entity.NegotiationHistory,
                ProposedSolution   = entity.ProposedSolution,
                SalesTransfer      = entity.SalesTransfer
            };


            var leaseRecapID = StoreContractInfo.SearchByProject(entity.ProjectId).FirstOrDefault().LeaseRecapID ?? 0;
            var storeAtt     = StoreContractInfoAttached.Search(c => c.LeaseRecapID == leaseRecapID.ToString()).OrderByDescending(e => e.CreateDate).FirstOrDefault();

            if (storeAtt != null)
            {
                inputInfo.LeasingTerm = store.StoreContractInfo.LeasePurchaseTerm;
            }
            if (store.StoreContractInfo.RentCommencementDate.HasValue)
            {
                inputInfo.RentCommencementDate = store.StoreContractInfo.RentCommencementDate.Value;
            }

            if (store.StoreContractInfo.EndDate.HasValue)
            {
                inputInfo.LeaseExpirationDate = store.StoreContractInfo.EndDate.Value;
            }


            var toolEntity = ClosureTool.Get(closure.ProjectId);

            if (toolEntity != null)
            {
                if (toolEntity.TotalSales_Adjustment_RMB != null)
                {
                    inputInfo.TotalSales_TTM = string.Format("{0:f}", toolEntity.TotalSales_Adjustment_RMB);
                }
                if (toolEntity.CompSales_Adjustment != null)
                {
                    inputInfo.SalesComp_TTM = string.Format("{0:f}", toolEntity.CompSales_Adjustment);
                }
                if (toolEntity.CompCG_Adjustment != null)
                {
                    inputInfo.GCComp_TTM = string.Format("{0:f}", toolEntity.CompCG_Adjustment);
                }
                if (toolEntity.PAC_Adjustment != null)
                {
                    inputInfo.PAC_TTM = string.Format("{0:f}", toolEntity.PAC_Adjustment);
                }
                if (toolEntity.SOI_Adjustment != null)
                {
                    inputInfo.SOI_TTM = string.Format("{0:f}", toolEntity.SOI_Adjustment);
                }
                if (toolEntity.CashFlow_RMB_Adjustment != null)
                {
                    inputInfo.CASHFLOW_TTM = string.Format("{0:f}", toolEntity.CashFlow_RMB_Adjustment);
                }
                if (toolEntity.TotalSales_TTMY1 != null)
                {
                    inputInfo.TotalSales_TTMY1 = string.Format("{0:f}", toolEntity.TotalSales_TTMY1);
                }
                if (toolEntity.CompSales_TTMY1 != null)
                {
                    inputInfo.CompSales_TTMY1 = string.Format("{0:f}", toolEntity.CompSales_TTMY1);
                }
                if (toolEntity.CompGC_TTMY1 != null)
                {
                    inputInfo.CompGC_TTMY1 = string.Format("{0:f}", toolEntity.CompGC_TTMY1);
                }
                if (toolEntity.PAC_TTMY1 != null)
                {
                    inputInfo.PAC_TTMY1 = string.Format("{0:f}", toolEntity.PAC_TTMY1);
                }
                if (toolEntity.SOI_TTMY1 != null)
                {
                    inputInfo.SOI_TTMY1 = string.Format("{0:f}", toolEntity.SOI_TTMY1);
                }
                if (toolEntity.CashFlow_TTMY1 != null)
                {
                    inputInfo.CashFlow_TTMY1 = string.Format("{0:f}", toolEntity.CashFlow_TTMY1);
                }
                if (toolEntity.TotalSales_TTMY2 != null)
                {
                    inputInfo.TotalSales_TTMY2 = string.Format("{0:f}", toolEntity.TotalSales_TTMY2);
                }
                if (toolEntity.CompSales_TTMY2 != null)
                {
                    inputInfo.CompSales_TTMY2 = string.Format("{0:f}", toolEntity.CompSales_TTMY2);
                }
                if (toolEntity.CompGC_TTMY2 != null)
                {
                    inputInfo.CompGC_TTMY2 = string.Format("{0:f}", toolEntity.CompGC_TTMY2);
                }
                if (toolEntity.PAC_TTMY2 != null)
                {
                    inputInfo.PAC_TTMY2 = string.Format("{0:f}", toolEntity.PAC_TTMY2);
                }
                if (toolEntity.SOI_TTMY2 != null)
                {
                    inputInfo.SOI_TTMY2 = string.Format("{0:f}", toolEntity.SOI_TTMY2);
                }
                if (toolEntity.CashFlow_TTMY2 != null)
                {
                    inputInfo.CashFlow_TTMY2 = string.Format("{0:f}", toolEntity.CashFlow_TTMY2);
                }


                List <StoreBEInfo> remoteBeList   = new List <StoreBEInfo>();
                List <StoreBEInfo> attachedBeList = new List <StoreBEInfo>();
                StoreBEInfo        mds            = null;
                StoreBEInfo        mcCafe         = null;
                StoreBEInfo        hour24         = null;
                if (store.StoreBEInfoList.Count > 0)
                {
                    foreach (var beInfo in store.StoreBEInfoList)
                    {
                        switch (beInfo.BETypeName)
                        {
                        case "Remote Kiosk":
                            remoteBeList.Add(beInfo);
                            break;

                        case "Attach Kiosk":
                            attachedBeList.Add(beInfo);
                            break;

                        case "MDS":
                            mds = beInfo;
                            break;

                        case "McCafe":
                            mcCafe = beInfo;
                            break;

                        case "24 Hour":
                            hour24 = beInfo;
                            break;
                        }
                    }
                }
                inputInfo.RemoteKiosk1_Status   = "No";
                inputInfo.RemoteKiosk2_Status   = "No";
                inputInfo.RemoteKiosk3_Status   = "No";
                inputInfo.AttachedKiosk1_Status = "No";
                inputInfo.AttachedKiosk2_Status = "No";
                inputInfo.AttachedKiosk3_Status = "No";
                inputInfo.MDS_Status            = "No";
                inputInfo.McCafe_Status         = "No";
                inputInfo.TwentyFourHour_Status = "No";

                if (remoteBeList.Count > 0)
                {
                    inputInfo.RemoteKiosk1_Status   = "Yes";
                    inputInfo.RemoteKiosk1_OpenDate = remoteBeList[0].LaunchDate;
                    if (remoteBeList.Count > 1)
                    {
                        inputInfo.RemoteKiosk2_Status   = "Yes";
                        inputInfo.RemoteKiosk2_OpenDate = remoteBeList[1].LaunchDate;

                        if (remoteBeList.Count > 2)
                        {
                            inputInfo.RemoteKiosk3_Status   = "Yes";
                            inputInfo.RemoteKiosk3_OpenDate = remoteBeList[2].LaunchDate;
                        }
                    }
                }

                if (attachedBeList.Count > 0)
                {
                    inputInfo.AttachedKiosk1_Status   = "Yes";
                    inputInfo.AttachedKiosk1_OpenDate = attachedBeList[0].LaunchDate;
                    if (attachedBeList.Count > 1)
                    {
                        inputInfo.AttachedKiosk2_Status   = "Yes";
                        inputInfo.AttachedKiosk2_OpenDate = attachedBeList[1].LaunchDate;

                        if (attachedBeList.Count > 2)
                        {
                            inputInfo.AttachedKiosk3_Status   = "Yes";
                            inputInfo.AttachedKiosk3_OpenDate = attachedBeList[2].LaunchDate;
                        }
                    }
                }
                if (mds != null)
                {
                    inputInfo.MDS_Status   = "Yes";
                    inputInfo.MDS_OpenDate = mds.LaunchDate;
                }
                if (mcCafe != null)
                {
                    inputInfo.McCafe_Status   = "Yes";
                    inputInfo.McCafe_OpenDate = mcCafe.LaunchDate;
                }
                if (hour24 != null)
                {
                    inputInfo.TwentyFourHour_Status   = "Yes";
                    inputInfo.TwentyFourHour_OpenDate = hour24.LaunchDate;
                }


                var woEntity = ClosureWOCheckList.Get(closure.ProjectId);
                if (woEntity != null)
                {
                    if (woEntity.LHI_NBV != null)
                    {
                        inputInfo.LHI_NBV = string.Format("{0:f}", woEntity.LHI_NBV);
                    }
                    if (woEntity.ESSD_NBV != null)
                    {
                        inputInfo.ESSD_NBV = string.Format("{0:f}", woEntity.ESSD_NBV);
                    }
                    if (woEntity.TotalCost_NBV != null)
                    {
                        inputInfo.TotalCost_NBV = string.Format("{0:f}", woEntity.TotalCost_NBV);
                    }
                }
            }

            excelPMTDirector.Input(inputInfo);

            Attachment att = Attachment.GetAttachment("ClosureExecutiveSummary", entity.Id.ToString(), "Template");

            if (att == null)
            {
                att = new Attachment();
                att.RefTableName    = "ClosureExecutiveSummary";
                att.RefTableID      = entity.Id.ToString();
                att.CreateTime      = DateTime.Now;
                att.ID              = Guid.NewGuid();
                att.TypeCode        = "Template";
                att.CreatorID       = ClientCookie.UserCode;
                att.CreatorNameENUS = ClientCookie.UserNameENUS;
                att.CreatorNameZHCN = ClientCookie.UserNameZHCN;
                att.Name            = SiteFilePath.Executive_Summary_Template;
                att.InternalName    = internalFileName;
                att.Extension       = fileInfo.Extension;
                att.Length          = Convert.ToInt32(fileInfo.Length);
                att.RequirementId   = new Guid("79258ffb-c2ef-4eff-897d-ba8376c90071");
                Attachment.Add(att);
            }
            else
            {
                att.CreateTime      = DateTime.Now;
                att.CreatorID       = ClientCookie.UserCode;
                att.CreatorNameENUS = ClientCookie.UserNameENUS;
                att.CreatorNameZHCN = ClientCookie.UserNameZHCN;
                att.Name            = SiteFilePath.Executive_Summary_Template;
                att.InternalName    = internalFileName;
                att.Extension       = fileInfo.Extension;
                att.Length          = Convert.ToInt32(fileInfo.Length);
                att.RequirementId   = new Guid("79258ffb-c2ef-4eff-897d-ba8376c90071");
                Attachment.Update(att);
            }

            ProjectInfo.FinishNode(entity.ProjectId, FlowCode.Closure_ExecutiveSummary, NodeCode.Closure_ExecutiveSummary_Generate);

            return(Ok());
        }
コード例 #4
0
ファイル: ProjectController.cs プロジェクト: XiaoYaTech/Demo
        public IHttpActionResult RecallProject(PostSimpleWorkflowData postData)
        {
            ApiProxy.SetCookies(Request.RequestUri.Host, HttpContext.Current.Request.Cookies);
            var rootPath = string.Concat(HttpContext.Current.Request.Url.Scheme, @"://", HttpContext.Current.Request.Url.Authority, HttpContext.Current.Request.ApplicationPath);

            switch (postData.FlowCode)
            {
                #region Closure
            case FlowCode.Closure_WOCheckList:
            {
                var entity = ClosureWOCheckList.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosureWOCheckList/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_LegalReview:
            {
                var entity = ClosureLegalReview.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/LegalReview/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ClosurePackage:
            {
                var entity = ClosurePackage.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosurePackage/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ConsInvtChecking:
            {
                var entity = ClosureConsInvtChecking.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/ClosureConsInvtChecking/Recall", "POST", null, postDataBytes);
            }
            break;

            case FlowCode.Closure_ClosureTool:
            {
                var entity = ClosureTool.Get(postData.ProjectId);
                entity.Comments = postData.ProjectComment;
                var postDataBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(entity));
                ApiProxy.Call(rootPath + "api/closureTool/Recall", "POST", null, postDataBytes);
            }
            break;

                #endregion Closure
            default:
                var wfEntity = BaseWFEntity.GetWorkflowEntity(postData.ProjectId, postData.FlowCode);
                wfEntity.Recall(postData.ProjectComment);
                break;
            }
            return(Ok());
        }
コード例 #5
0
        //private string GetCellValue(decimal? val)
        //{
        //    string result = string.Empty;
        //    if (val.HasValue)
        //    {
        //        result = val.Value.ToString("f2");
        //    }
        //    return result;
        //}
        public override void Input(OfficeOpenXml.ExcelWorksheet worksheet, ExcelInputDTO inputInfo)
        {
            var         closureInfo   = ClosureInfo.GetByProjectId(inputInfo.ProjectId);
            var         storeInfo     = StoreBasicInfo.FirstOrDefault(s => s.StoreCode == closureInfo.USCode);
            var         storeContract = StoreContractInfo.Get(storeInfo.StoreCode);
            ClosureTool closureTool   = ClosureTool.Get(inputInfo.ProjectId);

            //ClosureWOCheckList closureWoCheckList = ClosureWOCheckList.Get(inputInfo.ProjectId);
            worksheet.Cells["B2"].Value = storeInfo.Market;
            worksheet.Cells["B3"].Value = storeInfo.StoreCode;
            worksheet.Cells["B4"].Value = storeInfo.NameZHCN;

            worksheet.Cells["B5"].Value = storeInfo.OpenDate.ToString("yyyy-MM-dd");
            if (storeContract != null)
            {
                worksheet.Cells["B6"].Value = storeContract.PartyAFullName;
                worksheet.Cells["B7"].Value = storeContract.EndDate.HasValue ? storeContract.EndDate.Value.ToString("yyyy-MM-dd") : "";
            }
            worksheet.Cells["B8"].Value = closureInfo.ClosureTypeNameZHCN;

            if (closureInfo.ActualCloseDate != null)
            {
                worksheet.Cells["B9"].Value = closureInfo.ActualCloseDate.Value.ToString("yyyy-MM-dd");
            }
            worksheet.Cells["B10"].Value = closureTool.Product_Sales_RMB_Adjustment;
            worksheet.Cells["B11"].Value = closureTool.PAC_RMB_Adjustment;


            worksheet.Cells["B12"].Value = closureTool.Rent_RMB_Adjustment;



            worksheet.Cells["B13"].Value = closureTool.DepreciationLHI_RMB_Adjustment;


            worksheet.Cells["B14"].Value = closureTool.InterestLHI_RMB_Adjustment;



            //INTEREST LHI
            // worksheet.Cells[15, 2].Value = closureTool..ToString();

            worksheet.Cells["B15"].Value = closureTool.ServiceFee_RMB_Adjustment;


            worksheet.Cells["B16"].Value = closureTool.Accounting_RMB_Adjustment;


            worksheet.Cells["B17"].Value = closureTool.Accounting_RMB_Adjustment;


            worksheet.Cells["B18"].Value = closureTool.TaxesLicenses_RMB_Adjustment;


            worksheet.Cells["B19"].Value = closureTool.Depreciation_ESSD_RMB_Adjustment;


            worksheet.Cells["B20"].Value = closureTool.Interest_ESSD_RMB_Adjustment;


            worksheet.Cells["B21"].Value = closureTool.OtherIncExp_RMB_Adjustment;

            worksheet.Cells["B22"].Value = closureTool.NonProduct_Sales_RMB_Adjustment;
            worksheet.Cells["B23"].Value = closureTool.NonProduct_Costs_RMB_Adjustment;
            worksheet.Cells["B24"].Value = closureTool.CompSalesMacket_Adjustment;
            worksheet.Cells["B25"].Value = closureTool.CompCG_Adjustment;
            worksheet.Cells["B26"].Value = closureTool.CompCGMacket_Adjustment;
            worksheet.Cells["B27"].Value = closureTool.PACMarket_Adjustment;
            worksheet.Cells["B28"].Value = closureTool.SOIMarket_Adjustment;
            worksheet.Cells["B29"].Value = closureTool.TotalSales_TTMY1;
            worksheet.Cells["B30"].Value = closureTool.CompSales_TTMY1;
            worksheet.Cells["B31"].Value = closureTool.CompSales_Market_TTMY1;
            worksheet.Cells["B32"].Value = closureTool.CompGC_TTMY1;
            worksheet.Cells["B33"].Value = closureTool.CompGCMarket_TTMY1;

            worksheet.Cells["B34"].Value = closureTool.PAC_TTMY1;
            worksheet.Cells["B35"].Value = closureTool.PACMarket_TTMY1;

            worksheet.Cells["B36"].Value = closureTool.SOI_TTMY1;
            worksheet.Cells["B37"].Value = closureTool.SOIMarket_TTMY1;

            worksheet.Cells["B38"].Value = closureTool.CashFlow_TTMY1;
            worksheet.Cells["B39"].Value = closureTool.TotalSales_TTMY2;
            //sheet.Cells[36, 2].Value = closureTool.cashflow.ToString();


            worksheet.Cells["B40"].Value = closureTool.CompSales_TTMY2;
            worksheet.Cells["B41"].Value = closureTool.CompSales_Market_TTMY2;

            worksheet.Cells["B42"].Value = closureTool.CompGC_TTMY2;
            worksheet.Cells["B43"].Value = closureTool.CompGCMarket_TTMY2;

            worksheet.Cells["B44"].Value = closureTool.PAC_TTMY2;
            worksheet.Cells["B45"].Value = closureTool.PACMarket_TTMY2;

            worksheet.Cells["B46"].Value = closureTool.SOI_TTMY2;
            worksheet.Cells["B47"].Value = closureTool.SOIMarket_TTMY2;

            worksheet.Cells["B48"].Value = closureTool.CashFlow_TTMY2;
            worksheet.Cells["B49"].Value = DateTime.Now.Year + " July";
            var woEntity = ClosureWOCheckList.Get(closureTool.ProjectId);

            if (woEntity != null)
            {
                worksheet.Cells["B50"].Value = woEntity.RE_Original;
                worksheet.Cells["B51"].Value = woEntity.LHI_Original;
                worksheet.Cells["B52"].Value = woEntity.ESSD_Original;
                worksheet.Cells["B53"].Value = woEntity.RE_NBV;
                worksheet.Cells["B54"].Value = woEntity.LHI_NBV;
                worksheet.Cells["B55"].Value = woEntity.ESSD_NBV;
                worksheet.Cells["B56"].Value = woEntity.EquipmentTransfer;
                worksheet.Cells["B57"].Value = woEntity.ClosingCost;
            }

            var list = ClosureToolImpactOtherStore.Search(e => e.ClosureId == closureTool.Id).AsNoTracking().ToList();

            if (list.Count > 0)
            {
                worksheet.Cells["B58"].Value = list[0].StoreCode;
                worksheet.Cells["B59"].Value = list[0].NameZHCN;
                worksheet.Cells["B60"].Value = list[0].ImpactSaltes;
            }

            if (list.Count > 1)
            {
                worksheet.Cells["B61"].Value = list[1].StoreCode;
                worksheet.Cells["B62"].Value = list[1].NameZHCN;
                worksheet.Cells["B63"].Value = list[1].ImpactSaltes;
            }



            worksheet.Cells["B64"].Value = closureTool.McppcoMargin;


            worksheet.Cells["B65"].Value = closureTool.MccpcoCashFlow;

            worksheet.Cells["B66"].Value = closureTool.Compensation;


            worksheet.Cells["B67"].Value = closureTool.CompAssumption;


            worksheet.Cells["B68"].Value = closureTool.CashflowGrowth;

            if (closureTool.IsOptionOffered.HasValue)
            {
                worksheet.Cells["B69"].Value = closureTool.IsOptionOffered.Value ? "Yes" : "No";
            }
            worksheet.Cells["B70"].Value = closureTool.LeaseTerm;


            worksheet.Cells["B71"].Value = closureTool.Investment;


            worksheet.Cells["B72"].Value = closureTool.NPVRestaurantCashflows;

            if (closureTool.Yr1SOI != null)
            {
                worksheet.Cells["B73"].Value = closureTool.Yr1SOI;
            }

            if (closureTool.Yr1SOI != null)
            {
                worksheet.Cells["B74"].Value = closureTool.IRR;
            }

            if (closureTool.ConclusionComment != null)
            {
                worksheet.Cells["B76"].Value = closureTool.ConclusionComment;
            }
        }