Ejemplo n.º 1
0
        public static EmailSendingResultType SendLegalReviewEmail(TempClosureLegalReview entity)
        {
            var project    = ProjectInfo.Get(entity.ProjectId, FlowCode.TempClosure_ClosurePackage);
            var storeBasic = StoreBasicInfo.GetStorInfo(project.USCode);
            var legal      = ProjectUsers.GetProjectUser(entity.ProjectId, ProjectUserRoleCode.Legal);
            var actor      = ProjectUsers.GetProjectUser(entity.ProjectId, ProjectUserRoleCode.AssetActor);

            using (EmailServiceClient emailClient = new EmailServiceClient())
            {
                EmailMessage email = new EmailMessage();
                //邮件模板中的数据
                Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                //邮件内容中的键值对
                bodyValues.Add("ApproverName", legal.UserNameENUS);
                bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                bodyValues.Add("StoreCode", storeBasic.StoreCode);
                bodyValues.Add("StoreName", storeBasic.NameENUS + @" \ " + storeBasic.NameZHCN);
                bodyValues.Add("Actor", actor.UserNameENUS);                       ////--呈递人
                bodyValues.Add("WorkflowName", Constants.TempClosure_LegalReview); ////--流程名称
                bodyValues.Add("ProjectName", Constants.TempClosure);              //项目名称
                var viewPage = string.Format("{0}/TempClosure/Main#/ClosurePackage/View/param?projectId={1}",
                                             HttpContext.Current.Request.Url.AbsolutePath, entity.ProjectId);
                bodyValues.Add("FormUrl", viewPage);
                email.EmailBodyValues = bodyValues;
                List <string> emailAddresses = Employee.Search(e => e.Code == legal.UserAccount).Select(e => e.Mail).ToList();
                emailAddresses.Add("*****@*****.**");
                emailAddresses.Add("*****@*****.**");
                emailAddresses.Add("*****@*****.**");
                email.To = string.Join(";", emailAddresses);
                //return emailClient.SendNotificationEmail(email);
                return(new EmailSendingResultType());
            }
        }
Ejemplo n.º 2
0
        public IHttpActionResult SendReopenMemo(PostMemo <ReopenMemo> postData)
        {
            var actor = ProjectUsers.GetProjectUser(postData.Entity.ProjectId, ProjectUserRoleCode.AssetActor);

            using (TransactionScope tranScope = new TransactionScope())
            {
                Dictionary <string, string> pdfData = new Dictionary <string, string>();
                if (postData.Entity.ProjectId.ToLower().IndexOf("rebuild") >= 0)
                {
                    pdfData.Add("WorkflowName", "Rebuild");
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("majorlease") != -1)
                {
                    pdfData.Add("WorkflowName", "MajorLease");
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("renewal") != -1)
                {
                    pdfData.Add("WorkflowName", "Renewal");
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("reimage") >= 0)
                {
                    pdfData.Add("WorkflowName", "Reimage");
                }
                else
                {
                    pdfData.Add("WorkflowName", postData.Entity.ProjectId);
                }
                pdfData.Add("ProjectID", postData.Entity.ProjectId);
                pdfData.Add("RegionNameENUS", postData.Entity.Store.StoreBasicInfo.RegionENUS);
                pdfData.Add("RegionNameZHCN", postData.Entity.Store.StoreBasicInfo.RegionZHCN);
                pdfData.Add("MarketNameENUS", postData.Entity.Store.StoreBasicInfo.MarketENUS);
                pdfData.Add("MarketNameZHCN", postData.Entity.Store.StoreBasicInfo.MarketZHCN);
                pdfData.Add("ProvinceNameENUS", postData.Entity.Store.StoreBasicInfo.ProvinceENUS);
                pdfData.Add("ProvinceNameZHCN", postData.Entity.Store.StoreBasicInfo.ProvinceZHCN);
                pdfData.Add("CityNameENUS", postData.Entity.Store.StoreBasicInfo.CityENUS);
                pdfData.Add("CityNameZHCN", postData.Entity.Store.StoreBasicInfo.CityZHCN);
                pdfData.Add("StoreNameENUS", postData.Entity.Store.StoreBasicInfo.NameENUS);
                pdfData.Add("StoreNameZHCN", postData.Entity.Store.StoreBasicInfo.NameZHCN);
                pdfData.Add("USCode", postData.Entity.Store.StoreBasicInfo.StoreCode);

                pdfData.Add("IsMcCafe", postData.Entity.NewMcCafe ? "Y" : "N");
                pdfData.Add("IsKiosk", postData.Entity.NewKiosk ? "Y" : "N");
                pdfData.Add("IsMDS", postData.Entity.NewMDS ? "Y" : "N");
                pdfData.Add("Is24Hour", postData.Entity.Is24H ? "Y" : "N");

                pdfData.Add("TTMNetSales", DataConverter.ToMoney(postData.Entity.TTMNetSales) ?? "&nbsp;");
                var TTMNetSalesYearMonth = "";
                if (postData.Entity.YearMonthList != null && postData.Entity.YearMonthList.Count > 0)
                {
                    foreach (var val in postData.Entity.YearMonthList)
                    {
                        if (val.Value == postData.Entity.TTMNetSales)
                        {
                            TTMNetSalesYearMonth = val.Name;
                            break;
                        }
                    }
                }
                pdfData.Add("TTMNetSalesYearMonth", TTMNetSalesYearMonth ?? "&nbsp;");
                pdfData.Add("IncrementalSales", postData.Entity.IncrementalSales.HasValue ? DataConverter.ToMoney((postData.Entity.IncrementalSales.Value * 100)) : "&nbsp;");

                pdfData.Add("GBDate", postData.Entity.GBDate.HasValue ? postData.Entity.GBDate.Value.ToString("yyyy-MM-dd") : "&nbsp;");
                pdfData.Add("ConstCompletionDate", postData.Entity.CompletionDate.HasValue ? postData.Entity.CompletionDate.Value.ToString("yyyy-MM-dd") : "&nbsp;");

                //if (postData.Entity.ProjectId.ToLower().IndexOf("reimage") >= 0)
                //{
                //    pdfData.Add("ReopenDate", postData.Entity.RmgInfo.ReopenDate.HasValue ? postData.Entity.RmgInfo.ReopenDate.Value.ToString("yyyy-MM-dd") : "&nbsp;");
                //}
                //else
                //{
                //    pdfData.Add("ReopenDate", postData.Entity.ReopenDate.HasValue ? postData.Entity.RbdInfo.ReopenDate.Value.ToString("yyyy-MM-dd") : "&nbsp;");
                //}
                pdfData.Add("ReopenDate", postData.Entity.ReopenDate.HasValue ? postData.Entity.ReopenDate.Value.ToString("yyyy-MM-dd") : "&nbsp;");
                pdfData.Add("DesignConcept", GetConcetpetDesc(postData.Entity.DesignConcept) ?? "&nbsp;");
                pdfData.Add("TotalWriteOff", DataConverter.ToMoney(postData.Entity.WriteOff.TotalWriteOff) ?? "&nbsp;");
                pdfData.Add("TotalReinvestmentBudget", DataConverter.ToMoney(postData.Entity.TotalReinvestmentBudget) ?? "&nbsp;");
                pdfData.Add("OriginalOperationSize", postData.Entity.OriginalOperationSize ?? "&nbsp;");
                pdfData.Add("NewOperationSize", postData.Entity.AftOperationSize ?? "&nbsp;");
                pdfData.Add("OriginalSeatNumber", postData.Entity.OriginalSeatNumber ?? "&nbsp;");
                pdfData.Add("ARSN", postData.Entity.AftARSN ?? "&nbsp;");
                pdfData.Add("AftARPT", postData.Entity.AftARPT ?? "&nbsp;");
                pdfData.Add("PriceTiter", postData.Entity.PriceTiter ?? "&nbsp;");
                if (postData.Entity.ExteriorAfterImgURL1 != "../Images/mcd_logo.png")
                {
                    pdfData.Add("ExteriorAfterImgURL1", HtmlConversionUtility.ImageToBase64(postData.Entity.ExteriorAfterImgURL1, System.Drawing.Imaging.ImageFormat.Png));
                }
                else
                {
                    pdfData.Add("ExteriorAfterImgURL1", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAzCAMAAADrVgtcAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb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+zjG6nMaLHxLbMjex1RpkRUjd/bZmTayMZ+Rrekz5PTW9gURkbdUUZEVKWNGgd0wbNfE07vgF+FTmia4rR45O0qlOX0KrG9qAifCGFwPTjyLYd2x1pdAGwySlwbEEERjAzVOECTuD8IgpkFC2BEn1l04wx47Q9jC7tkDw7nwf2Vp/4lhR2l1hx9e2Y7SBp5zOp2H/304nbZdle/R/vz01wMHRj9ELBu97OP3/xFgAEAgj7rRci3dAAAAAElFTkSuQmCC");
                }
                if (postData.Entity.ExteriorAfterImgURL2 != "../Images/mcd_logo.png")
                {
                    pdfData.Add("ExteriorAfterImgURL2", HtmlConversionUtility.ImageToBase64(postData.Entity.ExteriorAfterImgURL2, System.Drawing.Imaging.ImageFormat.Png));
                }
                else
                {
                    pdfData.Add("ExteriorAfterImgURL2", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAzCAMAAADrVgtcAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9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HZcTl3onb1Hxr+zjG6nMaLHxLbMjex1RpkRUjd/bZmTayMZ+Rrekz5PTW9gURkbdUUZEVKWNGgd0wbNfE07vgF+FTmia4rR45O0qlOX0KrG9qAifCGFwPTjyLYd2x1pdAGwySlwbEEERjAzVOECTuD8IgpkFC2BEn1l04wx47Q9jC7tkDw7nwf2Vp/4lhR2l1hx9e2Y7SBp5zOp2H/304nbZdle/R/vz01wMHRj9ELBu97OP3/xFgAEAgj7rRci3dAAAAAElFTkSuQmCC");
                }
                if (postData.Entity.InteriorAfterImgURL1 != "../Images/mcd_logo.png")
                {
                    pdfData.Add("InteriorAfterImgURL1", HtmlConversionUtility.ImageToBase64(postData.Entity.InteriorAfterImgURL1, System.Drawing.Imaging.ImageFormat.Png));
                }
                else
                {
                    pdfData.Add("InteriorAfterImgURL1", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAzCAMAAADrVgtcAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0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1b/9Gby8adHZcTl3onb1Hxr+zjG6nMaLHxLbMjex1RpkRUjd/bZmTayMZ+Rrekz5PTW9gURkbdUUZEVKWNGgd0wbNfE07vgF+FTmia4rR45O0qlOX0KrG9qAifCGFwPTjyLYd2x1pdAGwySlwbEEERjAzVOECTuD8IgpkFC2BEn1l04wx47Q9jC7tkDw7nwf2Vp/4lhR2l1hx9e2Y7SBp5zOp2H/304nbZdle/R/vz01wMHRj9ELBu97OP3/xFgAEAgj7rRci3dAAAAAElFTkSuQmCC");
                }
                if (postData.Entity.InteriorAfterImgURL2 != "../Images/mcd_logo.png")
                {
                    pdfData.Add("InteriorAfterImgURL2", HtmlConversionUtility.ImageToBase64(postData.Entity.InteriorAfterImgURL2, System.Drawing.Imaging.ImageFormat.Png));
                }
                else
                {
                    pdfData.Add("InteriorAfterImgURL2", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAzCAMAAADrVgtcAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3R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44qHFV2kexq1b/9Gby8adHZcTl3onb1Hxr+zjG6nMaLHxLbMjex1RpkRUjd/bZmTayMZ+Rrekz5PTW9gURkbdUUZEVKWNGgd0wbNfE07vgF+FTmia4rR45O0qlOX0KrG9qAifCGFwPTjyLYd2x1pdAGwySlwbEEERjAzVOECTuD8IgpkFC2BEn1l04wx47Q9jC7tkDw7nwf2Vp/4lhR2l1hx9e2Y7SBp5zOp2H/304nbZdle/R/vz01wMHRj9ELBu97OP3/xFgAEAgj7rRci3dAAAAAElFTkSuQmCC");
                }
                string pdfPath = HtmlConversionUtility.HtmlConvertToPDF(HtmlTempalteType.ReopenMemo, pdfData, null);
                EmailSendingResultType result;
                //邮件模板中的数据
                Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                //邮件内容中的键值对
                bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                bodyValues.Add("StoreCode", postData.Entity.Store.StoreBasicInfo.StoreCode);
                bodyValues.Add("StoreName", postData.Entity.Store.StoreBasicInfo.NameENUS);
                bodyValues.Add("Actor", actor.RoleNameENUS);////--呈递人
                if (postData.Entity.ProjectId.ToLower().IndexOf("rebuild") >= 0)
                {
                    bodyValues.Add("WorkflowName", Constants.Rebuild_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.Rebuild);             //项目名称
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("reimage") >= 0)
                {
                    bodyValues.Add("WorkflowName", Constants.Reimage_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.Reimage);             //项目名称
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("tempclosure") >= 0)
                {
                    bodyValues.Add("WorkflowName", Constants.TempClosure_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.TempClosure);             //项目名称
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("majorlease") >= 0)
                {
                    bodyValues.Add("WorkflowName", Constants.MajorLease_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.MajorLease);             //项目名称
                }
                else if (postData.Entity.ProjectId.ToLower().IndexOf("renewal") >= 0)
                {
                    bodyValues.Add("WorkflowName", Constants.Renewal_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.Renewal);             //项目名称
                }
                else
                {
                    bodyValues.Add("WorkflowName", Constants.TempClosure_ReopenMemo); ////--流程名称
                    bodyValues.Add("ProjectName", Constants.TempClosure);             //项目名称
                }

                string viewPage = "";
                if (postData.Entity.ProjectId.ToLower().IndexOf("rebuild") >= 0)
                {
                    viewPage = string.Format("{0}/Rebuild/Main#/ReopenMemo/Process/View?projectId={1}",
                                             ConfigurationManager.AppSettings["webHost"], postData.Entity.ProjectId);
                }
                if (postData.Entity.ProjectId.ToLower().IndexOf("reimage") >= 0)
                {
                    viewPage = string.Format("{0}/Reimage/Main#/ReopenMemo/Process/View?projectId={1}",
                                             ConfigurationManager.AppSettings["webHost"], postData.Entity.ProjectId);
                }
                bodyValues.Add("FormUrl", viewPage);

                //调用邮件服务发送邮件
                using (EmailServiceClient client = new EmailServiceClient())
                {
                    EmailMessage  message = new EmailMessage();
                    StringBuilder sbTo    = new StringBuilder();
                    Dictionary <string, string> attachments = new Dictionary <string, string>();
                    foreach (Employee emp in postData.Receivers)
                    {
                        if (sbTo.Length > 0)
                        {
                            sbTo.Append(";");
                        }
                        if (!string.IsNullOrEmpty(emp.Mail))
                        {
                            sbTo.Append(emp.Mail);
                        }
                    }
                    if (sbTo.Length > 0)
                    {
                        sbTo.Append(";");
                    }
                    message.EmailBodyValues = bodyValues;
                    string strTitle = "";
                    if (postData.Entity.ProjectId.ToLower().IndexOf("rebuild") >= 0)
                    {
                        strTitle = "Rebuild_ReopenMemo";
                    }
                    if (postData.Entity.ProjectId.ToLower().IndexOf("reimage") >= 0)
                    {
                        strTitle = "Reimage_ReopenMemo";
                    }
                    if (postData.Entity.ProjectId.ToLower().IndexOf("majorlease") >= 0)
                    {
                        strTitle = "MajorLease_ReopenMemo";
                    }
                    if (postData.Entity.ProjectId.ToLower().IndexOf("renewal") >= 0)
                    {
                        strTitle = "Renewal_ReopenMemo";
                    }
                    if (postData.Entity.ProjectId.ToLower().IndexOf("tempclosure") >= 0)
                    {
                        strTitle = "TempClosure_ReopenMemo";
                    }
                    attachments.Add(pdfPath, strTitle + "_" + postData.Entity.ProjectId + ".pdf");
                    message.AttachmentsDict = attachments;
                    message.To           = sbTo.ToString();
                    message.TemplateCode = EmailTemplateCode.GBMemoNotification;
                    result = client.SendNotificationEmail(message);
                }

                if (!result.Successful)
                {
                    return(BadRequest(result.ErrorMessage + " " + pdfPath));
                }
                ReopenMemo.Submit(postData.Entity);
                tranScope.Complete();
            }
            return(Ok());
        }
Ejemplo n.º 3
0
        public IHttpActionResult GetMemo(string flowCode, string projectId)
        {
            var memoList = AttachmentsMemo.GetAttachmentsMemoList(flowCode);

            if (memoList == null || memoList.Count == 0)
            {
                return(Ok());
            }
            var navs = memoList.Select(e =>
            {
                string url        = "";
                DateTime?date     = null;
                ProjectUsers user = null;
                switch (e.MemoCode)
                {
                case "GBMemo":
                    user         = ProjectUsers.GetProjectUser(projectId, ProjectUserRoleCode.PM);
                    var gbEntity = AttachmentsMemoProcessInfo.Get(projectId, FlowCode.GBMemo);
                    if (gbEntity != null)
                    {
                        date = gbEntity.NotifyDate;
                    }
                    break;

                case "ClosureMemo":
                    user          = ProjectUsers.GetProjectUser(projectId, ProjectUserRoleCode.AssetActor);
                    var tmpEntity = AttachmentsMemoProcessInfo.Get(projectId, FlowCode.ClosureMemo);
                    if (tmpEntity != null)
                    {
                        date = tmpEntity.NotifyDate;
                    }
                    break;

                case "ReopenMemo":
                    user       = ProjectUsers.GetProjectUser(projectId, ProjectUserRoleCode.AssetActor);
                    var entity = AttachmentsMemoProcessInfo.Get(projectId, FlowCode.ReopenMemo);
                    date       = entity.NotifyDate;
                    break;
                }
                if (e.MemoCode == "GBMemo")
                {
                    var flowcode = e.FlowCode + "_" + e.MemoCode;
                    var task     = TaskWork.Search(t => t.RefID == projectId && t.Status == TaskWorkStatus.UnFinish && t.TypeCode == flowcode).FirstOrDefault();
                    if (task != null)
                    {
                        if ((task.Url.IndexOf("Approval", StringComparison.OrdinalIgnoreCase) != -1 ||
                             task.Url.IndexOf("Resubmit", StringComparison.OrdinalIgnoreCase) != -1 ||
                             task.Url.IndexOf("Notify", StringComparison.OrdinalIgnoreCase) != -1 ||
                             task.Url.IndexOf("View", StringComparison.OrdinalIgnoreCase) == -1) &&
                            task.ReceiverAccount == ClientCookie.UserCode)
                        {
                            if (task.Url.IndexOf(task.RefID, StringComparison.OrdinalIgnoreCase) < 0)
                            {
                                if (task.Url.IndexOf("?") >= 0)
                                {
                                    task.Url += "&";
                                }
                                else
                                {
                                    task.Url += "?";
                                }
                                task.Url += "projectId=" + task.RefID;
                            }
                            url = task.Url;
                        }
                        else
                        {
                            url = string.Format("/{0}/Main#/{1}/Process/View?projectId={2}", flowCode, e.MemoCode, projectId);
                        }
                    }
                    else
                    {
                        if (user.UserAccount == ClientCookie.UserCode && date == null)
                        {
                            url = string.Format("/{0}/Main#/{1}?projectId={2}", flowCode, e.MemoCode, projectId);
                        }
                        else
                        {
                            url = string.Format("/{0}/Main#/{1}/Process/View?projectId={2}", flowCode, e.MemoCode, projectId);
                        }
                    }
                }
                else
                {
                    if (user.UserAccount == ClientCookie.UserCode)
                    {
                        url = string.Format("/{0}/Main#/{1}?projectId={2}", flowCode, e.MemoCode, projectId);
                    }
                    else
                    {
                        url = string.Format("/{0}/Main#/{1}/Process/View?projectId={2}", flowCode, e.MemoCode, projectId);
                    }
                }


                return(new
                {
                    NotifyDate = date,
                    Name = e.MemoNameENUS,
                    Url = url
                });
            }).ToList();

            return(Ok(navs));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Send(PostClosureMemoModel model)
        {
            var actor = ProjectUsers.GetProjectUser(model.Entity.ProjectId, ProjectUserRoleCode.AssetActor);

            using (TransactionScope tranScope = new TransactionScope())
            {
                Save(model.Entity);
                ClosureTool closureTool        = ClosureTool.FirstOrDefault(ct => ct.ProjectId == model.Entity.ProjectId);
                string      compensationAwards = "";
                string      compensation       = "暂无数据";
                if (closureTool != null && closureTool.Compensation.HasValue)
                {
                    compensationAwards = closureTool.Compensation.Value > 0 ? "Yes" : "No";
                    compensation       = closureTool.Compensation.Value.ToString("N");
                }
                Dictionary <string, string> pdfData = new Dictionary <string, string>();
                pdfData.Add("WorkflowName", "Closure");
                pdfData.Add("ProjectID", model.Entity.ProjectId);
                pdfData.Add("RegionNameENUS", model.Entity.RegionNameENUS);
                pdfData.Add("RegionNameZHCN", model.Entity.RegionNameZHCN);
                pdfData.Add("MarketNameENUS", model.Entity.MarketNameENUS);
                pdfData.Add("MarketNameZHCN", model.Entity.MarketNameZHCN);
                pdfData.Add("ProvinceNameENUS", model.Entity.ProvinceNameENUS);
                pdfData.Add("ProvinceNameZHCN", model.Entity.ProvinceNameZHCN);
                pdfData.Add("CityNameENUS", model.Entity.CityNameENUS);
                pdfData.Add("CityNameZHCN", model.Entity.CityNameZHCN);
                pdfData.Add("StoreNameENUS", model.Entity.StoreNameENUS);
                pdfData.Add("StoreNameZHCN", model.Entity.StoreNameZHCN);
                pdfData.Add("StoreAddressENUS", model.Entity.StoreAddressENUS);
                pdfData.Add("StoreAddressZHCN", model.Entity.StoreAddressZHCN);
                pdfData.Add("USCode", model.Entity.USCode);
                pdfData.Add("OpenDate", model.Entity.OpenDate.Value.ToString("yyyy-MM-dd"));
                pdfData.Add("ClosureDate", model.Entity.ClosureDate.Value.ToString("yyyy-MM-dd"));
                pdfData.Add("ClosureNature", model.Entity.ClosureNature.ToString());
                if (model.Entity.BecauseOfReimaging.HasValue)
                {
                    pdfData.Add("BecauseOfReimaging", model.Entity.BecauseOfReimaging.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfReimaging", "");
                }

                if (model.Entity.BecauseOfRemodel.HasValue)
                {
                    pdfData.Add("BecauseOfRemodel", model.Entity.BecauseOfRemodel.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfRemodel", "");
                }

                if (model.Entity.BecauseOfDespute.HasValue)
                {
                    pdfData.Add("BecauseOfDespute", model.Entity.BecauseOfDespute.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfDespute", "");
                }

                if (model.Entity.BecauseOfRedevelopment.HasValue)
                {
                    pdfData.Add("BecauseOfRedevelopment", model.Entity.BecauseOfRedevelopment.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfRedevelopment", "");
                }

                if (model.Entity.BecauseOfPlanedClosure.HasValue)
                {
                    pdfData.Add("BecauseOfPlanedClosure", model.Entity.BecauseOfPlanedClosure.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfPlanedClosure", "");
                }

                if (model.Entity.BecauseOfRebuild.HasValue)
                {
                    pdfData.Add("BecauseOfRebuild", model.Entity.BecauseOfRebuild.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("BecauseOfRebuild", "");
                }

                pdfData.Add("BecauseOfOthers", model.Entity.BecauseOfOthers);

                if (model.Entity.PermanentCloseOpportunity.HasValue)
                {
                    pdfData.Add("PermanentCloseOpportunity", model.Entity.PermanentCloseOpportunity.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("PermanentCloseOpportunity", "");
                }

                if (model.Entity.HasRelocationPlan.HasValue)
                {
                    pdfData.Add("HasRelocationPlan", model.Entity.HasRelocationPlan.Value ? "Yes" : "No");
                }
                else
                {
                    pdfData.Add("HasRelocationPlan", "");
                }

                pdfData.Add("PipelineName", model.Entity.PipelineName);
                pdfData.Add("CompensationAwarded", compensationAwards);
                pdfData.Add("Compensation", compensation);
                string pdfPath = HtmlConversionUtility.HtmlConvertToPDF(HtmlTempalteType.ClosureMemo, pdfData, null);
                EmailSendingResultType result;
                //邮件模板中的数据
                Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                //邮件内容中的键值对
                //bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                bodyValues.Add("StoreCode", model.Entity.USCode);
                bodyValues.Add("StoreName", model.Entity.StoreNameENUS);
                bodyValues.Add("Actor", actor.RoleNameENUS);            ////--呈递人
                bodyValues.Add("WorkflowName", Constants.Closure_Memo); ////--流程名称
                bodyValues.Add("ProjectName", Constants.Closure);       //项目名称
                var webRootUrl = ConfigurationManager.AppSettings["webHost"];
                var viewPage   = string.Format("{0}Closure/Main#/ClosureMemo/ClosureMemoView?projectId={1}",
                                               webRootUrl, model.Entity.ProjectId);
                bodyValues.Add("FormUrl", viewPage);

                //调用邮件服务发送邮件
                using (EmailServiceClient client = new EmailServiceClient())
                {
                    EmailMessage  message = new EmailMessage();
                    StringBuilder sbTo    = new StringBuilder();
                    Dictionary <string, string> attachments = new Dictionary <string, string>();
                    foreach (Employee emp in model.Receivers)
                    {
                        if (sbTo.Length > 0)
                        {
                            sbTo.Append(";");
                        }
                        if (!string.IsNullOrEmpty(emp.Mail))
                        {
                            sbTo.Append(emp.Mail);
                        }
                    }
                    if (sbTo.Length > 0)
                    {
                        sbTo.Append(";");
                    }
                    message.EmailBodyValues = bodyValues;
                    attachments.Add(pdfPath, model.Entity.USCode + " " + FlowCode.Closure_Memo + ".pdf");
                    message.AttachmentsDict = attachments;
                    message.To           = sbTo.ToString();
                    message.TemplateCode = EmailTemplateCode.GBMemoNotification;
                    result = client.SendNotificationEmail(message);
                }

                if (!result.Successful)
                {
                    return(BadRequest(result.ErrorMessage + " " + pdfPath));
                }

                //store关闭不在这里设置,需要判断project状态和closuredata
                //var store = StoreBasicInfo.GetStorInfo(model.Entity.USCode);
                //store.StoreStatus = "suoya301003";
                //store.statusName = "Closed";
                //store.Update();


                if (model.Entity.ClosureNature == ClosureNatureType.Permanent)
                {
                    //选项为永久关闭并且发送成功后关闭任务
                    McdAMEntities _db  = new McdAMEntities();
                    var           task = _db.TaskWork.FirstOrDefault(e => e.ReceiverAccount == ClientCookie.UserCode && e.Status == 0 && e.SourceCode == FlowCode.Closure && e.TypeCode == FlowCode.Closure_Memo && e.RefID == model.Entity.ProjectId);
                    if (task != null)
                    {
                        task.Status     = TaskWorkStatus.K2ProcessApproved;
                        task.FinishTime = DateTime.Now;
                        task.Url        = SiteInfo.GetProjectViewPageUrl(FlowCode.Closure_Memo, task.RefID);

                        //var enableExecutiveSummary = handler.EnableExecutiveSummary(entity.ProjectId.Value);

                        _db.TaskWork.Attach(task);
                        _db.Entry(task).State = EntityState.Modified;
                        _db.SaveChanges();

                        ProjectInfo.FinishNode(model.Entity.ProjectId, FlowCode.Closure_Memo, NodeCode.Closure_ClosureMemo_Input);
                        ProjectInfo.FinishNode(model.Entity.ProjectId, FlowCode.Closure_Memo, NodeCode.Closure_ClosureMemo_SendMemo, ProjectStatus.Finished);

                        #region Memo完成后,设定计划任务
                        var closureConsInvtChecking = new ClosureConsInvtChecking();
                        closureConsInvtChecking.GenerateConsInvtCheckingTask(model.Entity.ProjectId);

                        if (model.Entity.ClosureDate.HasValue)
                        {
                            ScheduleLog.UpdateStoreStatusSchedule(model.Entity.USCode, model.Entity.ProjectId, model.Entity.ClosureDate.Value, ClientCookie.UserCode);
                        }
                        #endregion
                    }
                    ProjectInfo.CompleteMainIfEnable(model.Entity.ProjectId);
                }
                tranScope.Complete();
                return(Ok());
            }
        }
        public IHttpActionResult Send(PostMemo <TempClosureReopenMemo> postData)
        {
            var actor = ProjectUsers.GetProjectUser(postData.Entity.ProjectId, ProjectUserRoleCode.AssetActor);

            using (TransactionScope tranScope = new TransactionScope())
            {
                Save(postData.Entity);
                Dictionary <string, string> pdfData = new Dictionary <string, string>();
                pdfData.Add("WorkflowName", "TempClosure");
                pdfData.Add("ProjectID", postData.Entity.ProjectId);
                pdfData.Add("RegionENUS", postData.Entity.RegionENUS);
                pdfData.Add("RegionZHCN", postData.Entity.RegionZHCN);
                pdfData.Add("MarketENUS", postData.Entity.MarketENUS);
                pdfData.Add("MarketZHCN", postData.Entity.MarketZHCN);
                pdfData.Add("ProvinceENUS", postData.Entity.ProvinceENUS);
                pdfData.Add("ProvinceZHCN", postData.Entity.ProvinceZHCN);
                pdfData.Add("CityENUS", postData.Entity.CityENUS);
                pdfData.Add("CityZHCN", postData.Entity.CityZHCN);
                pdfData.Add("PipelineId", postData.Entity.PipelineId);
                pdfData.Add("USCode", postData.Entity.USCode);
                pdfData.Add("StoreENUS", postData.Entity.StoreENUS);
                pdfData.Add("StoreZHCN", postData.Entity.StoreZHCN);
                pdfData.Add("ActualConsFinishDate", postData.Entity.ActualConsFinishDate.HasValue ? postData.Entity.ActualConsFinishDate.Value.ToString("yyyy-MM-dd") : "");
                pdfData.Add("OpeningDate", postData.Entity.OpeningDate.HasValue ? postData.Entity.OpeningDate.Value.ToString("yyyy-MM-dd") : "");
                pdfData.Add("ProtfolioTypeName", postData.Entity.ProtfolioTypeName);
                pdfData.Add("TAClassificationName", postData.Entity.TAClassificationName);
                pdfData.Add("MarketDesirability", postData.Entity.MarketDesirability);
                pdfData.Add("RERating", postData.Entity.RERating);
                pdfData.Add("BusinessArea", postData.Entity.BusinessArea);
                pdfData.Add("KitchenFloor", postData.Entity.KitchenFloor);
                pdfData.Add("SeatingFloor", postData.Entity.SeatingFloor);
                pdfData.Add("SeatingNum", postData.Entity.SeatingNum);
                pdfData.Add("ParkingNum", postData.Entity.ParkingNum);
                pdfData.Add("ContractType", postData.Entity.ContractType);
                pdfData.Add("Kiosk", postData.Entity.Kiosk);
                pdfData.Add("RERepName", postData.Entity.RERepName);
                pdfData.Add("PlannerName", postData.Entity.PlannerName);
                string pdfPath = HtmlConversionUtility.HtmlConvertToPDF(HtmlTempalteType.TempClosureReopenMemo, pdfData, null);
                EmailSendingResultType result;
                //邮件模板中的数据
                Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                //邮件内容中的键值对
                bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                bodyValues.Add("StoreCode", postData.Entity.USCode);
                bodyValues.Add("StoreName", postData.Entity.StoreENUS);
                bodyValues.Add("Actor", actor.RoleNameENUS);                      ////--呈递人
                bodyValues.Add("WorkflowName", Constants.TempClosure_ReopenMemo); ////--流程名称
                bodyValues.Add("ProjectName", Constants.TempClosure);             //项目名称
                var viewPage = string.Format("{0}/TempClosure/Main#/ReopenMemo/Process/View?projectId={1}",
                                             HttpContext.Current.Request.Url.Authority, postData.Entity.ProjectId);
                bodyValues.Add("FormUrl", viewPage);

                //调用邮件服务发送邮件
                using (EmailServiceClient client = new EmailServiceClient())
                {
                    EmailMessage  message = new EmailMessage();
                    StringBuilder sbTo    = new StringBuilder();
                    StringBuilder sbCC    = new StringBuilder();
                    Dictionary <string, string> attachments = new Dictionary <string, string>();
                    //主送人
                    var actorEmployee = Employee.GetEmployeeByCode(actor.UserAccount);
                    if (actorEmployee != null)
                    {
                        sbTo.Append(actorEmployee.Mail + ";");
                    }
                    var cooList = Employee.GetStoreEmployeesByRole(postData.Entity.USCode, RoleCode.Coordinator);
                    foreach (var coo in cooList)
                    {
                        sbTo.Append(coo.Mail + ";");
                    }
                    var mamList = Employee.GetStoreEmployeesByRole(postData.Entity.USCode, RoleCode.Market_Asset_Mgr);
                    foreach (var mam in mamList)
                    {
                        sbTo.Append(mam.Mail + ";");
                    }
                    var ramList = Employee.GetStoreEmployeesByRole(postData.Entity.USCode, RoleCode.Regional_Asset_Mgr);
                    foreach (var ram in ramList)
                    {
                        sbTo.Append(ram.Mail + ";");
                    }
                    var mcamList = Employee.GetStoreEmployeesByRole(postData.Entity.USCode, RoleCode.MCCL_Asset_Mgr);
                    foreach (var mcam in mcamList)
                    {
                        sbTo.Append(mcam.Mail + ";");
                    }

                    //抄送人
                    if (postData.Receivers != null)
                    {
                        foreach (Employee emp in postData.Receivers)
                        {
                            if (sbCC.Length > 0)
                            {
                                sbCC.Append(";");
                            }
                            if (!string.IsNullOrEmpty(emp.Mail))
                            {
                                sbCC.Append(emp.Mail);
                            }
                        }
                    }
                    if (sbCC.Length > 0)
                    {
                        sbCC.Append(";");
                    }

                    message.EmailBodyValues = bodyValues;
                    string strTitle = FlowCode.TempClosure_ReopenMemo;
                    attachments.Add(pdfPath, strTitle + "_" + postData.Entity.ProjectId + ".pdf");
                    message.AttachmentsDict = attachments;
                    message.To           = sbTo.ToString();
                    message.CC           = sbCC.ToString();
                    message.TemplateCode = EmailTemplateCode.GBMemoNotification;
                    result = client.SendNotificationEmail(message);
                }

                if (!result.Successful)
                {
                    return(BadRequest(result.ErrorMessage + " " + pdfPath));
                }
                var projectInfo = ProjectInfo.Get(postData.Entity.ProjectId, FlowCode.TempClosure_ReopenMemo);
                if (projectInfo.Status == ProjectStatus.UnFinish)
                {
                    postData.Entity.Submit();
                }
                tranScope.Complete();
            }
            return(Ok());
        }
Ejemplo n.º 6
0
        public IHttpActionResult NotifyGBMemo(PostMemo <ReimageGBMemo> postData)
        {
            var actor = ProjectUsers.GetProjectUser(postData.Entity.ProjectId, ProjectUserRoleCode.AssetActor);

            using (TransactionScope tranScope = new TransactionScope())
            {
                Dictionary <string, string> pdfData = new Dictionary <string, string>();
                pdfData.Add("WorkflowName", Constants.Reimage);
                pdfData.Add("ProjectID", postData.Entity.ProjectId);
                pdfData.Add("RegionNameENUS", postData.Entity.Store.StoreBasicInfo.RegionENUS);
                pdfData.Add("RegionNameZHCN", postData.Entity.Store.StoreBasicInfo.RegionZHCN);
                pdfData.Add("MarketNameENUS", postData.Entity.Store.StoreBasicInfo.MarketENUS);
                pdfData.Add("MarketNameZHCN", postData.Entity.Store.StoreBasicInfo.MarketZHCN);
                pdfData.Add("ProvinceNameENUS", postData.Entity.Store.StoreBasicInfo.ProvinceENUS);
                pdfData.Add("ProvinceNameZHCN", postData.Entity.Store.StoreBasicInfo.ProvinceZHCN);
                pdfData.Add("CityNameENUS", postData.Entity.Store.StoreBasicInfo.CityENUS);
                pdfData.Add("CityNameZHCN", postData.Entity.Store.StoreBasicInfo.CityZHCN);
                pdfData.Add("StoreNameENUS", postData.Entity.Store.StoreBasicInfo.NameENUS);
                pdfData.Add("StoreNameZHCN", postData.Entity.Store.StoreBasicInfo.NameZHCN);
                pdfData.Add("USCode", postData.Entity.Store.StoreBasicInfo.StoreCode);

                pdfData.Add("IsClosed", postData.Entity.IsClosed ? "Y" : "N");
                pdfData.Add("IsInOperation", postData.Entity.IsInOperation ? "Y" : "N");
                pdfData.Add("IsMcCafe", postData.Entity.IsMcCafe ? "Y" : "N");
                pdfData.Add("IsKiosk", postData.Entity.IsKiosk ? "Y" : "N");
                pdfData.Add("IsMDS", postData.Entity.IsMDS ? "Y" : "N");
                pdfData.Add("Is24Hour", postData.Entity.Is24Hour ? "Y" : "N");
                var consInfo = ReimageConsInfo.GetConsInfo(postData.Entity.ProjectId);
                postData.Entity.ReinvestInfo = ReinvestmentBasicInfo.GetByConsInfoId(consInfo.Id);
                pdfData.Add("GBDate", postData.Entity.rmgInfo.GBDate.HasValue ? postData.Entity.rmgInfo.GBDate.Value.ToString("yyyy-MM-dd") : "");
                pdfData.Add("ConstCompletionDate", postData.Entity.ReinvestInfo.ConsCompletionDate.HasValue ? postData.Entity.ReinvestInfo.ConsCompletionDate.Value.ToString("yyyy-MM-dd") : "");
                pdfData.Add("ReopenDate", postData.Entity.rmgInfo.ReopenDate.HasValue ? postData.Entity.rmgInfo.ReopenDate.Value.ToString("yyyy-MM-dd") : "");

                string pdfPath = HtmlConversionUtility.HtmlConvertToPDF(HtmlTempalteType.GBMemo, pdfData, null);
                EmailSendingResultType result;
                //邮件模板中的数据
                Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                //邮件内容中的键值对
                bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                bodyValues.Add("StoreCode", postData.Entity.Store.StoreBasicInfo.StoreCode);
                bodyValues.Add("StoreName", postData.Entity.Store.StoreBasicInfo.NameENUS);
                bodyValues.Add("Actor", actor.RoleNameENUS);              ////--呈递人
                bodyValues.Add("WorkflowName", Constants.Reimage_GBMemo); ////--流程名称
                bodyValues.Add("ProjectName", Constants.Reimage);         //项目名称

                string viewPage = string.Format("{0}/Reimage/Main#/GBMemo/Process/View?projectId={1}",
                                                ConfigurationManager.AppSettings["webHost"], postData.Entity.ProjectId);
                bodyValues.Add("FormUrl", viewPage);

                //调用邮件服务发送邮件
                using (EmailServiceClient client = new EmailServiceClient())
                {
                    EmailMessage  message = new EmailMessage();
                    StringBuilder sbTo    = new StringBuilder();
                    Dictionary <string, string> attachments = new Dictionary <string, string>();
                    foreach (Employee emp in postData.Receivers)
                    {
                        if (sbTo.Length > 0)
                        {
                            sbTo.Append(";");
                        }
                        if (!string.IsNullOrEmpty(emp.Mail))
                        {
                            sbTo.Append(emp.Mail);
                        }
                    }
                    if (sbTo.Length > 0)
                    {
                        sbTo.Append(";");
                    }
                    message.EmailBodyValues = bodyValues;
                    string strTitle = FlowCode.Reimage_GBMemo;
                    attachments.Add(pdfPath, strTitle + "_" + postData.Entity.ProjectId + ".pdf");
                    message.AttachmentsDict = attachments;
                    message.To           = sbTo.ToString();
                    message.TemplateCode = EmailTemplateCode.GBMemoNotification;
                    result = client.SendGBMemoNotificationEmail(message);
                }

                if (!result.Successful)
                {
                    return(BadRequest(result.ErrorMessage + " " + pdfPath));
                }
                postData.Entity.CompleteNotifyTask(postData.Entity.ProjectId);
                tranScope.Complete();
            }
            return(Ok());
        }
Ejemplo n.º 7
0
        public IHttpActionResult GetRenewalApprovers(string flowCode, string projectId = "")
        {
            if (string.IsNullOrEmpty(flowCode))
            {
                return(BadRequest("flowCode is NULL"));
            }

            RenewalInfo renewalInfo = RenewalInfo.Get(projectId);

            if (renewalInfo == null)
            {
                return(BadRequest("Could not find the Renewal Info, please check it!"));
            }
            var dicUsers = new Dictionary <string, object>();
            var consMgr  = ProjectUsers.GetProjectUser(projectId, ProjectUserRoleCode.CM);

            switch (flowCode)
            {
            case FlowCode.Renewal_Letter:
            {
                var info = RenewalInfo.Get(projectId);
                dicUsers.Add("AssetManagerCode", info.AssetManagerAccount);
                dicUsers.Add("AssetManagers", new[] { Employee.GetSimpleEmployeeByCode(info.AssetManagerAccount) });
            }
            break;

            case FlowCode.Renewal_GBMemo:
            {
                var refTableId = RenewalInfo.GetRefTableId("RenewalGBMemo", projectId);
                var approvers  = ApproveDialogUser.GetApproveDialogUser(refTableId) ?? new ApproveDialogUser();
                dicUsers.Add("ConstructionManagerCode", approvers.ConstructionManagerCode);
                dicUsers.Add("ConstructionManagers", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Cons_Mgr));
            }
            break;

            case FlowCode.Renewal_ConsInfo:
            {
                var refTableId = RenewalInfo.GetRefTableId("RenewalConsInfo", projectId);
                var approvers  = ApproveDialogUser.GetApproveDialogUser(refTableId) ?? new ApproveDialogUser();
                dicUsers.Add("ConstructionManagerCode", approvers.ConstructionManagerCode);
                dicUsers.Add("MCCLConsManagerCode", approvers.MCCLConsManagerCode);
                dicUsers.Add("ConstructionManagers", new List <SimpleEmployee> {
                        new SimpleEmployee {
                            Code = consMgr.UserAccount, NameENUS = consMgr.UserNameENUS, NameZHCN = consMgr.UserNameZHCN
                        }
                    });
                dicUsers.Add("MCCLConsManagers", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.MCCL_Cons_Manager));
            }
            break;

            case FlowCode.Renewal_Tool:
            {
                var refTableId = RenewalInfo.GetRefTableId("RenewalTool", projectId);
                var approvers  = ApproveDialogUser.GetApproveDialogUser(refTableId) ?? new ApproveDialogUser();
                dicUsers.Add("FMCode", approvers.FMCode);
                dicUsers.Add("FMs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Finance_Manager));
            }
            break;

            case FlowCode.Renewal_LegalApproval:
            {
                var legal      = ProjectUsers.GetProjectUser(projectId, ProjectUserRoleCode.Legal);
                var refTableId = RenewalInfo.GetRefTableId("RenewalLegalApproval", projectId);
                var approvers  = ApproveDialogUser.GetApproveDialogUser(refTableId) ?? new ApproveDialogUser();
                dicUsers.Add("LegalCode", legal.UserAccount);
                dicUsers.Add("Legals", new List <SimpleEmployee> {
                        new SimpleEmployee {
                            Code = legal.UserAccount, NameENUS = legal.UserNameENUS, NameZHCN = legal.UserNameZHCN
                        }
                    });
                dicUsers.Add("GeneralCounselCode", approvers.GeneralCounselCode);
                dicUsers.Add("GeneralCounsels", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Legal_GeneralCounsel));
            }
            break;

            case FlowCode.Renewal_Package:
            {
                var refTableId = RenewalInfo.GetRefTableId("RenewalPackage", projectId);
                var approvers  = ApproveDialogUser.GetApproveDialogUser(refTableId) ?? new ApproveDialogUser();
                dicUsers.Add("MarketMgrCode", approvers.MarketMgrCode);
                dicUsers.Add("MarketMgrs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Market_Asset_Mgr));
                dicUsers.Add("RegionalMgrCode", approvers.RegionalMgrCode);
                dicUsers.Add("RegionalMgrs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Regional_Asset_Mgr));
                dicUsers.Add("MDDCode", approvers.MDDCode);
                dicUsers.Add("MDDs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Market_DD));
                dicUsers.Add("GMCode", approvers.GMCode);
                dicUsers.Add("GMs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.GM));
                dicUsers.Add("FCCode", approvers.FCCode);
                dicUsers.Add("FCs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Finance_Controller));
                dicUsers.Add("RDDCode", approvers.RDDCode);
                dicUsers.Add("RDDs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.Regional_DD));
                dicUsers.Add("VPGMCode", approvers.VPGMCode);
                dicUsers.Add("VPGMs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.VPGM));
                dicUsers.Add("MCCLAssetDtrCode", approvers.MCCLAssetDtrCode);
                dicUsers.Add("MCCLAssetDtrs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.MCCL_Asset_Director));
                dicUsers.Add("CDOCode", approvers.CDOCode);
                dicUsers.Add("CDOs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.CDO));
                dicUsers.Add("ManagingDirectorCode", approvers.MngDirectorCode);
                dicUsers.Add("ManagingDirectors", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.MD));        //MCCL_Cons_Director
                dicUsers.Add("MCCLAssetMgrCode", approvers.MCCLAssetMgrCode);
                dicUsers.Add("MCCLAssetMgrs", Employee.GetStoreEmployeesByRole(renewalInfo.USCode, RoleCode.MCCL_Asset_Mgr));
                dicUsers.Add("NoticeUsers", !string.IsNullOrEmpty(approvers.NoticeUsers) ? Employee.GetSimpleEmployeeByCodes(approvers.NoticeUsers.Split(';')) : null);
                dicUsers.Add("NecessaryNoticeUsers", !string.IsNullOrEmpty(approvers.NecessaryNoticeUsers) ? Employee.GetSimpleEmployeeByCodes(approvers.NecessaryNoticeUsers.Split(';')) : Employee.GetSimpleEmployeeByCodes(NecessaryNoticeConfig.Search(i => i.FlowCode == FlowCode.Renewal_Package && !string.IsNullOrEmpty(i.DefaultUserCode)).Select(i => i.DefaultUserCode).ToArray()));
            }
            break;
            }
            return(Ok(dicUsers));
        }
        public IHttpActionResult SendMsg(NotificationMsg msg)
        {
            using (var scope = new TransactionScope())
            {
                Notification.Send(msg);
                if (msg.IsSendEmail)
                {
                    //邮件模板中的数据
                    Dictionary <string, string> bodyValues = new Dictionary <string, string>();
                    if (string.IsNullOrEmpty(msg.UsCode))
                    {
                        var projectInfo = ProjectInfo.FirstOrDefault(e => e.ProjectId == msg.ProjectId);
                        if (projectInfo != null)
                        {
                            msg.UsCode = projectInfo.USCode;
                        }
                    }
                    var stor = StoreBasicInfo.GetStorInfo(msg.UsCode);
                    bodyValues.Add("ApplicantName", ClientCookie.UserNameENUS);//--提交人
                    bodyValues.Add("StoreCode", stor.StoreCode);
                    bodyValues.Add("StoreName", stor.NameENUS);
                    bodyValues.Add("Comments", msg.Message);
                    var actor = ProjectUsers.GetProjectUser(msg.ProjectId, ProjectUserRoleCode.AssetActor);
                    bodyValues.Add("Actor", actor.RoleNameENUS);////--呈递人
                    var flow = FlowInfo.Get(msg.FlowCode);
                    if (flow != null)
                    {
                        bodyValues.Add("WorkflowName", flow.NameENUS); ////--流程名称
                    }
                    if (msg.ProjectId.ToLower().IndexOf("rebuild") >= 0)
                    {
                        bodyValues.Add("ProjectName", Constants.Rebuild); //项目名称
                    }
                    else if (msg.ProjectId.ToLower().IndexOf("reimage") >= 0)
                    {
                        bodyValues.Add("ProjectName", Constants.Reimage); //项目名称
                    }
                    else if (msg.ProjectId.ToLower().IndexOf("closure") >= 0)
                    {
                        bodyValues.Add("ProjectName", Constants.Closure); //项目名称
                    }
                    else if (msg.ProjectId.ToLower().IndexOf("renewal") >= 0)
                    {
                        bodyValues.Add("ProjectName", "Renewal"); //项目名称
                    }
                    else if (msg.ProjectId.ToLower().IndexOf("majorlease") >= 0)
                    {
                        bodyValues.Add("ProjectName", "MajorLease"); //项目名称
                    }
                    else
                    {
                        bodyValues.Add("ProjectName", Constants.TempClosure);//项目名称
                    }
                    string viewPage = "";
                    if (!string.IsNullOrEmpty(msg.FlowCode))
                    {
                        var tmp = msg.FlowCode.Split('_');
                        if (tmp[0] == "Rebuild" && tmp[1] == "Package")
                        {
                            tmp[1] = "RebuildPackage";
                        }
                        viewPage = string.Format("{0}/{1}/Main#/{2}/Process/View?projectId={3}",
                                                 ConfigurationManager.AppSettings["webHost"], tmp[0], tmp[1], msg.ProjectId);
                    }

                    bodyValues.Add("FormUrl", viewPage);

                    var Receivers = Employee.GetSimpleEmployeeByCodes(msg.ReceiverCodeList.ToArray());
                    //调用邮件服务发送邮件
                    EmailSendingResultType result;
                    using (EmailServiceClient client = new EmailServiceClient())
                    {
                        EmailMessage  message = new EmailMessage();
                        StringBuilder sbTo    = new StringBuilder();
                        Dictionary <string, string> attachments = new Dictionary <string, string>();
                        foreach (var emp in Receivers)
                        {
                            if (sbTo.Length > 0)
                            {
                                sbTo.Append(";");
                            }
                            if (!string.IsNullOrEmpty(emp.Mail))
                            {
                                sbTo.Append(emp.Mail);
                            }
                        }
                        if (sbTo.Length > 0)
                        {
                            sbTo.Append(";");
                        }
                        message.EmailBodyValues = bodyValues;
                        message.To           = sbTo.ToString();
                        message.TemplateCode = EmailTemplateCode.Notification;
                        result = client.SendNotificationEmail(message);
                    }

                    if (!result.Successful)
                    {
                        return(BadRequest(result.ErrorMessage));
                    }
                }
                scope.Complete();
            }
            return(Ok());
        }