| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- $ErrorActionPreference = "Stop"
- $repo = "C:\Users\akiby\Desktop\houduan\dtm"
- $desktop = "C:\Users\akiby\Desktop"
- $pptPath = Join-Path $desktop "供应监测一期功能讲解.pptx"
- $archPath = Join-Path $repo "docs\supply-monitoring-architecture-current.svg"
- function Add-Title($slide, [string]$title, [string]$subtitle = "") {
- $shape = $slide.Shapes.AddTextbox(1, 45, 28, 1180, 42)
- $shape.TextFrame.TextRange.Text = $title
- $shape.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $shape.TextFrame.TextRange.Font.Size = 26
- $shape.TextFrame.TextRange.Font.Bold = $true
- $shape.TextFrame.TextRange.Font.Color.RGB = 0x1F2937
- if ($subtitle -ne "") {
- $sub = $slide.Shapes.AddTextbox(1, 47, 70, 1180, 26)
- $sub.TextFrame.TextRange.Text = $subtitle
- $sub.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $sub.TextFrame.TextRange.Font.Size = 12
- $sub.TextFrame.TextRange.Font.Color.RGB = 0x667085
- }
- }
- function Add-BulletBox($slide, [double]$x, [double]$y, [double]$w, [double]$h, [string]$heading, [string[]]$items, [int]$accentRgb = 0x6366F1) {
- $box = $slide.Shapes.AddShape(5, $x, $y, $w, $h)
- $box.Fill.ForeColor.RGB = 0xF8FAFC
- $box.Line.ForeColor.RGB = 0xE5E7EB
- $box.Line.Weight = 1
- $bar = $slide.Shapes.AddShape(1, $x, $y, 6, $h)
- $bar.Fill.ForeColor.RGB = $accentRgb
- $bar.Line.Visible = $false
- $head = $slide.Shapes.AddTextbox(1, $x + 18, $y + 14, $w - 32, 24)
- $head.TextFrame.TextRange.Text = $heading
- $head.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $head.TextFrame.TextRange.Font.Size = 16
- $head.TextFrame.TextRange.Font.Bold = $true
- $head.TextFrame.TextRange.Font.Color.RGB = 0x111827
- $body = $slide.Shapes.AddTextbox(1, $x + 20, $y + 48, $w - 36, $h - 58)
- $body.TextFrame.TextRange.Text = ($items | ForEach-Object { "• " + $_ }) -join "`r"
- $body.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $body.TextFrame.TextRange.Font.Size = 12
- $body.TextFrame.TextRange.Font.Color.RGB = 0x374151
- }
- function Add-Card($slide, [double]$x, [double]$y, [double]$w, [double]$h, [string]$title, [string]$value, [string]$note, [int]$rgb = 0x6366F1) {
- $card = $slide.Shapes.AddShape(5, $x, $y, $w, $h)
- $card.Fill.ForeColor.RGB = 0xFFFFFF
- $card.Line.ForeColor.RGB = 0xE5E7EB
- $t = $slide.Shapes.AddTextbox(1, $x + 18, $y + 12, $w - 36, 20)
- $t.TextFrame.TextRange.Text = $title
- $t.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $t.TextFrame.TextRange.Font.Size = 12
- $t.TextFrame.TextRange.Font.Color.RGB = 0x667085
- $v = $slide.Shapes.AddTextbox(1, $x + 18, $y + 34, $w - 36, 34)
- $v.TextFrame.TextRange.Text = $value
- $v.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $v.TextFrame.TextRange.Font.Size = 24
- $v.TextFrame.TextRange.Font.Bold = $true
- $v.TextFrame.TextRange.Font.Color.RGB = $rgb
- $n = $slide.Shapes.AddTextbox(1, $x + 18, $y + 72, $w - 36, 20)
- $n.TextFrame.TextRange.Text = $note
- $n.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $n.TextFrame.TextRange.Font.Size = 10
- $n.TextFrame.TextRange.Font.Color.RGB = 0x667085
- }
- $ppt = New-Object -ComObject PowerPoint.Application
- $ppt.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue
- $presentation = $ppt.Presentations.Add()
- $presentation.PageSetup.SlideWidth = 1280
- $presentation.PageSetup.SlideHeight = 720
- # Slide 1
- $slide = $presentation.Slides.Add(1, 12)
- $bg = $slide.Shapes.AddShape(1, 0, 0, 1280, 720)
- $bg.Fill.ForeColor.RGB = 0xF5F7FB
- $bg.Line.Visible = $false
- Add-Title $slide "供应监测一期功能讲解" "面向甲方说明:本阶段新增供应商查询、对比、付款计划与评分分析能力"
- Add-BulletBox $slide 70 150 350 220 "本次新增的一期能力" @(
- "供应商列表查询:按名称、日期范围筛选",
- "供应商横向对比:订单、入库、完成率、交付及时率",
- "付款计划:按验收日期和账期生成预计付款",
- "评分基础:成本、交付、账期三维度支撑"
- ) 0x6366F1
- Add-BulletBox $slide 465 150 350 220 "甲方可获得的价值" @(
- "快速识别重点供应商履约情况",
- "降低人工汇总供应商账期和付款数据的成本",
- "用统一口径支撑采购、财务和管理层沟通",
- "为后续现金流预测和风险预警打基础"
- ) 0x10B981
- Add-BulletBox $slide 860 150 350 220 "数据基础" @(
- "采购订单数据",
- "采购入库数据",
- "供应商账期数据",
- "订单入库匹配数据"
- ) 0xF59E0B
- Add-Card $slide 130 430 220 100 "阶段重点" "第一阶段" "查询、对比、付款计划"
- Add-Card $slide 390 430 220 100 "核心对象" "供应商" "按供应商沉淀采购履约表现" 0x10B981
- Add-Card $slide 650 430 220 100 "关键输出" "报表化" "列表、对比、付款计划" 0xF59E0B
- Add-Card $slide 910 430 220 100 "后续承接" "三阶段" "现金流与风险预警" 0x9333EA
- # Slide 2
- $slide = $presentation.Slides.Add(2, 12)
- Add-Title $slide "供应监测模块架构" "蓝色标注为一期已建设能力,紫色标注为后续扩展方向"
- if (Test-Path $archPath) {
- try {
- $pic = $slide.Shapes.AddPicture($archPath, $false, $true, 45, 105, 1190, 585)
- } catch {
- $box = $slide.Shapes.AddShape(1, 80, 150, 1120, 470)
- $box.Fill.ForeColor.RGB = 0xF8FAFC
- $box.Line.ForeColor.RGB = 0xCBD5E1
- $txt = $slide.Shapes.AddTextbox(1, 120, 320, 1040, 80)
- $txt.TextFrame.TextRange.Text = "架构图文件:$archPath"
- $txt.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $txt.TextFrame.TextRange.Font.Size = 18
- }
- }
- # Slide 3
- $slide = $presentation.Slides.Add(3, 12)
- Add-Title $slide "一期功能:供应商查询与筛选" "从人工翻表转为系统化查询,降低供应商信息检索成本"
- Add-BulletBox $slide 70 140 360 260 "查询条件" @(
- "供应商名称:支持模糊查询",
- "日期范围:支持按业务期间筛选",
- "列表切换:供应商列表、供应商对比、付款计划"
- ) 0x6366F1
- Add-BulletBox $slide 470 140 360 260 "列表指标" @(
- "供应商代码、账期、订单量",
- "订单数量、入库数量、入库金额",
- "交付及时率、完成率"
- ) 0x10B981
- Add-BulletBox $slide 870 140 340 260 "业务说明" @(
- "采购侧查看供应商履约表现",
- "财务侧查看账期和预计付款基础",
- "管理层查看供应商表现是否稳定"
- ) 0xF59E0B
- Add-Card $slide 170 465 250 95 "使用场景" "供应商巡检" "按日期筛查异常供应商"
- Add-Card $slide 515 465 250 95 "使用对象" "采购/财务" "统一查看供应与付款基础"
- Add-Card $slide 860 465 250 95 "输出形式" "列表报表" "可作为管理汇报基础"
- # Slide 4
- $slide = $presentation.Slides.Add(4, 12)
- Add-Title $slide "一期功能:供应商对比与付款计划" "把供应履约和账期付款放到同一业务链路中"
- Add-BulletBox $slide 70 130 520 260 "供应商对比" @(
- "支持选择多个供应商进行横向对比",
- "对比采购订单、入库金额、完成率、准时率",
- "用于识别供应商交付稳定性和履约差异"
- ) 0x6366F1
- Add-BulletBox $slide 690 130 520 260 "付款计划" @(
- "预计付款日 = 实际验收日期 + 供应商账期",
- "按供应商和预计付款日汇总金额、数量、单据行",
- "辅助财务提前查看未来付款压力"
- ) 0x10B981
- Add-BulletBox $slide 190 450 900 120 "一期边界" @(
- "当前付款计划按实际验收日期和账期推算;后续如接入发票日期、真实付款日期,可替换为更精确的真实付款计划。",
- "当前重点是补齐供应商查询、对比和计划付款的基础数据闭环。"
- ) 0xF59E0B
- # Slide 5
- $slide = $presentation.Slides.Add(5, 12)
- Add-Title $slide "系统页面示例" "此页用于放置甲方演示截图:供应商查询、对比与付款计划页面"
- $frame = $slide.Shapes.AddShape(1, 60, 115, 1160, 520)
- $frame.Fill.ForeColor.RGB = 0xF8FAFC
- $frame.Line.ForeColor.RGB = 0xCBD5E1
- $frame.Line.Weight = 1.2
- $hint = $slide.Shapes.AddTextbox(1, 220, 320, 840, 80)
- $hint.TextFrame.TextRange.Text = "页面截图占位:请把刚才浏览器截图另存为图片后发路径,我可以替换为原图。"
- $hint.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
- $hint.TextFrame.TextRange.Font.Size = 20
- $hint.TextFrame.TextRange.Font.Color.RGB = 0x667085
- $hint.TextFrame.TextRange.ParagraphFormat.Alignment = 2
- # Slide 6
- $slide = $presentation.Slides.Add(6, 12)
- Add-Title $slide "给甲方的讲解口径" "建议按业务痛点、一期功能、数据口径、后续扩展四步讲"
- Add-BulletBox $slide 80 130 520 360 "讲解重点" @(
- "以前:供应商订单、入库、账期和付款信息分散,人工汇总成本高。",
- "现在:一期先打通供应商查询、横向对比和付款计划,形成统一查询入口。",
- "价值:采购能看履约,财务能看付款计划,管理层能看供应商表现。",
- "后续:在一期数据闭环上扩展现金流预测和风险预警。"
- ) 0x6366F1
- Add-BulletBox $slide 680 130 520 360 "当前可演示内容" @(
- "供应商列表:查看供应商订单量、入库金额、完成率。",
- "供应商对比:选择多个供应商看履约差异。",
- "付款计划:按账期推算预计付款日和金额。",
- "综合评分:结合成本、交付和账期输出供应商能力排名。"
- ) 0x10B981
- $presentation.SaveAs($pptPath)
- $presentation.Close()
- $ppt.Quit()
- [System.Runtime.InteropServices.Marshal]::ReleaseComObject($presentation) | Out-Null
- [System.Runtime.InteropServices.Marshal]::ReleaseComObject($ppt) | Out-Null
- Write-Output $pptPath
|