public object GetSystem(object ViewModel, Guid _SystemID, List <Guid> TargetIDs) { string InterfaceName = "*"; DateTime CurrentDate = DateTime.Now; List <MonthlyReportDetail> Result = (List <MonthlyReportDetail>)ViewModel; if (Result != null && Result.Count() > 0) { CurrentDate = Result[0].CreateTime; } C_System sys = StaticResource.Instance[_SystemID, CurrentDate]; if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ISystem") != null && sys.Configuration.Element("Interfaces").Elements("ISystem").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ISystem").ToList()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } return(this[InterfaceName].GetSystem(ViewModel, _SystemID, TargetIDs)); }
public List <C_DocumentTree> GetDocumentTreeList(string SysID) { Guid _SystemID = SysID.ToGuid(); List <C_DocumentTree> documentTreeList = C_DocumentTreeOperator.Instance.GetDocumentTreeList(_SystemID).ToList(); if (documentTreeList.Count > 0) { var root = documentTreeList.Where(p => p.ParentID == "99999999-9999-9999-9999-FFFFFFFFFFFF".ToGuid()).FirstOrDefault(); if (root != null) { root.open = true; } return(documentTreeList); } else { C_System sys = StaticResource.Instance[_SystemID, DateTime.Now]; Guid treeRootID = AddDocumentTreeNode("99999999-9999-9999-9999-FFFFFFFFFFFF", SysID, sys.SystemName + "根目录"); if (treeRootID != Guid.Empty) { return(C_DocumentTreeOperator.Instance.GetDocumentTreeList(_SystemID).ToList()); } else { return(new List <C_DocumentTree>()); } } }
/// <summary> /// 根据不同的系统,获取不同的未完成公司ID /// </summary> /// <param name="ViewModel"></param> /// <param name="SystemID"></param> /// <returns></returns> public List <Guid> GetLastMonthCompaniesID(object ViewModel, Guid SystemID) { string InterfaceName = "*"; DateTime CurrentDate = DateTime.Now; List <A_MonthlyReportDetail> RptList = (List <A_MonthlyReportDetail>)ViewModel; if (RptList != null && RptList.Count > 0) { CurrentDate = RptList[0].CreateTime; } C_System sys = StaticResource.Instance[SystemID, CurrentDate]; if (sys.Category == 4) { InterfaceName = "Directly"; } else { if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ILastMonthCompanies") != null && sys.Configuration.Element("Interfaces").Elements("ILastMonthCompanies").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ILastMonthCompanies").ToList()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } } return(this[InterfaceName].GetLastMonthCompaniesID(ViewModel)); }
private void LoadData() { if (!string.IsNullOrEmpty(Request.QueryString["BusinessID"].ToString())) { hideMonthReportID.Value = Request.QueryString["BusinessID"].ToString(); B_MonthlyReport bmonthReport = B_MonthlyreportOperator.Instance.GetMonthlyreport(Guid.Parse(hideMonthReportID.Value)); if (bmonthReport != null) { hideSystemID.Value = bmonthReport.SystemID.ToString(); hideFinYear.Value = bmonthReport.FinYear.ToString(); hideFinMonth.Value = bmonthReport.FinMonth.ToString(); hideProcessCode.Value = StaticResource.Instance[bmonthReport.SystemID, DateTime.Now].Configuration.Element("ProcessCode").Value; C_System system = StaticResource.Instance.SystemList.Where(p => p.ID == bmonthReport.SystemID).FirstOrDefault(); var areaName = ""; if (bmonthReport.AreaID != Guid.Empty) { var area = StaticResource.Instance.OrgList[system.ID].Where(x => x.ID == bmonthReport.AreaID).FirstOrDefault(); areaName = "-" + area.CnName; } if (system != null) { lblName.Text = system.SystemName + areaName + bmonthReport.FinYear + "-" + bmonthReport.FinMonth + lblName.Text; } } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (!string.IsNullOrEmpty(HttpContext.Current.Request["SysId"])) { SysId = Guid.Parse(HttpContext.Current.Request["SysId"]); } if (!string.IsNullOrEmpty(HttpContext.Current.Request["FinYear"])) { FinYear = Convert.ToInt32(HttpContext.Current.Request["FinYear"]); } if (!string.IsNullOrEmpty(HttpContext.Current.Request["FinMonth"])) { FinMonth = Convert.ToInt32(HttpContext.Current.Request["FinMonth"]); } List <A_MonthlyReportDetail> am = A_MonthlyreportdetailOperator.Instance.GetAMonthlyreportdetailList(SysId, FinYear, FinMonth).ToList(); if (am.Count > 0) { B_MonthlyReport BM = B_MonthlyreportOperator.Instance.GetMonthlyreport(am[0].MonthlyReportID); T = BM.CreateTime; } SystemModel = StaticResource.Instance[SysId, T]; if (SystemModel.Category == 4) { DownExcelCate2(); } else { DownExcelCate1(); } }
/// <summary> /// 根据更改的板块加载不通页面 /// </summary> private void ChangeSystem() { C_System cs = C_SystemOperator.Instance.GetSystem(Guid.Parse(ddlSystem.SelectedValue)); if (cs.Category == 1) { //Server.Transfer("~/BusinessReport/TargetReported.aspx?SystemId=" + cs.ID); Response.Redirect("~/BusinessReport/TargetReported.aspx?SystemId=" + cs.ID); } else if (cs.Category == 2) { //Server.Transfer("~/BusinessReport/TargetProReported.aspx?SystemId=" + cs.ID); Response.Redirect("~/BusinessReport/TargetProReported.aspx?SystemId=" + cs.ID); } else if (cs.Category == 3) { //Server.Transfer("~/BusinessReport/TargetGroupReported.aspx?SystemId=" + cs.ID); Response.Redirect("~/BusinessReport/TargetGroupReported.aspx?SystemId=" + cs.ID); } else if (cs.Category == 4) { //Server.Transfer("~/BusinessReport/TargetDirectlyReported.aspx?SystemId=" + cs.ID); Response.Redirect("~/BusinessReport/TargetDirectlyReported.aspx?SystemId=" + cs.ID); } }
/// <summary> /// 获取公司排序 /// </summary> /// <param name="SystemID"></param> /// <param name="TemplateType"></param> /// <param name="RptDetailList"></param> /// <param name="Paramters"></param> /// <returns></returns> public List <MonthlyReportDetail> GetSequence(Guid SystemID, string TemplateType, List <MonthlyReportDetail> RptDetailList, string Paramters = null) { string InterfaceName = "*"; DateTime CurrentDate = DateTime.Now; if (RptDetailList != null && RptDetailList.Count() > 0) { CurrentDate = RptDetailList[0].CreateTime; } C_System sys = StaticResource.Instance[SystemID, CurrentDate]; if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ISequence") != null && sys.Configuration.Element("Interfaces").Elements("ISequence").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ISequence").ToList()) { if (e.Attribute("TemplateType").Value.ToLower().Trim() == TemplateType.ToLower().Trim()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } } return(this[InterfaceName].GetSequence(RptDetailList, Paramters)); }
public List <DictionaryVmodel> GetSummaryRptDataSource(ReportInstance RptModel, bool IsTargetPlan) { _Target = RptModel._Target; Report = RptModel.Report; _System = RptModel._System; FinYear = RptModel.FinYear; FinMonth = RptModel.FinMonth; ReportDetails = RptModel.ReportDetails; string MonthlyReportIDs = ""; ReportDetails.GroupBy(x => x.MonthlyReportID).Select(x => x.Key).ToList().ForEach(x => MonthlyReportIDs += "," + x); MonthlyReportIDs = MonthlyReportIDs.Trim(','); if (ReportDetails != null && ReportDetails.Count() > 0) { _System = StaticResource.Instance[_System.ID, ReportDetails[0].CreateTime]; _Target = StaticResource.Instance.GetTargetList(_System.ID, ReportDetails[0].CreateTime).ToList(); } List <MonthReportSummaryViewModel> listMRSVM = GetMonthlyReportDetailSummaryList(); //List<B_Attachment> listAtt = GetListAtt(_System.ID); List <B_Attachment> listAtt = GetListAtt(MonthlyReportIDs); List <DictionaryVmodel> listMonthReportSummary = new List <DictionaryVmodel>(); string strReportDescription = ""; if (Report != null) { strReportDescription = Report.Description; } listMonthReportSummary.Add(new DictionaryVmodel("ReportInstance", RptModel)); listMonthReportSummary.Add(new DictionaryVmodel("月报说明", strReportDescription)); listMonthReportSummary.Add(new DictionaryVmodel("月度经营报告", listMRSVM, "", GetSummaryMonthlyReportHtmlTemplate(_System.Configuration))); listMonthReportSummary.Add(new DictionaryVmodel("附件", listAtt)); listMonthReportSummary.Add(new DictionaryVmodel("完成情况明细查询条件", SpliteCompanyPropertyXml("Search", _System.Configuration))); return(listMonthReportSummary); }
public void TransferOtherPage(Guid SystemID) { Guid sysID = SystemID; int Year; if (ddlYear.SelectedValue == "") { DateTime datetime = StaticResource.Instance.GetReportDateTime(); Year = datetime.Year; } else { //年下拉 Year = int.Parse(ddlYear.SelectedValue); } List <A_TargetPlanDetail> Detail = A_TargetplandetailOperator.Instance.GetTargetplandetailList(SystemID, Year).ToList(); C_System sysModel = StaticResource.Instance[sysID, DateTime.Now]; if (Detail.Count > 0) { sysModel = StaticResource.Instance[sysID, B_TargetplanOperator.Instance.GetTargetplan(Detail[0].TargetPlanID).CreateTime]; } if (sysModel.Category != 3) { Response.Redirect("../SystemConfiguration/TargetCollectDisplay_B.aspx?SystemID=" + HttpUtility.UrlEncode(SystemID.ToString())); } }
public int GetCompanyExceptionTarget(C_Company company) { DateTime CurrentDate = DateTime.Now; C_System SysModel = StaticResource.Instance[company.SystemID, CurrentDate]; int result = 0; //代表是在项目系统里 if (SysModel.Category == 2) { if (company.CompanyProperty1 == "尾盘") { result = 1; } else { result = 0; } } else { //上报不考核 if (company.CompanyProperty1 == "筹备门店") { result = 1; } else { result = 0; } } return(result); }
/// <summary> /// A表重新计算 /// </summary> /// <param name="RptDetail"></param> /// <param name="TemplateType"></param> /// <returns></returns> public object Calculation(A_MonthlyReportDetail RptDetail, string TemplateType) { string InterfaceName = "*"; C_System sys = StaticResource.Instance[RptDetail.SystemID, DateTime.Now]; if (sys.Category == 2 || sys.GroupType == "ProSystem") //如果系统是项目系统 { InterfaceName = "RProject"; //项目公司有单独的计算 } else if (sys.Category == 3) { InterfaceName = "RGroup"; //集团总部有单独的计算 } else { C_Target T = StaticResource.Instance.TargetList[RptDetail.SystemID].Find(t => t.ID == RptDetail.TargetID); if (T != null) { InterfaceName = "R" + T.TargetType.ToString(); } } return(this[InterfaceName].Calculation(RptDetail)); }
protected override void OnInit(EventArgs e) { PermissionHelper.GetPermission(); if (PermissionHelper.EnablePermission) { list = PermissionHelper.GetStartProcessList(); ExceptionHelper.TrueThrow <ArgumentNullException>(list == null, "Argument GetStartProcessList is Empty"); if (list.Count > 0) { C_System cSystem = new C_System(); if (!string.IsNullOrEmpty(Request.QueryString["SystemID"]))//看是否有传过来SystemID,如果有 { SystemID = HttpUtility.UrlDecode(Request.QueryString["SystemID"]); cSystem = StaticResource.Instance.SystemList.Where(p => p.ID == Guid.Parse(SystemID)).FirstOrDefault(); } else { cSystem = StaticResource.Instance.SystemList.Where(p => p.SystemName == list.FirstOrDefault()).FirstOrDefault(); } if (cSystem != null) { TransferOtherPage(cSystem.ID); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["BusinessID"] != null) { if (!string.IsNullOrEmpty(Request.QueryString["BusinessID"].ToString())) { hideMonthReportID.Value = Request.QueryString["BusinessID"].ToString(); B_MonthlyReport bmonthReport = B_MonthlyreportOperator.Instance.GetMonthlyreport(Guid.Parse(hideMonthReportID.Value)); if (bmonthReport != null) { hideSystemID.Value = bmonthReport.SystemID.ToString(); hideFinYear.Value = bmonthReport.FinYear.ToString(); hideFinMonth.Value = bmonthReport.FinMonth.ToString(); HideProcessCode.Value = StaticResource.Instance[bmonthReport.SystemID, bmonthReport.CreateTime].Configuration.Element("ProcessCode").Value; C_System system = StaticResource.Instance.SystemList.Where(p => p.ID == bmonthReport.SystemID).FirstOrDefault(); if (system != null) { lblName.Text = system.SystemName + bmonthReport.FinYear + "-" + bmonthReport.FinMonth + lblName.Text; } } } } }
/// <summary> /// 根据不同的系统中的配置项,获取不同的月报说明 /// </summary> /// <param name="ViewModel"></param> /// <param name="SystemID"></param> /// <param name="CurrentLoginName"></param> /// <returns></returns> public Hashtable GetMonthDescriptionValue(object ViewModel, Guid SystemID, string CurrentLoginName) { string InterfaceName = "*"; DateTime CurrentDate = DateTime.Now; List <MonthlyReportDetail> RptList = (List <MonthlyReportDetail>)ViewModel; if (RptList == null || RptList.Count <= 0) { CurrentDate = RptList[0].CreateTime; } C_System sys = StaticResource.Instance[SystemID, CurrentDate]; if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("IGetMonthDescriptionValue") != null && sys.Configuration.Element("Interfaces").Elements("IGetMonthDescriptionValue").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("IGetMonthDescriptionValue").ToList()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } return(this[InterfaceName].GetMonthDescriptionValue(ViewModel, CurrentLoginName)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain"; HttpPostedFile file = context.Request.Files["FileData"]; if (!string.IsNullOrEmpty(HttpContext.Current.Request["SysId"])) { SysId = Guid.Parse(HttpContext.Current.Request["SysId"]); } SystemModel = C_SystemOperator.Instance.GetSystem(SysId); string filePath = "UploadFile\\" + WebHelper.DateTimeNow.ToString("yyyy-MM-dd"); string uploadpath = Path.Combine(UploadFilePath, filePath); string templetePath = uploadpath; string filePathName = Path.Combine(uploadpath, file.FileName);//合并上传文件地址 if (Directory.Exists(uploadpath) == false) { Directory.CreateDirectory(uploadpath); //如果上传文件路径不存在,则创建该路径。 } file.SaveAs(filePathName); //保存文件到磁盘 string error = ""; UpLoadExcel(out error, context, filePathName); context.Response.Write(error); }
/// <summary> /// 审批页面使用,审批页面数据不判断权限 /// </summary> /// <param name="unUseful">没用,只是为了重载</param> /// <param name="monthReportID"></param> /// <param name="isAll"></param> public ReportInstance(Guid?monthReportID, Guid?systemBatchId, bool isAll) { if (monthReportID != null && monthReportID != Guid.Empty) { _MonthReportID = monthReportID.Value; B_MonthlyReport report = B_MonthlyreportOperator.Instance.GetMonthlyreport(_MonthReportID); _SystemID = report.SystemID; _SystemBatchID = report.SystemBatchID; TargetPlanID = report.TargetPlanID; AreaID = report.AreaID; FinYear = report.FinYear; FinMonth = report.FinMonth; } else if (systemBatchId != null && monthReportID != Guid.Empty) { B_SystemBatch b_SystemBatch = B_SystemBatchOperator.Instance.GetSystemBatch(systemBatchId.Value); C_System c_System = StaticResource.Instance.SystemList.Where(x => x.GroupType == b_SystemBatch.BatchType).FirstOrDefault(); _SystemID = c_System.ID; _SystemBatchID = b_SystemBatch.ID; TargetPlanID = b_SystemBatch.TargetPlanID; FinYear = b_SystemBatch.FinYear; FinMonth = b_SystemBatch.FinMonth; } DataSource = "Draft"; UserPermission = false; InitialData(true, isAll); }
protected void Save_Click(object sender, EventArgs e) { string xml = returnxml.Value; error = ""; XElement x = null; if (xml != "") { x = XElement.Parse(xml); Check(x); } else { Response.Write("<script>alert('数据不能为空')</script>"); } if (error != "") { Response.Write("<script>alert('该公式错误,请检查!')</script>"); } else { string sysid = ddlSystem.SelectedValue; model = C_SystemOperator.Instance.GetSystem(Guid.Parse(sysid)); model.Configuration = x; C_SystemOperator.Instance.UpdateSystem(model); Response.Write("<script>alert('保存成功')</script>"); } }
/// <summary> /// 获取经营报告明细指标数据 /// </summary> /// <param name="RptModel">ReportInstance:通用类型数据</param> /// <param name="strCompanyProperty">公司属性:在查询经营系统中用到,项目系统中暂时没用到, (这里占用该字段来标注,引擎的调用方式:当strCompanyProperty=“Reported”时,表示是在指标上报页面调用的,反之则是在查询的时候调用)</param> /// <param name="strOrderType">排序字段:在经营系统中用到,在项目系统中被当作IsPlan字段来用</param> /// <param name="IncludeHaveDetail">是否包含明细:在经营系统中用到,在项目系统中被当作IsLatestVersion用</param> /// <returns></returns> public List <DictionaryVmodel> GetManageDetailRptDataSource(ReportInstance RptModel, string strCompanyProperty, string strOrderType, bool IncludeHaveDetail) { //默认是走经营系统 string InterfaceName = "*"; C_System sys = RptModel._System; if (sys != null) { if (sys.Category == 2) { InterfaceName = "ProRptDetail"; return(this[InterfaceName].GetManageDetailRptDataSource(RptModel, strCompanyProperty, strOrderType, IncludeHaveDetail)); } else if (sys.Category == 3) { InterfaceName = "GroupRptDetail"; return(this[InterfaceName].GetManageDetailRptDataSource(RptModel, strCompanyProperty, strOrderType, IncludeHaveDetail)); } else if (sys.Category == 4) { InterfaceName = "DirectlyRptDetail"; return(this[InterfaceName].GetManageDetailRptDataSource(RptModel, strCompanyProperty, strOrderType, IncludeHaveDetail)); } } return(this[InterfaceName].GetManageDetailRptDataSource(RptModel, strCompanyProperty, strOrderType, IncludeHaveDetail)); }
public List <DictionaryVmodel> GetSummaryRptDataSource(ReportInstance RptModel, bool IsTargetPlan) { _Target = RptModel._Target; Report = RptModel.Report; _System = RptModel._System; FinYear = RptModel.FinYear; FinMonth = RptModel.FinMonth; ReportDetails = RptModel.ReportDetails; string MonthlyReportIDs = ""; ReportDetails.GroupBy(x => x.MonthlyReportID).Select(x => x.Key).ToList().ForEach(x => MonthlyReportIDs += "," + x); MonthlyReportIDs = MonthlyReportIDs.Trim(','); //这里对系统和指标再次做一次验证 //if (ReportDetails != null && ReportDetails.Count() > 0) //{ // B_MonthlyReport bm = B_MonthlyreportOperator.Instance.GetMonthlyreport(RptModel.ReportDetails[0].MonthlyReportID); // _System = StaticResource.Instance[_System.ID, bm.CreateTime]; // _Target = StaticResource.Instance.GetTargetList(_System.ID, bm.CreateTime).ToList(); //} List <MonthReportSummaryViewModel> listMRSVM = GetMonthlyReportDetailSummaryList(IsTargetPlan); // List<B_Attachment> listAtt = GetListAtt(_System.ID); List <B_Attachment> listAtt = GetListAtt(MonthlyReportIDs); List <DictionaryVmodel> listMonthReportSummary = new List <DictionaryVmodel>(); string strReportDescription = ""; #region 月报说明 if (RptModel.ReportDetails.Any()) { XElement element = _System.Configuration; if (element.Elements("Report").Elements("Rgroup") != null) { strReportDescription = element.Element("Report").GetElementValue("Rgroup", ""); if (!string.IsNullOrEmpty(strReportDescription)) { System.Collections.Hashtable p = MonthDescriptionValueEngine.MonthDescriptionValueService.GetMonthDescriptionValue(RptModel.ReportDetails, _System.ID, RptModel.CurrentLoginName); foreach (string key in p.Keys) { strReportDescription = strReportDescription.Replace("【" + key + "】", p[key].ToString()); } } } } #endregion //if (Report != null) //{ // strReportDescription = Report.Description; //} listMonthReportSummary.Add(new DictionaryVmodel("ReportInstance", RptModel)); listMonthReportSummary.Add(new DictionaryVmodel("月报说明", strReportDescription)); listMonthReportSummary.Add(new DictionaryVmodel("月度经营报告", listMRSVM, "", GetSummaryMonthlyReportHtmlTemplate(_System.Configuration))); listMonthReportSummary.Add(new DictionaryVmodel("附件", listAtt)); listMonthReportSummary.Add(new DictionaryVmodel("完成情况明细查询条件", SpliteCompanyPropertyXml("Search", _System.Configuration))); listMonthReportSummary.Add(new DictionaryVmodel("是否包含区域", StaticResource.Instance.GetSystem_Regional(_System.ID))); return(listMonthReportSummary); }
public void TransferOtherPage(Guid SystemID) { Guid sysID = SystemID; if (ddlMonth.SelectedValue == "") { DateTime datetime = StaticResource.Instance.GetReportDateTime(); finMonth = datetime.Month; finYear = datetime.Year; } else { finMonth = int.Parse(ddlMonth.SelectedValue); //年下拉 finYear = int.Parse(ddlYear.SelectedValue); } C_System sysModel = StaticResource.Instance[sysID, DateTime.Now]; if (chkIsLastestVersion.Checked) { B_MonthlyReport B_monthRpt = B_MonthlyreportOperator.Instance.GetMonthlyReport(sysID, finYear, finMonth); if (B_monthRpt != null) { sysModel = StaticResource.Instance[sysID, B_monthRpt.CreateTime]; } } else { A_MonthlyReport A_monthRpt = A_MonthlyreportOperator.Instance.GetAMonthlyReport(sysID, finYear, finMonth); if (A_monthRpt != null) { sysModel = StaticResource.Instance[sysID, A_monthRpt.CreateTime]; } } if (sysModel.Category == 1) { Response.Redirect("TargetRpt.aspx?_sysid=" + HttpUtility.UrlEncode(sysID.ToString()) + "&_finMonth=" + HttpUtility.UrlEncode(finMonth.ToString()) + "&_finYear=" + HttpUtility.UrlEncode(finYear.ToString()) + "&IsLastestVersion=" + chkIsLastestVersion.Checked); } else if (sysModel.Category == 2) { Response.Redirect("ProMonthReport.aspx?_sysid=" + HttpUtility.UrlEncode(sysID.ToString()) + "&_finMonth=" + HttpUtility.UrlEncode(finMonth.ToString()) + "&_finYear=" + HttpUtility.UrlEncode(finYear.ToString()) + "&IsLastestVersion=" + chkIsLastestVersion.Checked); } else if (sysModel.Category == 3) { return; } else if (sysModel.Category == 4) { Response.Redirect("TargetDirectlyRpt.aspx?_sysid=" + HttpUtility.UrlEncode(sysID.ToString()) + "&_finMonth=" + HttpUtility.UrlEncode(finMonth.ToString()) + "&_finYear=" + HttpUtility.UrlEncode(finYear.ToString()) + "&IsLastestVersion=" + chkIsLastestVersion.Checked); } }
/// <summary> /// 计算引擎(优先级是在指标上配置,然后是在系统上配置) /// </summary> /// <param name="RptDetail"></param> /// <param name="TemplateType"></param> /// <returns></returns> public B_MonthlyReportDetail Calculation(B_MonthlyReportDetail RptDetail, string TemplateType) { string InterfaceName = "*"; C_System sys = new C_System(); if (RptDetail.CreateTime != null && RptDetail.CreateTime != DateTime.MinValue && RptDetail.CreateTime.ToString() != "0001/1/1 0:00:00") { sys = StaticResource.Instance[RptDetail.SystemID, RptDetail.CreateTime]; } else { sys = StaticResource.Instance[RptDetail.SystemID, DateTime.Now]; } //最后是系统设置 if (sys != null) { if (sys.Category == 4) { InterfaceName = "Directly"; } } //然后是系统的配置 if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ICalculationEvaluation") != null && sys.Configuration.Element("Interfaces").Elements("ICalculationEvaluation").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ICalculationEvaluation").ToList()) { //if (e.Attribute("TemplateType").Value.ToLower().Trim() == TemplateType.ToLower().Trim()) //{ InterfaceName = e.Attribute("InterfaceName").Value.Trim(); //} } } } //优先级是指标 C_Target target = StaticResource.Instance.TargetList[RptDetail.SystemID].Find(p => p.ID == RptDetail.TargetID); if (target != null && target.Configuration.Element("Interfaces") != null) { if (target.Configuration.Element("Interfaces").Elements("ICalculationEvaluation") != null && target.Configuration.Element("Interfaces").Elements("ICalculationEvaluation").ToList().Count > 0) { foreach (XElement e in target.Configuration.Element("Interfaces").Elements("ICalculationEvaluation").ToList()) { //if (e.Attribute("TemplateType").Value.ToLower().Trim() == TemplateType.ToLower().Trim()) //{ InterfaceName = e.Attribute("InterfaceName").Value.Trim(); //} } } } return((B_MonthlyReportDetail)this[InterfaceName].Calculation(RptDetail)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; HttpPostedFile file = context.Request.Files["FileData"]; if (!string.IsNullOrEmpty(HttpContext.Current.Request["SysId"])) { SysId = Guid.Parse(HttpContext.Current.Request["SysId"]); } if (!string.IsNullOrEmpty(HttpContext.Current.Request["FinYear"])) { FinYear = Convert.ToInt32(HttpContext.Current.Request["FinYear"]); } if (!string.IsNullOrEmpty(HttpContext.Current.Request["FinMonth"])) { FinMonth = Convert.ToInt32(HttpContext.Current.Request["FinMonth"]); } List <A_MonthlyReportDetail> am = A_MonthlyreportdetailOperator.Instance.GetAMonthlyreportdetailList(SysId, FinYear, FinMonth).ToList(); if (am.Count > 0) { B_MonthlyReport BM = B_MonthlyreportOperator.Instance.GetMonthlyreport(am[0].MonthlyReportID); T = BM.CreateTime; } SystemModel = StaticResource.Instance[SysId, T]; //文件相对路径 string filePath = "UploadFile\\" + WebHelper.DateTimeNow.ToString("yyyy-MM-dd"); string uploadpath = Path.Combine(UploadFilePath, filePath); string templetePath = uploadpath; string filePathName = Path.Combine(uploadpath, file.FileName);//合并上传文件地址 if (Directory.Exists(uploadpath) == false) { Directory.CreateDirectory(uploadpath); //如果上传文件路径不存在,则创建该路径。 } file.SaveAs(filePathName); //保存文件到磁盘 string error = ""; //UpTargetPlanDetailExcel(out error, context, filePathName); //读取上传Excel文件 if (SystemModel.Category == 4) { UpLoadExcel2(out error, context, filePathName); } else { UpLoadExcel(out error, context, filePathName); } context.Response.Write(error); //context.Response.Write("Hello World"); }
public List <DictionaryVmodel> GetDetailRptDataSource(ReportInstance RptModel, string strCompanyProperty, string strOrderType, bool IncludeHaveDetail) { _System = RptModel._System; FinMonth = RptModel.FinMonth; FinYear = RptModel.FinYear; _Target = RptModel._Target; ReportDetails = RptModel.ReportDetails; _SystemID = _System.ID; IsLatestVersion = IncludeHaveDetail; IsPlanStr = strOrderType; currRptModel = RptModel; if (!string.IsNullOrEmpty(strCompanyProperty)) { if (strCompanyProperty == "Reported") { _System = StaticResource.Instance[_System.ID, DateTime.Now]; } else { strCompanyPropertys = strCompanyProperty; if (ReportDetails != null && ReportDetails.Count() > 0) { _System = StaticResource.Instance[_System.ID, ReportDetails[0].CreateTime]; _Target = StaticResource.Instance.GetTargetList(_System.ID, ReportDetails[0].CreateTime).ToList(); } } } else { strCompanyPropertys = ""; } List <ProjectCounter> ProjectList = new List <ProjectCounter>(); XElement element = null; //加载XML,系统配置信息 element = _System.Configuration; if (element.Elements("ProjectCompanyDetail").Elements("ProjectCounter") != null) { List <XElement> ProjectCompanys = element.Elements("ProjectCompanyDetail").Elements("ProjectCounter").ToList(); foreach (XElement ProCompany in ProjectCompanys) { ProjectList.Add(new ProjectCounter(ProCompany)); } } List <DictionaryVmodel> list = FormartProData(ProjectList); return(list); }
public List <DictionaryVmodel> GetManageDetailRptDataSource(ReportInstance RptModel, string strCompanyProperty, string strOrderType, bool IncludeHaveDetail) { _System = RptModel._System; FinMonth = RptModel.FinMonth; FinYear = RptModel.FinYear; _Target = RptModel._Target; ReportDetails = RptModel.ReportDetails; this.IncludeHaveDetail = IncludeHaveDetail; strMonthReportOrderType = strOrderType; CurrentLoginName = RptModel.CurrentLoginName; //这里strCompanyProperty参数,不仅是公司属性,同时也是判断:调用的来源(strCompanyProperty=="Reported"),表示是从上报页面调用,反之不是则是从查询页面调用的 if (!string.IsNullOrEmpty(strCompanyProperty)) { if (strCompanyProperty == "Reported") { _System = StaticResource.Instance[_System.ID, DateTime.Now]; } else { strCompanyPropertys = strCompanyProperty; if (ReportDetails != null && ReportDetails.Count() > 0) { _System = StaticResource.Instance[_System.ID, ReportDetails[0].CreateTime]; _Target = StaticResource.Instance.GetTargetList(_System.ID, ReportDetails[0].CreateTime).ToList(); } } } else { strCompanyPropertys = ""; if (ReportDetails != null && ReportDetails.Count() > 0) { _System = StaticResource.Instance[_System.ID, ReportDetails[0].CreateTime]; _Target = StaticResource.Instance.GetTargetList(_System.ID, ReportDetails[0].CreateTime).ToList(); } } List <VTarget> lstVTarget = SplitCompleteTargetDetailXml(_System.Configuration); List <VItemCompanyProperty> lstVItemCompanyProperty = null; if (SpliteCompanyPropertyXml("List", _System.Configuration).Count > 0) { lstVItemCompanyProperty = SpliteCompanyPropertyXml("List", _System.Configuration)[0].listCP.ToList(); } List <DictionaryVmodel> listvmodel = FromatData(lstVTarget, lstVItemCompanyProperty); if (lstVTarget.Where(m => m.IsBlendTarget == true).Any()) { listvmodel = GetMergeComplateMonthReportDetail(listvmodel); } return(listvmodel); }
/// <summary> /// 正常计算 /// </summary> /// <param name="RptDetail"></param> /// <param name="TemplateType"></param> /// <returns></returns> public object Calculation(B_MonthlyReportDetail RptDetail, string TemplateType) { string InterfaceName = "*"; C_System sys = new C_System(); if (RptDetail.CreateTime != null && RptDetail.CreateTime != DateTime.MinValue) { sys = StaticResource.Instance[RptDetail.SystemID, RptDetail.CreateTime]; } else { sys = StaticResource.Instance[RptDetail.SystemID, DateTime.Now]; } if (sys.Category == 2 || sys.GroupType == "ProSystem") //如果系统是项目系统 { InterfaceName = "Project"; //项目公司有单独的计算 } else if (sys.Category == 3) { InterfaceName = "Group"; //集团总部有单独的计算 } else { C_Target T = StaticResource.Instance.TargetList[RptDetail.SystemID].Find(t => t.ID == RptDetail.TargetID); if (T != null) { InterfaceName = T.TargetType.ToString(); } } if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ITargetCalculation") != null && sys.Configuration.Element("Interfaces").Elements("ITargetCalculation").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ITargetCalculation").ToList()) { if (e.Attribute("TemplateType").Value.ToLower().Trim() == TemplateType.ToLower().Trim()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } } return(this[InterfaceName].Calculation(RptDetail)); }
//protected string GetDescription(Guid systemtId, int year, int month) //{ // string Description = string.Empty; // C_System sysModel = StaticResource.Instance[systemtId, DateTime.Now]; // XElement element = sysModel.Configuration; // var RptList = B_MonthlyreportdetailOperator.Instance.GetMonthlyReportDetailList_Approve(systemtId, year, month, Guid.Empty,,false); // if (element.Elements("Report").Elements("Rgroup") != null) // { // Description = element.Element("Report").GetElementValue("Rgroup", ""); // if (!string.IsNullOrEmpty(Description)) // { // Hashtable p = MonthDescriptionValueEngine.MonthDescriptionValueService.GetMonthDescriptionValue(RptList, systemtId, ""); // foreach (string key in p.Keys) // { // Description = Description.Replace("【" + key + "】", p[key].ToString()); // } // } // } // return Description; //} public void AddMonthlyReport(B_SystemBatch batch, C_System c_System, string description) { B_MonthlyReport bmr = new B_MonthlyReport(); bmr.ID = batch.ID; bmr.SystemID = c_System.ID; bmr.AreaID = Guid.Empty; bmr.FinMonth = batch.FinMonth; bmr.FinYear = batch.FinYear; bmr.Status = 2; bmr.WFStatus = "Progress"; bmr.CreateTime = DateTime.Now; bmr.Description = description; bmr.ID = B_MonthlyreportOperator.Instance.AddMonthlyreport(bmr); }
/// <summary> /// 通过批次获取月报的审批 /// </summary> private void LoadBatchData() { hideBusinessID.Value = Request.QueryString["BusinessID"]; hideProType.Value = Request.QueryString["ProType"]; #region 获取子流程和主流程的审批日志 _BatchModel = B_SystemBatchOperator.Instance.GetSystemBatch(Guid.Parse(Request.QueryString["BusinessID"])); List <ProcessLog> listALLProLog = new List <ProcessLog>(); List <ProcessLog> listProLog = new List <ProcessLog>(); //JsonConvert.DeserializeObject<List<ProcessLog>>(_BatchModel.Opinions); List <V_SubReport> BatchRptList = JsonConvert.DeserializeObject <List <V_SubReport> >(_BatchModel.SubReport); for (int i = 0; i < BatchRptList.Count; i++) { if (BPF.Workflow.Client.WFClientSDK.Exist(BatchRptList[i].ReportID.ToString())) { listProLog.AddRange(BPF.Workflow.Client.WFClientSDK.GetProcessLogList(BatchRptList[i].ReportID.ToString())); } } List <ProcessLog> listBatchProLog = null; if (BPF.Workflow.Client.WFClientSDK.Exist(_BatchModel.ID.ToString())) { listBatchProLog = BPF.Workflow.Client.WFClientSDK.GetProcessLogList(_BatchModel.ID.ToString()); //JsonConvert.DeserializeObject<List<ProcessLog>>(_BatchModel.Batch_Opinions); } if (listBatchProLog != null) { listALLProLog.AddRange(listBatchProLog); } if (listProLog != null) { listALLProLog.AddRange(listProLog); } if (listALLProLog != null) { //这里去掉汇总审批时的虚拟节点同意日志 HideOpinions.Value = JsonConvert.SerializeObject(listALLProLog.Where(p => p.NodeType != 7).OrderByDescending(p => p.FinishDateTime)); } #endregion C_System c_System = StaticResource.Instance.SystemList.Where(x => x.GroupType == _BatchModel.BatchType).FirstOrDefault(); hideSystemID.Value = c_System.ID.ToString(); hideProcessCode.Value = StaticResource.Instance[c_System.ID, DateTime.Now].Configuration.Element("ProcessCode").Value; lblName.Text = _BatchModel.FinYear + "-" + _BatchModel.FinMonth + "月度经营报告"; hideFinMonth.Value = _BatchModel.FinMonth.ToString(); hideProType.Value = Request.QueryString["ProType"]; hideBatchID.Value = _BatchModel.ID.ToString(); //hideMonthReportID.Value = _BatchModel.ID.ToString(); hideMonthReportID.Value = Guid.Empty.ToString(); hideFinYear.Value = _BatchModel.FinYear.ToString(); }
public MissTargetEvaluationModel GetContrastRemark(string SystemID, string TargetID, string FinMonth, string FinYear, bool IsPro) { MissTargetEvaluationModel result = new MissTargetEvaluationModel(); C_System sys = C_SystemOperator.Instance.GetSystem(Guid.Parse(SystemID)); if (sys.GroupType != "ProSystem") { result.SystemName = sys.SystemName; } else { result.SystemName = "境内项目"; } R_MissTargetEvaluationScope model = new R_MissTargetEvaluationScope(); Guid TarID = Guid.Empty; if (Guid.Parse(TargetID) == Guid.Empty) { TarID = Guid.Parse("99999999-9999-9999-9999-999999999999"); result.TargetName = "门店数量"; } else { TarID = Guid.Parse(TargetID); result.TargetName = C_TargetOperator.Instance.GetTarget(Guid.Parse(TargetID)).TargetName; } Guid SysID = Guid.Parse(SystemID); string m = "ContrastRemark"; if (IsPro == false) { m = "AContrastRemark"; } model = R_MissTargetEvaluationScopeOperator.Instance.GetEvaluationDetailByType(SysID, TarID, int.Parse(FinYear), int.Parse(FinMonth), m); if (model == null) { result.EvaluationRemark = null; } else { result.EvaluationRemark = model.ContrastRemark; } return(result); }
/// <summary> /// 获取上报计划数 /// </summary> /// <param name="_SystemID"></param> /// <param name="FinYear"></param> /// <param name="TargetPlanID"></param> /// <param name="IsLatestVersion"></param> /// <returns></returns> public object GetTargetPlanSource(Guid _SystemID, int FinYear, Guid TargetPlanID, bool IsLatestVersion) { string InterfaceName = "*"; C_System sys = StaticResource.Instance[_SystemID, DateTime.Now]; if (sys != null && sys.Configuration.Element("Interfaces") != null) { if (sys.Configuration.Element("Interfaces").Elements("ITargetPlanInstance") != null && sys.Configuration.Element("Interfaces").Elements("ITargetPlanInstance").ToList().Count > 0) { foreach (XElement e in sys.Configuration.Element("Interfaces").Elements("ITargetPlanInstance").ToList()) { InterfaceName = e.Attribute("InterfaceName").Value.Trim(); } } } return((object)(this[InterfaceName].GetTargetPlanSource(_SystemID, FinYear, TargetPlanID, IsLatestVersion))); }
public ResultContext GetMonthDetailList(string SystemID, int Year, int Month, string TargetName, string TargetPlanID, bool IncludeHaveDetail, bool IsLatestVersion = false, string DataSource = "Draft", bool IsAll = false) { try { MonthlyReportController ms = new MonthlyReportController(); S_OrganizationalActionOperator oa = new S_OrganizationalActionOperator(); TargetApproveController ta = new TargetApproveController(); List <DictionaryVmodel> li = ms.GetReportInstance(SystemID, Year, Month, TargetPlanID, IsLatestVersion, DataSource, IsAll); if (li == null || li.Count == 0 || li[0].ObjValue == null) { return(new ResultContext()); } List <DictionaryVmodel> listM = new List <DictionaryVmodel>(); bool type = true; if (StaticResource.Instance.GetSystem_Regional(SystemID.ToGuid())) { //经营报告明细 listM = ms.GetManageDetailRptDataSource((ReportInstance)li[0].ObjValue, "", "Detail", IncludeHaveDetail); } else { type = false; //完成情况明细 listM = ms.GetDetailRptDataSource((ReportInstance)li[0].ObjValue, "", "Detail", IncludeHaveDetail); } Guid result = Guid.Empty; Guid.TryParse(SystemID, out result); if (result == Guid.Empty) { return(new ResultContext((int)StatusCodeEnum.isFalse, "系统编码错误")); } C_System system = new C_System(); system = StaticResource.Instance[SystemID.ToGuid(), DateTime.Now]; return(new ResultContext(new { title = system.SystemName, type, list = listM })); } catch (Exception ex) { return(new ResultContext((int)StatusCodeEnum.isCatch, ex.ToString())); throw; } }