create_supply_monitoring_ppt.ps1 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. $ErrorActionPreference = "Stop"
  2. $repo = "C:\Users\akiby\Desktop\houduan\dtm"
  3. $desktop = "C:\Users\akiby\Desktop"
  4. $pptPath = Join-Path $desktop "供应监测一期功能讲解.pptx"
  5. $archPath = Join-Path $repo "docs\supply-monitoring-architecture-current.svg"
  6. function Add-Title($slide, [string]$title, [string]$subtitle = "") {
  7. $shape = $slide.Shapes.AddTextbox(1, 45, 28, 1180, 42)
  8. $shape.TextFrame.TextRange.Text = $title
  9. $shape.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  10. $shape.TextFrame.TextRange.Font.Size = 26
  11. $shape.TextFrame.TextRange.Font.Bold = $true
  12. $shape.TextFrame.TextRange.Font.Color.RGB = 0x1F2937
  13. if ($subtitle -ne "") {
  14. $sub = $slide.Shapes.AddTextbox(1, 47, 70, 1180, 26)
  15. $sub.TextFrame.TextRange.Text = $subtitle
  16. $sub.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  17. $sub.TextFrame.TextRange.Font.Size = 12
  18. $sub.TextFrame.TextRange.Font.Color.RGB = 0x667085
  19. }
  20. }
  21. function Add-BulletBox($slide, [double]$x, [double]$y, [double]$w, [double]$h, [string]$heading, [string[]]$items, [int]$accentRgb = 0x6366F1) {
  22. $box = $slide.Shapes.AddShape(5, $x, $y, $w, $h)
  23. $box.Fill.ForeColor.RGB = 0xF8FAFC
  24. $box.Line.ForeColor.RGB = 0xE5E7EB
  25. $box.Line.Weight = 1
  26. $bar = $slide.Shapes.AddShape(1, $x, $y, 6, $h)
  27. $bar.Fill.ForeColor.RGB = $accentRgb
  28. $bar.Line.Visible = $false
  29. $head = $slide.Shapes.AddTextbox(1, $x + 18, $y + 14, $w - 32, 24)
  30. $head.TextFrame.TextRange.Text = $heading
  31. $head.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  32. $head.TextFrame.TextRange.Font.Size = 16
  33. $head.TextFrame.TextRange.Font.Bold = $true
  34. $head.TextFrame.TextRange.Font.Color.RGB = 0x111827
  35. $body = $slide.Shapes.AddTextbox(1, $x + 20, $y + 48, $w - 36, $h - 58)
  36. $body.TextFrame.TextRange.Text = ($items | ForEach-Object { "• " + $_ }) -join "`r"
  37. $body.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  38. $body.TextFrame.TextRange.Font.Size = 12
  39. $body.TextFrame.TextRange.Font.Color.RGB = 0x374151
  40. }
  41. function Add-Card($slide, [double]$x, [double]$y, [double]$w, [double]$h, [string]$title, [string]$value, [string]$note, [int]$rgb = 0x6366F1) {
  42. $card = $slide.Shapes.AddShape(5, $x, $y, $w, $h)
  43. $card.Fill.ForeColor.RGB = 0xFFFFFF
  44. $card.Line.ForeColor.RGB = 0xE5E7EB
  45. $t = $slide.Shapes.AddTextbox(1, $x + 18, $y + 12, $w - 36, 20)
  46. $t.TextFrame.TextRange.Text = $title
  47. $t.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  48. $t.TextFrame.TextRange.Font.Size = 12
  49. $t.TextFrame.TextRange.Font.Color.RGB = 0x667085
  50. $v = $slide.Shapes.AddTextbox(1, $x + 18, $y + 34, $w - 36, 34)
  51. $v.TextFrame.TextRange.Text = $value
  52. $v.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  53. $v.TextFrame.TextRange.Font.Size = 24
  54. $v.TextFrame.TextRange.Font.Bold = $true
  55. $v.TextFrame.TextRange.Font.Color.RGB = $rgb
  56. $n = $slide.Shapes.AddTextbox(1, $x + 18, $y + 72, $w - 36, 20)
  57. $n.TextFrame.TextRange.Text = $note
  58. $n.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  59. $n.TextFrame.TextRange.Font.Size = 10
  60. $n.TextFrame.TextRange.Font.Color.RGB = 0x667085
  61. }
  62. $ppt = New-Object -ComObject PowerPoint.Application
  63. $ppt.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue
  64. $presentation = $ppt.Presentations.Add()
  65. $presentation.PageSetup.SlideWidth = 1280
  66. $presentation.PageSetup.SlideHeight = 720
  67. # Slide 1
  68. $slide = $presentation.Slides.Add(1, 12)
  69. $bg = $slide.Shapes.AddShape(1, 0, 0, 1280, 720)
  70. $bg.Fill.ForeColor.RGB = 0xF5F7FB
  71. $bg.Line.Visible = $false
  72. Add-Title $slide "供应监测一期功能讲解" "面向甲方说明:本阶段新增供应商查询、对比、付款计划与评分分析能力"
  73. Add-BulletBox $slide 70 150 350 220 "本次新增的一期能力" @(
  74. "供应商列表查询:按名称、日期范围筛选",
  75. "供应商横向对比:订单、入库、完成率、交付及时率",
  76. "付款计划:按验收日期和账期生成预计付款",
  77. "评分基础:成本、交付、账期三维度支撑"
  78. ) 0x6366F1
  79. Add-BulletBox $slide 465 150 350 220 "甲方可获得的价值" @(
  80. "快速识别重点供应商履约情况",
  81. "降低人工汇总供应商账期和付款数据的成本",
  82. "用统一口径支撑采购、财务和管理层沟通",
  83. "为后续现金流预测和风险预警打基础"
  84. ) 0x10B981
  85. Add-BulletBox $slide 860 150 350 220 "数据基础" @(
  86. "采购订单数据",
  87. "采购入库数据",
  88. "供应商账期数据",
  89. "订单入库匹配数据"
  90. ) 0xF59E0B
  91. Add-Card $slide 130 430 220 100 "阶段重点" "第一阶段" "查询、对比、付款计划"
  92. Add-Card $slide 390 430 220 100 "核心对象" "供应商" "按供应商沉淀采购履约表现" 0x10B981
  93. Add-Card $slide 650 430 220 100 "关键输出" "报表化" "列表、对比、付款计划" 0xF59E0B
  94. Add-Card $slide 910 430 220 100 "后续承接" "三阶段" "现金流与风险预警" 0x9333EA
  95. # Slide 2
  96. $slide = $presentation.Slides.Add(2, 12)
  97. Add-Title $slide "供应监测模块架构" "蓝色标注为一期已建设能力,紫色标注为后续扩展方向"
  98. if (Test-Path $archPath) {
  99. try {
  100. $pic = $slide.Shapes.AddPicture($archPath, $false, $true, 45, 105, 1190, 585)
  101. } catch {
  102. $box = $slide.Shapes.AddShape(1, 80, 150, 1120, 470)
  103. $box.Fill.ForeColor.RGB = 0xF8FAFC
  104. $box.Line.ForeColor.RGB = 0xCBD5E1
  105. $txt = $slide.Shapes.AddTextbox(1, 120, 320, 1040, 80)
  106. $txt.TextFrame.TextRange.Text = "架构图文件:$archPath"
  107. $txt.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  108. $txt.TextFrame.TextRange.Font.Size = 18
  109. }
  110. }
  111. # Slide 3
  112. $slide = $presentation.Slides.Add(3, 12)
  113. Add-Title $slide "一期功能:供应商查询与筛选" "从人工翻表转为系统化查询,降低供应商信息检索成本"
  114. Add-BulletBox $slide 70 140 360 260 "查询条件" @(
  115. "供应商名称:支持模糊查询",
  116. "日期范围:支持按业务期间筛选",
  117. "列表切换:供应商列表、供应商对比、付款计划"
  118. ) 0x6366F1
  119. Add-BulletBox $slide 470 140 360 260 "列表指标" @(
  120. "供应商代码、账期、订单量",
  121. "订单数量、入库数量、入库金额",
  122. "交付及时率、完成率"
  123. ) 0x10B981
  124. Add-BulletBox $slide 870 140 340 260 "业务说明" @(
  125. "采购侧查看供应商履约表现",
  126. "财务侧查看账期和预计付款基础",
  127. "管理层查看供应商表现是否稳定"
  128. ) 0xF59E0B
  129. Add-Card $slide 170 465 250 95 "使用场景" "供应商巡检" "按日期筛查异常供应商"
  130. Add-Card $slide 515 465 250 95 "使用对象" "采购/财务" "统一查看供应与付款基础"
  131. Add-Card $slide 860 465 250 95 "输出形式" "列表报表" "可作为管理汇报基础"
  132. # Slide 4
  133. $slide = $presentation.Slides.Add(4, 12)
  134. Add-Title $slide "一期功能:供应商对比与付款计划" "把供应履约和账期付款放到同一业务链路中"
  135. Add-BulletBox $slide 70 130 520 260 "供应商对比" @(
  136. "支持选择多个供应商进行横向对比",
  137. "对比采购订单、入库金额、完成率、准时率",
  138. "用于识别供应商交付稳定性和履约差异"
  139. ) 0x6366F1
  140. Add-BulletBox $slide 690 130 520 260 "付款计划" @(
  141. "预计付款日 = 实际验收日期 + 供应商账期",
  142. "按供应商和预计付款日汇总金额、数量、单据行",
  143. "辅助财务提前查看未来付款压力"
  144. ) 0x10B981
  145. Add-BulletBox $slide 190 450 900 120 "一期边界" @(
  146. "当前付款计划按实际验收日期和账期推算;后续如接入发票日期、真实付款日期,可替换为更精确的真实付款计划。",
  147. "当前重点是补齐供应商查询、对比和计划付款的基础数据闭环。"
  148. ) 0xF59E0B
  149. # Slide 5
  150. $slide = $presentation.Slides.Add(5, 12)
  151. Add-Title $slide "系统页面示例" "此页用于放置甲方演示截图:供应商查询、对比与付款计划页面"
  152. $frame = $slide.Shapes.AddShape(1, 60, 115, 1160, 520)
  153. $frame.Fill.ForeColor.RGB = 0xF8FAFC
  154. $frame.Line.ForeColor.RGB = 0xCBD5E1
  155. $frame.Line.Weight = 1.2
  156. $hint = $slide.Shapes.AddTextbox(1, 220, 320, 840, 80)
  157. $hint.TextFrame.TextRange.Text = "页面截图占位:请把刚才浏览器截图另存为图片后发路径,我可以替换为原图。"
  158. $hint.TextFrame.TextRange.Font.Name = "Microsoft YaHei"
  159. $hint.TextFrame.TextRange.Font.Size = 20
  160. $hint.TextFrame.TextRange.Font.Color.RGB = 0x667085
  161. $hint.TextFrame.TextRange.ParagraphFormat.Alignment = 2
  162. # Slide 6
  163. $slide = $presentation.Slides.Add(6, 12)
  164. Add-Title $slide "给甲方的讲解口径" "建议按业务痛点、一期功能、数据口径、后续扩展四步讲"
  165. Add-BulletBox $slide 80 130 520 360 "讲解重点" @(
  166. "以前:供应商订单、入库、账期和付款信息分散,人工汇总成本高。",
  167. "现在:一期先打通供应商查询、横向对比和付款计划,形成统一查询入口。",
  168. "价值:采购能看履约,财务能看付款计划,管理层能看供应商表现。",
  169. "后续:在一期数据闭环上扩展现金流预测和风险预警。"
  170. ) 0x6366F1
  171. Add-BulletBox $slide 680 130 520 360 "当前可演示内容" @(
  172. "供应商列表:查看供应商订单量、入库金额、完成率。",
  173. "供应商对比:选择多个供应商看履约差异。",
  174. "付款计划:按账期推算预计付款日和金额。",
  175. "综合评分:结合成本、交付和账期输出供应商能力排名。"
  176. ) 0x10B981
  177. $presentation.SaveAs($pptPath)
  178. $presentation.Close()
  179. $ppt.Quit()
  180. [System.Runtime.InteropServices.Marshal]::ReleaseComObject($presentation) | Out-Null
  181. [System.Runtime.InteropServices.Marshal]::ReleaseComObject($ppt) | Out-Null
  182. Write-Output $pptPath