public ISlideCollection _plus_jp_beimengzhidi_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { #region 市场量价 if (item.qtcs == "市场量价") { var tp = new Presentation(str); var temp = tp.Slides; var page1 = temp[0]; #region 商品房 var jbz_cjba_spf = (from a in Cache_data_cjjl.jbz.AsEnumerable() where a["zt"].ToString() == item.ztcs[0] group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, cjje = s.Sum(a => a["cjje"].longs()), jzmj = s.Sum(a => a["jzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var jbz_xzys_spf = (from a in Cache_data_xzys.jbz.AsEnumerable() where a["zt"].ToString() == item.ztcs[0] group a by new { zc = a["zc"] } into s select new { zc = s.Key.zc, xzgy = s.Sum(a => a["jzmj"].doubls()) + s.Sum(a => a["fzzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var temp_spf = (from a in jbz_cjba_spf join b in jbz_xzys_spf on a.zc equals b.zc into tempdata from tt in tempdata.DefaultIfEmpty() select new { zcmc = a.zcmc, xzgyl = tt == null ? 0 : tt.xzgy, //这里主要第二个集合有可能为空。需要判断 cjmj = a.jzmj, jmjj = a.cjje / a.jzmj }).ToList(); DataTable dt_spf = new DataTable(); dt_spf.Columns.Add("周次名称"); dt_spf.Columns.Add("供应体量(万方)"); dt_spf.Columns.Add("成交体量(万方)"); dt_spf.Columns.Add("建面均价"); foreach (var item_spf in temp_spf) { DataRow dr = dt_spf.NewRow(); dr["周次名称"] = item_spf.zcmc; dr["供应体量(万方)"] = item_spf.xzgyl.mj_wf(); dr["成交体量(万方)"] = item_spf.cjmj.mj_wf(); dr["建面均价"] = item_spf.jmjj.je_y(); dt_spf.Rows.Add(dr); } Office_Charts.Chart_gxfx(page1, dt_spf, 3); #endregion #region 商品住宅 var jbz_cjba_zz = (from a in Cache_data_cjjl.jbz.AsEnumerable() where a["zt"].ToString() == item.ztcs[0] && (a["yt"].ToString() == "别墅" || a["yt"].ToString() == "高层" || a["yt"].ToString() == "小高层" || a["yt"].ToString() == "洋房" || a["yt"].ToString() == "洋楼") group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, cjje = s.Sum(a => a["cjje"].longs()), jzmj = s.Sum(a => a["jzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var jbz_xzys_zz = (from a in Cache_data_xzys.jbz.AsEnumerable() where a["zt"].ToString() == item.ztcs[0] && (a["tyyt"].ToString() == "别墅" || a["tyyt"].ToString() == "高层" || a["tyyt"].ToString() == "小高层" || a["tyyt"].ToString() == "洋房" || a["tyyt"].ToString() == "洋楼") group a by new { zc = a["zc"] } into s select new { zc = s.Key.zc, xzgy = s.Sum(a => a["jzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var temp_zz = (from a in jbz_cjba_zz join b in jbz_xzys_zz on a.zc equals b.zc into tempdata from tt in tempdata.DefaultIfEmpty() select new { zcmc = a.zcmc, xzgyl = tt == null ? 0 : tt.xzgy, //这里主要第二个集合有可能为空。需要判断 cjmj = a.jzmj, jmjj = a.cjje / a.jzmj }).ToList(); DataTable dt_zz = new DataTable(); dt_zz.Columns.Add("周次名称"); dt_zz.Columns.Add("供应体量(万方)"); dt_zz.Columns.Add("成交体量(万方)"); dt_zz.Columns.Add("建面均价"); foreach (var item_zz in temp_zz) { DataRow dr = dt_zz.NewRow(); dr["周次名称"] = item_zz.zcmc; dr["供应体量(万方)"] = item_zz.xzgyl.mj_wf(); dr["成交体量(万方)"] = item_zz.cjmj.mj_wf(); dr["建面均价"] = item_zz.jmjj.je_y(); dt_zz.Rows.Add(dr); } Office_Charts.Chart_gxfx(page1, dt_zz, 4); #endregion IAutoShape text0_1 = (IAutoShape)page1.Shapes[0]; text0_1.TextFrame.Text = string.Format(text0_1.TextFrame.Text, item.ztcs[0], temp_spf[temp_spf.Count - 1].xzgyl.mj_wf(), temp_spf[temp_spf.Count - 1].cjmj.mj_wf(), temp_spf[temp_spf.Count - 1].jmjj.je_y()); IAutoShape text0_2 = (IAutoShape)page1.Shapes[1]; text0_2.TextFrame.Text = string.Format(text0_2.TextFrame.Text, item.ztcs[0], temp_zz[temp_zz.Count - 1].xzgyl.mj_wf(), temp_zz[temp_zz.Count - 1].cjmj.mj_wf(), temp_zz[temp_zz.Count - 1].jmjj.je_y()); IAutoShape text0_3 = (IAutoShape)page1.Shapes[2]; text0_3.TextFrame.Text = string.Format(text0_3.TextFrame.Text, item.bamc); t.AddClone(page1); } #endregion else { var tp = new Presentation(str); var temp = tp.Slides; var page2 = temp[1]; IAutoShape text1_1 = (IAutoShape)page2.Shapes[0]; text1_1.TextFrame.Text = string.Format(text1_1.TextFrame.Text, item.bamc); IAutoShape text1_2 = (IAutoShape)page2.Shapes[2]; text1_2.TextFrame.Text = string.Format(text1_2.TextFrame.Text, item.bamc); #region 市场成交走势 #region 商务 if (item.ytcs[0] == "商务") { var jbz_cjba_sw = (from a in Cache_data_cjjl.jbz.AsEnumerable() where (a["yt"].ToString() == "商务" && a["xfyt"].ToString() == "商务公寓" && a["hx"].ToString() == "LOFT") group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, cjje = s.Sum(a => a["cjje"].longs()), jzmj = s.Sum(a => a["jzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var jbz_xzys_sw = (from a in Cache_data_xzys.jbz.AsEnumerable() where a["wylx"].ToString() == "SOHO" || a["wylx"].ToString() == "LOFT" group a by new { zc = a["zc"] } into s select new { zc = s.Key.zc, xzgy = s.Sum(a => a["jzmj"].doubls()) + s.Sum(a => a["fzzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var temp_spf = (from a in jbz_cjba_sw join b in jbz_xzys_sw on a.zc equals b.zc into tempdata from tt in tempdata.DefaultIfEmpty() select new { zcmc = a.zcmc, xzgyl = tt == null ? 0 : tt.xzgy, //这里主要第二个集合有可能为空。需要判断 cjmj = a.jzmj, jmjj = a.cjje / a.jzmj }).ToList(); DataTable dt_spf = new DataTable(); dt_spf.Columns.Add("周次名称"); dt_spf.Columns.Add("供应体量(㎡)"); dt_spf.Columns.Add("成交体量(㎡)"); dt_spf.Columns.Add("建面均价(元/㎡)"); foreach (var item_spf in temp_spf) { DataRow dr = dt_spf.NewRow(); dr["周次名称"] = item_spf.zcmc; dr["供应体量(㎡)"] = item_spf.xzgyl.mj(); dr["成交体量(㎡)"] = item_spf.cjmj.mj(); dr["建面均价(元/㎡)"] = item_spf.jmjj.je_y(); dt_spf.Rows.Add(dr); } Office_Charts.Chart_gxfx(page2, dt_spf, 1); var bz_cjba_sw_pm = (from a in Cache_data_cjjl.jbz.AsEnumerable() where (a["yt"].ToString() == "商务" && a["xfyt"].ToString() == "商务公寓" && a["hx"].ToString() == "LOFT" && a["zc"].ints() == Base_date.bz && a["nf"].ints() == Base_date.bn) group a by new { lpmc = a["lpmc"], qy = a["qy"] } into s select new { lpmc = s.Key.lpmc, qy = s.Key.qy, cjts = s.Count(), jzmj = s.Sum(a => a["jzmj"].doubls()).mj(), cjje = s.Sum(a => a["cjje"].doubls()).je_wy(), jmjj = (s.Sum(a => a["cjje"].doubls()) / s.Sum(a => a["jzmj"].doubls())).je_y() }).OrderByDescending(m => m.cjje).Take(10).ToList(); DataTable pm_tb = new DataTable(); pm_tb.Columns.Add("排名"); pm_tb.Columns.Add("项目名称"); pm_tb.Columns.Add("区域"); pm_tb.Columns.Add("成交套数"); pm_tb.Columns.Add("成交面积"); pm_tb.Columns.Add("成交金额"); pm_tb.Columns.Add("成交建均"); for (int i = 0; i < bz_cjba_sw_pm.Count(); i++) { DataRow drss = pm_tb.NewRow(); drss["排名"] = i + 1; drss["项目名称"] = bz_cjba_sw_pm[i].lpmc; drss["区域"] = bz_cjba_sw_pm[i].qy; drss["成交套数"] = bz_cjba_sw_pm[i].cjts; drss["成交面积"] = bz_cjba_sw_pm[i].jzmj; drss["成交金额"] = bz_cjba_sw_pm[i].cjje; drss["成交建均"] = bz_cjba_sw_pm[i].jmjj; pm_tb.Rows.Add(drss); } Office_Tables.SetTable(page2, pm_tb, 3, null, null); t.AddClone(page2); } #endregion #region 商铺 else if (item.ytcs[0] == "商铺") { var jbz_cjba_spf = (from a in Cache_data_cjjl.jbz.AsEnumerable() where a["yt"].ToString() == item.ytcs[0] group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, cjje = s.Sum(a => a["cjje"].longs()), jzmj = s.Sum(a => a["jzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var jbz_xzys_spf = (from a in Cache_data_xzys.jbz.AsEnumerable() where a["tyyt"].ToString() == item.ytcs[0] group a by new { zc = a["zc"] } into s select new { zc = s.Key.zc, xzgy = s.Sum(a => a["jzmj"].doubls()) + s.Sum(a => a["fzzmj"].doubls()), }).OrderBy(m => m.zc).ToList(); var temp_spf = (from a in jbz_cjba_spf join b in jbz_xzys_spf on a.zc equals b.zc into tempdata from tt in tempdata.DefaultIfEmpty() select new { zcmc = a.zcmc, xzgyl = tt == null ? 0 : tt.xzgy, //这里主要第二个集合有可能为空。需要判断 cjmj = a.jzmj, jmjj = a.cjje / a.jzmj }).ToList(); DataTable dt_spf = new DataTable(); dt_spf.Columns.Add("周次名称"); dt_spf.Columns.Add("供应体量(万方)"); dt_spf.Columns.Add("成交体量(万方)"); dt_spf.Columns.Add("建面均价"); foreach (var item_spf in temp_spf) { DataRow dr = dt_spf.NewRow(); dr["周次名称"] = item_spf.zcmc; dr["供应体量(万方)"] = item_spf.xzgyl.mj_wf(); dr["成交体量(万方)"] = item_spf.cjmj.mj_wf(); dr["建面均价"] = item_spf.jmjj.je_y(); dt_spf.Rows.Add(dr); } Office_Charts.Chart_gxfx(page2, dt_spf, 1); var bz_cjba_sw_pm = (from a in Cache_data_cjjl.jbz.AsEnumerable() where a["yt"].ToString() == item.ytcs[0] && a["zc"].ints() == Base_date.bz && a["nf"].ints() == Base_date.bn group a by new { lpmc = a["lpmc"], zt = a["zt"] } into s select new { lpmc = s.Key.lpmc, zt = s.Key.zt, cjts = s.Count(), jzmj = s.Sum(a => a["jzmj"].doubls()).mj(), cjje = s.Sum(a => a["cjje"].doubls()).je_wy(), jmjj = (s.Sum(a => a["cjje"].doubls()) / s.Sum(a => a["jzmj"].doubls())).je_y() }).OrderByDescending(m => m.cjje).Take(10).ToList(); DataTable pm_tb = new DataTable(); pm_tb.Columns.Add("排名"); pm_tb.Columns.Add("项目名称"); pm_tb.Columns.Add("区域"); pm_tb.Columns.Add("成交套数"); pm_tb.Columns.Add("成交面积"); pm_tb.Columns.Add("成交金额"); pm_tb.Columns.Add("成交建均"); for (int i = 0; i < bz_cjba_sw_pm.Count(); i++) { DataRow drss = pm_tb.NewRow(); drss["排名"] = i + 1; drss["项目名称"] = bz_cjba_sw_pm[i].lpmc; drss["区域"] = bz_cjba_sw_pm[i].zt; drss["成交套数"] = bz_cjba_sw_pm[i].cjts; drss["成交面积"] = bz_cjba_sw_pm[i].jzmj; drss["成交金额"] = bz_cjba_sw_pm[i].cjje; drss["成交建均"] = bz_cjba_sw_pm[i].jmjj; pm_tb.Rows.Add(drss); } Office_Tables.SetTable(page2, pm_tb, 3, null, null); t.AddClone(page2); } #endregion #endregion #region 典型竞争项目 var page3 = temp[2]; DataTable dt_jzxm = new DataTable(); dt_jzxm.Columns.Add(Base_Config_Jzgj.项目名称); dt_jzxm.Columns.Add(Base_Config_Jzgj.业态); dt_jzxm.Columns.Add(Base_Config_Jzgj.竞争格局_主力面积区间); dt_jzxm.Columns.Add(Base_Config_Cjba.本周_备案套数); dt_jzxm.Columns.Add(Base_Config_Cjba.本周_建面均价); dt_jzxm.Columns.Add(Base_Config_Cjba.本周_套均总价); dt_jzxm.Columns.Add("产品、配置及营销"); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { IAutoShape text2 = (IAutoShape)page3.Shapes[0]; text2.TextFrame.Text = string.Format(text2.TextFrame.Text, item.bamc); dt_jzxm = GET_JPXM_BX(dt_jzxm, item.jpxmlb); Office_Tables.SetJP_BEIMENGZHIDI_JINGZHENGXIANGMU_Table(page3, dt_jzxm, 1, null, null); t.AddClone(page3); } #endregion } } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }
public ISlideCollection _plus_jp_yangguang100aerle_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { var tp = new Presentation(str); var temp = tp.Slides; var page1 = temp[0]; IAutoShape text0_1 = (IAutoShape)page1.Shapes[1]; text0_1.TextFrame.Text = string.Format(text0_1.TextFrame.Text, item.bamc, item.ytcs[0]); var page2 = temp[1]; DataTable dt2_0 = new DataTable(); dt2_0.Columns.Add(Base_Config_Jzgj.项目名称); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周来电); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周到访量); dt2_0.Columns.Add(Base_Config_Cjba.周_备案套数); dt2_0.Columns.Add(Base_Config_Cjba.周_建面均价); dt2_0.Columns.Add(Base_Config_Cjba.周_套均总价); dt2_0.Columns.Add(Base_Config_Cjba.周_建筑面积); dt2_0.Columns.Add(Base_Config_Cjba.周_成交金额); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购金额); dt2_0.Columns.Add(Base_Config_Cjba.本周_备案套数); dt2_0.Columns.Add(Base_Config_Cjba.本周_建面均价); dt2_0.Columns.Add(Base_Config_Cjba.本周_套均总价); dt2_0.Columns.Add(Base_Config_Cjba.本周_建筑面积); dt2_0.Columns.Add(Base_Config_Cjba.本周_成交金额); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购金额); dt2_0.Columns.Add("剩余套数"); dt2_0.Columns.Add(Base_Config_Rgsj.本周_变化原因); dt2_0 = GET_JPBA_BX(dt2_0, item); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { IAutoShape text2 = (IAutoShape)page2.Shapes[1]; text2.TextFrame.Text = string.Format(text2.TextFrame.Text, item.bamc, item.ytcs[0]); dt2_0 = GET_JPXM_BX(dt2_0, item.jpxmlb); Office_Tables.SetJP_CHONGQING18TI_Table(page2, dt2_0, 2, null, null); t.AddClone(page2); } var page3 = temp[2]; IAutoShape text3 = (IAutoShape)page3.Shapes[1]; text3.TextFrame.Text = string.Format(text3.TextFrame.Text, item.bamc, item.ytcs[0]); DataTable dt1 = new DataTable(); dt1.Columns.Add(Base_Config_Jzgj.项目名称); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); dt1.Columns.Add(Base_Config_Rgsj.本周_活动); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt1 = GET_JPXM_BX(dt1, item.jpxmlb); Office_Tables.SetTable(page3, dt1, 2, null, null); } t.AddClone(page3); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { foreach (var jpitem in item.jpxmlb) { var tp1 = new Presentation(str); var temp1 = tp1.Slides; var page4 = temp1[3]; DataTable dttemp = Cache_data_cjjl.jbz.Select("zc>=" + (Base_date.bz - 3)).CopyToDataTable(); var data = from a in dttemp.AsEnumerable() where a["lpmc"].ToString() == jpitem.lpcs[0] && a["yt"].ToString() == jpitem.ytcs[0] group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, ts = s.Sum(m => m["ts"].ints()), jmjj = s.Sum(m => m["cjje"].longs()) / s.Sum(m => m["jzmj"].doubls()) }; DataTable dt4_0 = new DataTable(); dt4_0.Columns.Add("周次名称"); dt4_0.Columns.Add("精装成交套数"); dt4_0.Columns.Add("精装成交均价"); foreach (var tempitem in data) { DataRow dr = dt4_0.NewRow(); dr["周次名称"] = tempitem.zcmc; dr["精装成交套数"] = tempitem.ts; dr["精装成交均价"] = tempitem.jmjj.je_y(); dt4_0.Rows.Add(dr); } IAutoShape text4_0 = (IAutoShape)page4.Shapes[0]; text4_0.TextFrame.Text = string.Format(text4_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text4_1 = (IAutoShape)page4.Shapes[1]; text4_1.TextFrame.Text = string.Format(text4_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); //无法将类型为“Aspose.Slides.OleObjectFrame”的对象强制转换为类型“Aspose.Slides.Charts.IChart”。 //Office_Charts.Chart_gxfx(pag4, dt4_0, 2); t.AddClone(page4); var pag5 = temp1[4]; IAutoShape text5_0 = (IAutoShape)pag5.Shapes[1]; text5_0.TextFrame.Text = string.Format(text5_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text5_1 = (IAutoShape)pag5.Shapes[2]; text5_1.TextFrame.Text = string.Format(text5_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); t.AddClone(pag5); } } } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }
/// <summary> /// 差别十分巨大,无法重用 /// </summary> /// <param name="str"></param> /// <param name="cjbh"></param> /// <returns></returns> public ISlideCollection _plus_jp_langshi_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in jbzzs(str)) { t.AddClone(item); } foreach (var item in param) { var tp = new Presentation(str); var temp = tp.Slides; #region 竞品分布 var page1 = temp[9]; #endregion t.AddClone(page1); #region 格局统计 var page2 = temp[10]; IAutoShape text1 = (IAutoShape)page2.Shapes[2]; text1.TextFrame.Text = string.Format(text1.TextFrame.Text, item.bamc); DataTable dt = new DataTable(); dt.Columns.Add(Base_Config_Jzgj.项目名称); dt.Columns.Add(Base_Config_Jzgj.业态); dt.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt.Columns.Add("bz" + Base_Config_Rgsj.本周_认购建面均价); dt.Columns.Add(Base_Config_Rgsj.周_认购套数); dt.Columns.Add(Base_Config_Rgsj.周_认购套内均价); dt.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt.Columns.Add(Base_Config_Rgsj.本周_认购套内均价); dt.Columns.Add(Base_Config_Rgsj.本周_认购建面均价); dt.Columns.Add("heji"); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt = GET_JPXM_BX(dt, item.jpxmlb); Office_Tables.SetJP_Langshi_JPBX_Table(page2, dt, 5, null, null); } #endregion t.AddClone(page2); #region 近期动作 var page3 = temp[11]; DataTable dt1 = new DataTable(); dt1.Columns.Add(Base_Config_Jzgj.竞争格局名称); dt1.Columns.Add(Base_Config_Jzgj.项目名称); dt1.Columns.Add(Base_Config_Jzgj.业态); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); dt1.Columns.Add(Base_Config_Rgsj.本周_活动); dt1.Columns.Add(Base_Config_Rgsj.本周_营销动作); dt1.Columns.Add("bkfsjcxqk"); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt1 = GET_JPXM_BX(dt1, item.jpxmlb); Office_Tables.SetTable(page3, dt1, 2, null, null); } #endregion t.AddClone(page3); } return(t); } catch (Exception e) { Base_Log.Log("插件:" + cjbh + "生成报错*****" + e.Message); return(null); } }
public ISlideCollection _plus_jp_zhaoshang_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { var tp = new Presentation(str); var temp = tp.Slides; int[] index1 = { 1, 0 }; int[] index2 = { 2, 3 }; int[] index3 = { 4, 2, 1 }; int[] index4 = { 1, 0 }; Base_Log.Log("主团周度排名开始"); foreach (var qypm in ztzdpm(str, index1, index2, index3, index4, item.qycs[0])) { t.AddClone(qypm); } Base_Log.Log("主团周度排名结束"); #region 格局统计 Base_Log.Log("格局统计开始"); var page2 = temp[3]; DataTable dt = new DataTable(); dt.Columns.Add(Base_Config_Jzgj.竞争格局名称); dt.Columns.Add(Base_Config_Jzgj.项目名称); dt.Columns.Add(Base_Config_Jzgj.业态); dt.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt.Columns.Add(Base_Config_Rgsj.本周_新开套内均价); dt.Columns.Add(Base_Config_Cjba.周_备案套数); dt.Columns.Add(Base_Config_Cjba.周_套内均价); dt.Columns.Add(Base_Config_Rgsj.周_认购套数); dt.Columns.Add(Base_Config_Rgsj.周_认购套内均价); dt.Columns.Add(Base_Config_Cjba.本周_备案套数); dt.Columns.Add(Base_Config_Cjba.本周_套内均价); dt.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt.Columns.Add(Base_Config_Rgsj.本周_认购套内均价); dt.Columns.Add(Base_Config_Rgsj.本周_成交套数环比); dt.Columns.Add(Base_Config_Rgsj.本周_套内均价环比); dt.Columns.Add(Base_Config_Rgsj.本周_变化原因); IAutoShape text2 = (IAutoShape)page2.Shapes[1]; text2.TextFrame.Text = string.Format(text2.TextFrame.Text, item.bamc, item.ytcs[0]); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt = GET_JPXM_BX(dt, item.jpxmlb); Office_Tables.SetJP_RUIAN_JPBX_Table(page2, dt, 2, null, null); t.AddClone(page2); } Base_Log.Log("格局统计结束"); Base_Log.Log("近期动作开始"); #endregion #region 近期动作 var page3 = temp[4]; IAutoShape text3 = (IAutoShape)page3.Shapes[0]; text3.TextFrame.Text = string.Format(text3.TextFrame.Text, item.bamc, item.ytcs[0]); DataTable dt1 = new DataTable(); dt1.Columns.Add(Base_Config_Jzgj.项目名称); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); dt1.Columns.Add(Base_Config_Rgsj.本周_营销动作); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt1 = GET_JPXM_BX(dt1, item.jpxmlb); Office_Tables.SetTable(page3, dt1, 1, null, null); } t.AddClone(page3); Base_Log.Log("近期动作开始"); #endregion } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }
//竞品分布 //组团周度排名 //组团业态周度排名 //组团近八周排名 //组团业态近近八周排名 public ISlideCollection _plus_jp_baoyi_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { var tp = new Presentation(str); var temp = tp.Slides; var page2 = temp[1]; #region 本周主团项目排名 DataTable dt2 = new DataTable(); dt2.Columns.Add("排名"); dt2.Columns.Add("项目名称"); dt2.Columns.Add("成交套数"); dt2.Columns.Add("成交金额"); dt2.Columns.Add("建面体量"); dt2.Columns.Add("套内体量"); dt2.Columns.Add("建面均价"); dt2.Columns.Add("套内均价"); var data1 = (from a in Cache_data_cjjl.bz.AsEnumerable() where item.ztcs.Contains(a["zt"]) group a by new { lpmc = a["lpmc"] } into s select new { lpmc = s.Key.lpmc, ts = s.Sum(a => a["ts"].doubls()), cjje = s.Sum(a => a["cjje"].longs()), jmtl = s.Sum(a => a["jzmj"].doubls()), tntl = s.Sum(a => a["tnmj"].doubls()), }).OrderByDescending(m => m.cjje).Take(10).ToList(); for (int i = 0; i < data1.Count; i++) { DataRow dr2 = dt2.NewRow(); dr2["排名"] = i + 1; dr2["项目名称"] = data1[i].lpmc; dr2["成交套数"] = data1[i].ts; dr2["成交金额"] = data1[i].cjje.je_wy(); dr2["建面体量"] = data1[i].jmtl.mj_wf(); dr2["套内体量"] = data1[i].tntl.mj_wf(); dr2["建面均价"] = (data1[i].cjje / data1[i].jmtl).je_y(); dr2["套内均价"] = (data1[i].cjje / data1[i].tntl).je_y(); dt2.Rows.Add(dr2); } Office_Tables.SetTable(page2, dt2, 1, null, null); t.AddClone(page2); foreach (var yt in item.ytcs) { var tp1 = new Presentation(str); var temp1 = tp1.Slides; var page3 = temp1[1]; DataTable dt2_1 = new DataTable(); dt2_1.Columns.Add("排名"); dt2_1.Columns.Add("项目名称"); dt2_1.Columns.Add("成交套数"); dt2_1.Columns.Add("成交金额"); dt2_1.Columns.Add("建面体量"); dt2_1.Columns.Add("套内体量"); dt2_1.Columns.Add("建面均价"); dt2_1.Columns.Add("套内均价"); var data2_1 = (from a in Cache_data_cjjl.bz.AsEnumerable() where item.ztcs.Contains(a["zt"]) && a["yt"].ToString() == yt group a by new { lpmc = a["lpmc"] } into s select new { lpmc = s.Key.lpmc, ts = s.Sum(a => a["ts"].doubls()), cjje = s.Sum(a => a["cjje"].longs()), jmtl = s.Sum(a => a["jzmj"].doubls()), tntl = s.Sum(a => a["tnmj"].doubls()), }).OrderByDescending(m => m.cjje).ToList(); for (int i = 0; i < data2_1.Count; i++) { DataRow dr2_1 = dt2_1.NewRow(); dr2_1["排名"] = i + 1; dr2_1["项目名称"] = data2_1[i].lpmc; dr2_1["成交套数"] = data2_1[i].ts; dr2_1["成交金额"] = data2_1[i].cjje.je_wy(); dr2_1["建面体量"] = data2_1[i].jmtl.mj_wf(); dr2_1["套内体量"] = data2_1[i].tntl.mj_wf(); dr2_1["建面均价"] = (data2_1[i].cjje / data2_1[i].jmtl).je_y(); dr2_1["套内均价"] = (data2_1[i].cjje / data2_1[i].tntl).je_y(); dt2_1.Rows.Add(dr2_1); } Office_Tables.SetTable(page3, dt2_1, 1, null, null); t.AddClone(page3); } #endregion #region 组团近八周排名 int[] index1 = { 2, 3, 0, 1, 2 }; foreach (var ztpmitem in this.JBZ_ZT_PM(str, index1, item.ztcs)) { t.AddClone(ztpmitem); } int[] index2 = { 3, 3, 0, 1, 2 }; foreach (var ztytpmitem in this.JBZ_ZT_YT_PM(str, index2, item.ztcs, item.ytcs)) { t.AddClone(ztytpmitem); } #endregion #region 竞品表现 #region 认购 var page5 = temp[4]; DataTable dt5_0 = new DataTable(); dt5_0.Columns.Add(Base_Config_Jzgj.项目名称); dt5_0.Columns.Add(Base_Config_Jzgj.业态); dt5_0.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt5_0.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt5_0.Columns.Add(Base_Config_Rgsj.本周_新开建面均价); dt5_0.Columns.Add(Base_Config_Rgsj.本周_本周来电); dt5_0.Columns.Add(Base_Config_Rgsj.本周_本周到访量); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt5_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt5_0.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt5_0.Columns.Add(Base_Config_Rgsj.本周_认购建面均价); dt5_0.Columns.Add("合计认购套数"); dt5_0.Columns.Add(Base_Config_Rgsj.本周_变化原因); IAutoShape text5_0 = (IAutoShape)page5.Shapes[0]; text5_0.TextFrame.Text = string.Format(text5_0.TextFrame.Text, item.bamc); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt5_0 = GET_JPXM_BX_RG(dt5_0, item.jpxmlb); Office_Tables.SetJP_baoyi_1_Table(page5, dt5_0, 1, null, null); t.AddClone(page5); } #endregion #region 备案 var page6 = temp[5]; DataTable dt6_0 = new DataTable(); dt6_0.Columns.Add(Base_Config_Jzgj.项目名称); dt6_0.Columns.Add(Base_Config_Jzgj.业态); dt6_0.Columns.Add(Base_Config_Jzgj.竞争格局_主力面积区间); dt6_0.Columns.Add("主力房型"); dt6_0.Columns.Add(Base_Config_Cjba.周_备案套数); dt6_0.Columns.Add(Base_Config_Cjba.周_建面均价); dt6_0.Columns.Add(Base_Config_Cjba.周_备案套数); dt6_0.Columns.Add(Base_Config_Cjba.周_建面均价); dt6_0.Columns.Add(Base_Config_Cjba.周_备案套数); dt6_0.Columns.Add(Base_Config_Cjba.周_建面均价); dt6_0.Columns.Add(Base_Config_Cjba.本周_备案套数); dt6_0.Columns.Add(Base_Config_Cjba.本周_建面均价); dt6_0.Columns.Add("合计认购套数"); dt6_0.Columns.Add("合计建面均价"); IAutoShape text6 = (IAutoShape)page6.Shapes[0]; text6.TextFrame.Text = string.Format(text6.TextFrame.Text, item.bamc); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt6_0 = GET_JPXM_BX_BA(dt6_0, item.jpxmlb); Office_Tables.SetJP_baoyi_2_Table(page6, dt6_0, 1, null, null); t.AddClone(page6); } #endregion #endregion } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }