예제 #1
0
        public IHttpActionResult GetGBMemoInfo(string projectId, string entityId = "")
        {
            var memo = ReimageGBMemo.GetGBMemo(projectId, entityId);

            //if (memo != null)
            //{
            //    var condition = new ProjectCommentCondition();
            //    condition.SourceCode = FlowCode.Reimage;
            //    condition.UserAccount = ClientCookie.UserCode;

            //    condition.RefTableId = memo.Id;
            //    condition.RefTableName = "ReimageGBMemo";

            //    var comments = ProjectComment.SearchList(condition);
            //    if (comments != null && comments.Count > 0)
            //    {
            //        memo.ProjectComments = comments;

            //        var saveComment =
            //            comments.OrderByDescending(e => e.CreateTime)
            //                .FirstOrDefault(e => e.Status == ProjectCommentStatus.Save);
            //        if (saveComment != null)
            //        {
            //            memo.Comments = saveComment.Content;
            //        }
            //    }
            //}
            return(Ok(memo));
        }
예제 #2
0
        public IHttpActionResult GetReimageInfo(string projectId)
        {
            var reimageInfo = ReimageInfo.FirstOrDefault(e => e.ProjectId.Equals(projectId));

            if (reimageInfo != null)
            {
                reimageInfo.IsSiteInfoSaveable = ProjectInfo.IsFlowSavable(projectId, FlowCode.Reimage_SiteInfo);

                var siteInfo = ProjectInfo.FirstOrDefault(e => e.ProjectId.Equals(projectId) &&
                                                          e.FlowCode == FlowCode.Reimage_SiteInfo);

                if (siteInfo != null)
                {
                    reimageInfo.SiteInfoId = siteInfo.Id;

                    var estimatedVsActualConstruction =
                        EstimatedVsActualConstruction.FirstOrDefault(e => e.RefId == siteInfo.Id);

                    if (estimatedVsActualConstruction == null)
                    {
                        var consInfo      = ReimageConsInfo.GetConsInfo(projectId);
                        var reinBasicInfo = consInfo.ReinBasicInfo;
                        var gbMemo        = ReimageGBMemo.GetGBMemo(projectId);
                        var storeInfo     = StoreSTLocation.FirstOrDefault(e => e.StoreCode == siteInfo.USCode);

                        var summary = ReimageSummary.GetReimageSummaryInfo(projectId);
                        var afterReimagePriceTier = summary.FinancialPreanalysis != null
                            ? summary.FinancialPreanalysis.PriceTierafterReimage
                            : null;


                        estimatedVsActualConstruction = new EstimatedVsActualConstruction
                        {
                            RefId                 = siteInfo.Id,
                            GBDate                = gbMemo.GBDate,
                            CompletionDate        = gbMemo.ConstCompletionDate,
                            ARDC                  = reinBasicInfo.NewDesignType,
                            OriginalOperationSize = storeInfo.TotalArea,
                            OriginalSeatNumber    = storeInfo.TotalSeatsNo,
                            ARPT                  = afterReimagePriceTier
                        };
                    }

                    reimageInfo.EstimatedVsActualConstruction = estimatedVsActualConstruction;
                }
            }

            return(Ok(reimageInfo));
        }