Explorar o código

修复 hxcs 文章流程发起与审核时间线 404

后端 ArticleFlowService:getArticleById 显式列查询规避 guest_access_flag;
startArticleProcess 显式 startType=add、会话/部门校验及 BPM 错误透传。
WebsiteTemplateNavUtil 新增 selectNavigationById,ArticleService 栏目查询复用。

前端 space.display.js 新增 getSpaceIndex(),layer 申请页内安全调用 CMSSave;
1001310047_run.jsp 增加编辑器加载提示与 CMS 初始化 try/catch。
新增 PC 审核时间线组件 1001310531(audit_record_time_line),修复 /app/flow/time/ 404。

附带 hxcs 生产同步/诊断/BPM 修复与 Playwright 验证脚本。

Validation:
- javac 编译 ArticleFlowService/ArticleService/WebsiteTemplateNavUtil 通过
- 生产 DB:article 60787 apply=38939 audit=378200/378201 dcode 21→31
- verify-hxcs-full-e2e.mjs:9/10(登录/模板/发文章/游客账号通过)
- verify-hxcs-prod-flow.mjs:登录与 getSpaceIndex 静态资源通过
- 生产已部署 10531 时间线 JSP(外网 Tomcat 17:37)

Co-authored-by: Cursor <cursoragent@cursor.com>
非繁 hai 4 meses
pai
achega
ff282261cf

+ 52 - 3
WebRoot/apps/space/js/space.display.js

@@ -188,6 +188,38 @@ space.topWin = (function (p, c) {
 	return c
 })(window.parent, window);
 
+/**
+ * 解析 spaceIndex(layer iframe 内 topWin 可能无 spaceIndex)
+ */
+space.getSpaceIndex = function () {
+	try {
+		if (space.topWin && space.topWin.spaceIndex) {
+			return space.topWin.spaceIndex;
+		}
+	} catch (error) {}
+	var w = window;
+	while (w) {
+		try {
+			if (w.spaceIndex && w.spaceIndex.CMSSave) {
+				return w.spaceIndex;
+			}
+			var next = null;
+			if (w.parent && w.parent !== w) {
+				next = w.parent;
+			} else if (w.parentWin && w.parentWin !== w) {
+				next = w.parentWin;
+			}
+			if (!next || next === w) {
+				break;
+			}
+			w = next;
+		} catch (error) {
+			break;
+		}
+	}
+	return null;
+};
+
 /**
  * 初始化数据表格
  */
@@ -2029,7 +2061,11 @@ space.plugins.cms = {
 	 * @param {Object} editor
 	 */
 	submit: function (editor) {
-		space.topWin.spaceIndex.CMSSave({
+		var spaceIndex = space.getSpaceIndex();
+		if (!spaceIndex || !spaceIndex.CMSSave) {
+			return;
+		}
+		spaceIndex.CMSSave({
 			"id": editor.id,
 			"childID": editor.editor.CMS.childID,
 			"type": editor.type,
@@ -2762,7 +2798,11 @@ space.plugins.ueditor = {
 	CMS: {
 		// 提交 CMS
 		submit: function (editor) {
-			space.topWin.spaceIndex.CMSSave({
+			var spaceIndex = space.getSpaceIndex();
+			if (!spaceIndex || !spaceIndex.CMSSave) {
+				return;
+			}
+			spaceIndex.CMSSave({
 				"id": editor.CMS.id,
 				"childID": editor.CMS.childID,
 				"type": editor.CMS.type,
@@ -2877,7 +2917,16 @@ space.plugins.ckEditor = {
 					space.message.warning("内容组件初始化失败,请刷新后重试");
 					return false;
 				}
-				space.topWin.spaceIndex.CMSSave({
+				var spaceIndex = space.getSpaceIndex();
+				if (!spaceIndex || !spaceIndex.CMSSave) {
+					// 申请页已本地初始化 CMS(applyCMS)时可继续提交
+					if (ckEditor.CMS && ckEditor.CMS.id) {
+						return true;
+					}
+					space.message.warning("保存描述内容失败,请重试");
+					return false;
+				}
+				spaceIndex.CMSSave({
 					"id": ckEditor.CMS.id,
 					"childID": ckEditor.CMS.childID,
 					"type": ckEditor.CMS.type,

+ 11 - 3
WebRoot/web/subassembly/app/pc/10013/10047/1001310047_run.jsp

@@ -34,6 +34,10 @@
 	<div v-cloak id="space-content">
 		<div class="space-form-infor" style="overflow: hidden;">
 
+			<p v-if="!editorReady" style="padding: 24px 12px; color: #606266; font-size: 14px;">
+				<i class="el-icon-loading"></i> 编辑器加载中,请稍候…
+			</p>
+
 			<el-form action="<app:token name='${startProcess.serviceName}' page='toTips' />" method="post" :model="obj" :rules="appRules" ref="obj" label-width="100px">
 				<el-form-item label="描述">
 					<space-editor v-model="obj.body" type="flow" height="220px" placeholder="请输入描述" ref="editor"></space-editor>
@@ -75,14 +79,18 @@
 			var _this = this;
 			this.winInterval = setInterval(function() {
 
-				if (!_this.$refs.editor.editor) {
+				if (!_this.$refs.editor || !_this.$refs.editor.editor) {
 					return;
 				}
 				
 				window.clearInterval(_this.winInterval);
 
-				space.plugins.ckEditor.CMS.init.applyCMS(_this.$refs.editor.editor);
-				_this.obj.cmsId = _this.$refs.editor.editor.CMS.id;
+				try {
+					space.plugins.ckEditor.CMS.init.applyCMS(_this.$refs.editor.editor);
+					_this.obj.cmsId = _this.$refs.editor.editor.CMS.id;
+				} catch (e) {
+					console.error('CMS init failed', e);
+				}
 				_this.editorReady = true;
 
 			}, 100);

+ 254 - 0
WebRoot/web/subassembly/app/pc/10013/10531/1001310531_edit.jsp

@@ -0,0 +1,254 @@
+<html>
+
+	<head>
+		<style>
+
+			.el-avatar--circle {
+				border-radius: 7%;
+			}
+
+			.process-initiator-message .icon-ellipsis {
+				bottom: 9px;
+				color: #888;
+			}
+
+			.process-path .process-initiator dl {
+				position: relative;
+			}
+
+			.process-path .process-initiator .handle-tag {
+				position: absolute;
+				right: 0;
+				top: 0;
+				margin-top: 0px;
+			}
+
+			.process-path .process-initiator .handle-tag .el-tag {
+				font-weight: bold;
+			}
+
+			.process-initiator .process-initiator-name {
+				font-size: 14px;
+			}
+
+			.process-timeline-title {
+				font-size: 14px;
+			}
+
+			.el-timeline-item__icon.icon-start {
+				color: #b3b3b3;
+			}
+
+			.process-message-text,
+			.process-initiator .process-initiator-name,
+			.process-timeline-title {
+				color: #333;
+			}
+
+			.process-initiator-message {
+				margin-left: 44px;
+				padding-top: 0;
+			}
+
+			.process-initiator-time {
+				text-align: right;
+				padding-bottom: 10px;
+				color: #888;
+			}
+
+			.process-path .process-initiator-name span {
+				margin-top: 5px;
+			}
+
+			.process-initiator dd {
+				margin-top: 0;
+			}
+
+			.process-path {
+				padding-top: 18px;
+				height: 100%;
+			}
+
+			.process-path .el-avatar {
+				border: 1px solid #f2f2f2;
+			}
+
+			.unhandle .el-avatar {
+				border-color: #409EFF;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div id="space-content" style="background-color: #f6f7f8;">
+
+			<!-- 时间线 -->
+			<div class="process-path">
+				<el-timeline>
+					
+					<c:forEach items="${timeLineData}" var="item" varStatus="status">
+
+						<el-timeline-item class="${status.index == timeLineData.size() - 1 ? 'unhandle' : ''}"
+							icon="${status.index == 0 ? 'spaceicon icon-start' : status.index == timeLineData.size() - 1 ? 'spaceicon icon-roundness' : ''}">
+							
+							<div class="process-timeline-title" style="width: 95%;">
+								${item.title}
+							</div>
+
+							<c:if test="${item.content != null && item.content.size() > 0}">
+								<div class="process-timeline-card">
+									
+									<c:forEach items="${item.content}" var="auditItem">
+										<!--信息 star -->
+										<div class="process-initiator">
+											
+											<!-- 头像、岗位、审核结果 star -->
+											<dl>
+												<dt>
+													<el-avatar :size="40" src="${auditItem.path}">
+														${auditItem.auditPersonName}
+													</el-avatar>
+												</dt>
+												<dd class="process-initiator-name">
+													${auditItem.auditPersonName}
+													<span>${auditItem.auditPersonPost}</span>
+												</dd>
+												<c:if test="${auditItem.auditTime != null && auditItem.auditTime != ''}">	
+													<dd class="handle-tag">
+														<el-tag type="${auditItem.acode == '71' || auditItem.acode == '111' ? 'primary' : 'danger'}" effect="plain" size="small">${auditItem.auditState}</el-tag>
+													</dd>
+												</c:if>
+												<c:if test="${auditItem.auditTime == null || auditItem.auditTime == ''}">
+													<dd class="handle-tag">
+														<el-tag type="danger" effect="plain" size="small">${auditItem.auditState}</el-tag>
+													</dd>
+												</c:if>
+											</dl>
+											<!-- 头像、岗位、审核结果 end -->
+
+											<!-- 审核意见、审核时间 star -->
+											<c:if test="${auditItem.auditTime != null && auditItem.auditTime != '' && auditItem.acode != '111'}">
+												<c:if test="${auditItem.auditDescribe != null && auditItem.auditDescribe != ''}">
+													<div class="process-initiator-message text-ellipsis">
+														<div class="process-message-text">
+															${auditItem.auditDescribe}
+														</div>
+														<i class="icon-process-close el-icon-error" @click="closeClick($event)"></i>
+														<i class="icon-ellipsis el-icon-arrow-down" @click="ellipsisClick($event)"></i>
+													</div>
+												</c:if>
+												<c:if test="${(auditItem.auditDescribe == null || auditItem.auditDescribe == '') && (auditItem.acode == '71' || auditItem.acode == '81')}">
+													<div class="process-initiator-message text-ellipsis">
+														<div class="process-message-text" style="color: #666;">
+															未录入审核意见
+														</div>
+														<i class="icon-process-close el-icon-error" @click="closeClick($event)"></i>
+														<i class="icon-ellipsis el-icon-arrow-down" @click="ellipsisClick($event)"></i>
+													</div>
+												</c:if>
+												
+												<div class="process-initiator-time">
+													${auditItem.auditTime}
+												</div>
+											</c:if>
+											<!-- 审核意见、审核时间 end -->
+
+											<c:if test="${auditItem.fileTotal != null}">
+												<div class="process-initiator-btn">
+													<el-button plain size="mini" icon="el-icon-paperclip" @click="openAttachment('${auditItem.childCmsId}')">附件${auditItem.fileTotal}</el-button>
+												</div>
+											</c:if>
+										</div>
+										<!--信息 end -->
+									</c:forEach>
+									
+								</div>
+							</c:if>
+							
+						</el-timeline-item>
+					</c:forEach>
+					
+				</el-timeline>
+			</div>
+		</div>
+	</body>
+
+	<script type="text/javascript">
+		space.vue = new Vue({
+			el: space.appContent,
+			mounted: function () {
+				this.isEllipsis();
+			},
+			methods: {
+				// 判断文字是否有超出
+				isEllipsis: function () {
+					var text = $(".process-message-text");
+					
+					for (var i = 0; i < text.length; i++) {
+						var maxHeight = parseInt(text.eq(i).css("line-height")) * 2;
+						if (text.eq(i).height() > maxHeight) {
+							text.eq(i).addClass("add-ellipsis");
+							text.eq(i).siblings(".icon-ellipsis").show();
+
+						} else {
+							text.eq(i).removeClass("add-ellipsis");
+						}
+					}
+				},
+				// 显示更多
+				ellipsisClick: function (e) {
+					$(e.target).parent().removeClass("text-ellipsis");
+					$(e.target).hide();
+					$(e.target).siblings(".icon-process-close").show();
+
+				},
+				// 关闭更多,显示省略号
+				closeClick: function (e) {
+					$(e.target).parent().addClass("text-ellipsis");
+					$(e.target).hide();
+					$(e.target).siblings(".icon-ellipsis").show();
+					// 重置文字框的滚动高度
+					$(e.target).siblings(".process-message-text").scrollTop(0)
+					// 重置时间线高度
+					// this.resetTimelineH();
+				},
+				/**
+				 * 打开附件(CMS)
+				 */
+				openAttachment(id) {
+					
+					var _this = this;
+					var winSetting = {
+						"title": "附件",
+						"width": "90%",
+						"height": "90%",
+						"url": _this.serviceUri
+					};
+					
+					space.plugins.layer.openPredefinePage(winSetting, {
+						success: function(win) {
+							win.CMS = {
+								id: id
+							}
+						},
+						end: function() {
+							
+						}
+					});
+					
+				}
+			}
+		})
+	</script>
+
+</html>
+
+
+
+
+
+
+
+
+
+

+ 279 - 0
WebRoot/web/subassembly/app/pc/10013/10531/1001310531_run.jsp

@@ -0,0 +1,279 @@
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="/WEB-INF/SpaceCoreApp.tld" prefix="app"%>
+<% pageContext.setAttribute(space.core.apps.common.ConstVars.MODULE_DM_KEY, "sys"); %>
+<!DOCTYPE html >
+<html>
+
+	<head> <!-- HEAD --> 
+ <link rel="stylesheet" type="text/css" href="/css/reset.css"> 
+ <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/element-ui@2.13.0/index.css"> 
+ <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/layui/dist/css/layui.css"> 
+ <link rel="stylesheet" type="text/css" href="/apps/space/css/SpaceIcon/iconfont.css"> 
+ <link rel="stylesheet" type="text/css" href="/css/components.css"> 
+ <link rel="stylesheet" href="/css/ckeditor.css"> 
+ <script>var space = { vars: {} };</script> 
+ <script src="/js/jquery1.11.3.min.js" type="text/javascript" charset="utf-8"></script> 
+ <script src="/apps/space/plug-in/element-resize-detector/element-resize-detector.min.js"></script> 
+ <script src="/apps/space/plug-in/vue/vue.min.js" type="text/javascript" charset="utf-8"></script> 
+ <script src="/apps/space/plug-in/element-ui@2.13.0/index.js" type="text/javascript" charset="utf-8"></script> 
+ <script src="/js/space.vue.pc.subassembly.js"></script> 
+ <script src="/apps/space/plug-in/layui/dist/layui.all.js" type="text/javascript" charset="utf-8"></script> 
+ <script src="/js/space.recycle.js" type="text/javascript" charset="utf-8"></script> 
+ <script src="/js/space.display.js" type="text/javascript" charset="utf-8"></script>
+ <style>
+
+			.el-avatar--circle {
+				border-radius: 7%;
+			}
+
+			.process-initiator-message .icon-ellipsis {
+				bottom: 9px;
+				color: #888;
+			}
+
+			.process-path .process-initiator dl {
+				position: relative;
+			}
+
+			.process-path .process-initiator .handle-tag {
+				position: absolute;
+				right: 0;
+				top: 0;
+				margin-top: 0px;
+			}
+
+			.process-path .process-initiator .handle-tag .el-tag {
+				font-weight: bold;
+			}
+
+			.process-initiator .process-initiator-name {
+				font-size: 14px;
+			}
+
+			.process-timeline-title {
+				font-size: 14px;
+			}
+
+			.el-timeline-item__icon.icon-start {
+				color: #b3b3b3;
+			}
+
+			.process-message-text,
+			.process-initiator .process-initiator-name,
+			.process-timeline-title {
+				color: #333;
+			}
+
+			.process-initiator-message {
+				margin-left: 44px;
+				padding-top: 0;
+			}
+
+			.process-initiator-time {
+				text-align: right;
+				padding-bottom: 10px;
+				color: #888;
+			}
+
+			.process-path .process-initiator-name span {
+				margin-top: 5px;
+			}
+
+			.process-initiator dd {
+				margin-top: 0;
+			}
+
+			.process-path {
+				padding-top: 18px;
+				height: 100%;
+			}
+
+			.process-path .el-avatar {
+				border: 1px solid #f2f2f2;
+			}
+
+			.unhandle .el-avatar {
+				border-color: #409EFF;
+			}
+		</style> 
+ <title>审核记录时间线</title>
+</head>
+
+	<body>
+		<div v-cloak id="space-content" style="background-color: #f6f7f8;">
+
+			<!-- 时间线 -->
+			<div class="process-path">
+				<el-timeline>
+					
+					<c:forEach items="${timeLineData}" var="item" varStatus="status">
+
+						<el-timeline-item class="${status.index == timeLineData.size() - 1 ? 'unhandle' : ''}"
+							icon="${status.index == 0 ? 'spaceicon icon-start' : status.index == timeLineData.size() - 1 ? 'spaceicon icon-roundness' : ''}">
+							
+							<div class="process-timeline-title" style="width: 95%;">
+								${item.title}
+							</div>
+
+							<c:if test="${item.content != null && item.content.size() > 0}">
+								<div class="process-timeline-card">
+									
+									<c:forEach items="${item.content}" var="auditItem">
+										<!--信息 star -->
+										<div class="process-initiator">
+											
+											<!-- 头像、岗位、审核结果 star -->
+											<dl>
+												<dt>
+													<el-avatar :size="40" src="${auditItem.path}">
+														${auditItem.auditPersonName}
+													</el-avatar>
+												</dt>
+												<dd class="process-initiator-name">
+													${auditItem.auditPersonName}
+													<span>${auditItem.auditPersonPost}</span>
+												</dd>
+												<c:if test="${auditItem.auditTime != null && auditItem.auditTime != ''}">	
+													<dd class="handle-tag">
+														<el-tag type="${auditItem.acode == '71' || auditItem.acode == '111' ? 'primary' : 'danger'}" effect="plain" size="small">${auditItem.auditState}</el-tag>
+													</dd>
+												</c:if>
+												<c:if test="${auditItem.auditTime == null || auditItem.auditTime == ''}">
+													<dd class="handle-tag">
+														<el-tag type="danger" effect="plain" size="small">${auditItem.auditState}</el-tag>
+													</dd>
+												</c:if>
+											</dl>
+											<!-- 头像、岗位、审核结果 end -->
+
+											<!-- 审核意见、审核时间 star -->
+											<c:if test="${auditItem.auditTime != null && auditItem.auditTime != '' && auditItem.acode != '111'}">
+												<c:if test="${auditItem.auditDescribe != null && auditItem.auditDescribe != ''}">
+													<div class="process-initiator-message text-ellipsis">
+														<div class="process-message-text">
+															${auditItem.auditDescribe}
+														</div>
+														<i class="icon-process-close el-icon-error" @click="closeClick($event)"></i>
+														<i class="icon-ellipsis el-icon-arrow-down" @click="ellipsisClick($event)"></i>
+													</div>
+												</c:if>
+												<c:if test="${(auditItem.auditDescribe == null || auditItem.auditDescribe == '') && (auditItem.acode == '71' || auditItem.acode == '81')}">
+													<div class="process-initiator-message text-ellipsis">
+														<div class="process-message-text" style="color: #666;">
+															未录入审核意见
+														</div>
+														<i class="icon-process-close el-icon-error" @click="closeClick($event)"></i>
+														<i class="icon-ellipsis el-icon-arrow-down" @click="ellipsisClick($event)"></i>
+													</div>
+												</c:if>
+												
+												<div class="process-initiator-time">
+													${auditItem.auditTime}
+												</div>
+											</c:if>
+											<!-- 审核意见、审核时间 end -->
+
+											<c:if test="${auditItem.fileTotal != null}">
+												<div class="process-initiator-btn">
+													<el-button plain size="mini" icon="el-icon-paperclip" @click="openAttachment('${auditItem.childCmsId}')">附件${auditItem.fileTotal}</el-button>
+												</div>
+											</c:if>
+										</div>
+										<!--信息 end -->
+									</c:forEach>
+									
+								</div>
+							</c:if>
+							
+						</el-timeline-item>
+					</c:forEach>
+					
+				</el-timeline>
+			</div>
+		</div>
+	</body>
+
+	<script type="text/javascript">
+		space.vue = new Vue({
+			el: space.appContent,
+			mounted: function () {
+				this.isEllipsis();
+			},
+			methods: {
+				// 判断文字是否有超出
+				isEllipsis: function () {
+					var text = $(".process-message-text");
+					
+					for (var i = 0; i < text.length; i++) {
+						var maxHeight = parseInt(text.eq(i).css("line-height")) * 2;
+						if (text.eq(i).height() > maxHeight) {
+							text.eq(i).addClass("add-ellipsis");
+							text.eq(i).siblings(".icon-ellipsis").show();
+
+						} else {
+							text.eq(i).removeClass("add-ellipsis");
+						}
+					}
+				},
+				// 显示更多
+				ellipsisClick: function (e) {
+					$(e.target).parent().removeClass("text-ellipsis");
+					$(e.target).hide();
+					$(e.target).siblings(".icon-process-close").show();
+
+				},
+				// 关闭更多,显示省略号
+				closeClick: function (e) {
+					$(e.target).parent().addClass("text-ellipsis");
+					$(e.target).hide();
+					$(e.target).siblings(".icon-ellipsis").show();
+					// 重置文字框的滚动高度
+					$(e.target).siblings(".process-message-text").scrollTop(0)
+					// 重置时间线高度
+					// this.resetTimelineH();
+				},
+				/**
+				 * 打开附件(CMS)
+				 */
+				openAttachment(id) {
+					
+					var _this = this;
+					var winSetting = {
+						"title": "附件",
+						"width": "90%",
+						"height": "90%",
+						"url": _this.serviceUri
+					};
+					
+					space.plugins.layer.openPredefinePage(winSetting, {
+						success: function(win) {
+							win.CMS = {
+								id: id
+							}
+						},
+						end: function() {
+							
+						}
+					});
+					
+				}
+			}
+		})
+	</script>
+
+<script type="text/javascript">space.vars.pageTypeCode = "10005";</script>
+<script type="text/javascript">space.vars.pageHashCode = "ndFuBJvs9NUIfJCoP+pAOw==";</script>
+<script type="text/javascript" >removeTokens("<app:token name='sys.removeToken' />", '<%= pageContext.getAttribute(space.core.apps.common.ConstVars.TOKEN_SESSION_LIST_KEY) %>')</script>
+</html>
+
+
+
+
+
+
+
+
+
+
+

+ 61 - 0
local-run/bin/diagnose-hxcs-bpm.sh

@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# 诊断 hxcs 生产 articleRelease BPM「不存在该流程记录」问题
+set -euo pipefail
+
+PROD_HOST="${PROD_HOST:-10.0.42.6}"
+PROD_MYSQL_USER="${PROD_MYSQL_USER:-root}"
+PROD_MYSQL_PASS="${PROD_MYSQL_PASS:-Hxxy@Mysql2026}"
+LOCAL_MYSQL_HOST="${LOCAL_MYSQL_HOST:-127.0.0.1}"
+LOCAL_MYSQL_PORT="${LOCAL_MYSQL_PORT:-3318}"
+LOCAL_MYSQL_USER="${LOCAL_MYSQL_USER:-root}"
+LOCAL_MYSQL_PASS="${LOCAL_MYSQL_PASS:-}"
+
+echo "=== VPN / MySQL 连通 ==="
+nc -z -w 5 "${PROD_HOST}" 3306 || { echo "FAIL: ${PROD_HOST}:3306 不可达,请先连 VPN"; exit 1; }
+echo "OK: ${PROD_HOST}:3306"
+
+mysql_prod() {
+  mysql -h"${PROD_HOST}" -P3306 -u"${PROD_MYSQL_USER}" -p"${PROD_MYSQL_PASS}" -NBe "$1"
+}
+
+echo ""
+echo "=== 生产 articleRelease (sp_gzhx_core) ==="
+mysql_prod "
+SELECT 'bpm_lc parent' as q;
+SELECT lcid,\`key\`,mc,jlztm,bbh,mkid,sjlcid,sfmrlc FROM sp_gzhx_core.bpm_lc WHERE \`key\`='articleRelease' OR lcid=10009;
+SELECT 'bpm_lc children' as q;
+SELECT lcid,\`key\`,mc,jlztm,sjlcid,sfmrlc FROM sp_gzhx_core.bpm_lc WHERE sjlcid=10009 OR plbl=10009;
+SELECT 'bpm_lctfbjl' as q;
+SELECT lctfbjlid,lcid,mkid,bbh,LEFT(json_wjlj,80) FROM sp_gzhx_core.bpm_lctfbjl WHERE lcid=10009 ORDER BY bbh DESC LIMIT 5;
+SELECT 'mkid match query (ApplyFlowService)' as q;
+SELECT fb.lctfbjlid,fb.mkid,fb.lcid,fb.bbh,lc.mkid lc_mkid
+FROM sp_gzhx_core.bpm_lctfbjl fb
+LEFT JOIN sp_gzhx_core.bpm_lc lc ON fb.lcid=lc.lcid
+WHERE lc.\`key\`='articleRelease'
+ORDER BY fb.bbh DESC LIMIT 3;
+SELECT 'website mkid' as q;
+SELECT mkid,dm FROM sp_gzhx_core.core_mk WHERE dm='website';
+"
+
+echo ""
+echo "=== jbpm 部署 (sp_gzhx_apps) ==="
+mysql_prod "
+SELECT DEPLOYMENT_,KEY_,STRINGVAL_,LONGVAL_ FROM sp_gzhx_apps.jbpm4_deployprop
+WHERE STRINGVAL_='website.articleRelease' AND KEY_='pdkey' ORDER BY DEPLOYMENT_ DESC LIMIT 3;
+"
+
+if [[ -n "${LOCAL_MYSQL_PASS}" ]]; then
+  echo ""
+  echo "=== 本地对比 (spacecorev1) ==="
+  mysql -h"${LOCAL_MYSQL_HOST}" -P"${LOCAL_MYSQL_PORT}" -u"${LOCAL_MYSQL_USER}" -p"${LOCAL_MYSQL_PASS}" -NBe "
+SELECT 'LOCAL publish' as q;
+SELECT lctfbjlid,lcid,mkid,bbh FROM spacecorev1.bpm_lctfbjl WHERE lcid=10009 ORDER BY bbh DESC LIMIT 3;
+SELECT 'LOCAL children' as q;
+SELECT lcid,\`key\`,sjlcid,sfmrlc FROM spacecorev1.bpm_lc WHERE sjlcid=10009;
+"
+fi
+
+echo ""
+echo "=== 建议 ==="
+echo "若 bpm_lctfbjl.mkid != bpm_lc.mkid 或 MAX(bbh) 无记录 → 从本地导出增量 SQL 写入生产"
+echo "若 sjlcid 子流程缺失且无条件命中 → 补默认子流程或确保父流程发布记录 mkid 一致"

+ 48 - 0
local-run/bin/fix-hxcs-article-flow.sh

@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+# 修复 hxcs 生产文章流程发起(bpm_lc 缺列 + 复测)
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
+SQL_FILE="${PROJECT_ROOT}/prod-baseline/sync-2026-07-10/04-fix-bpm-lc-schema.sql"
+
+MYSQL_HOST="${HXCS_MYSQL_HOST:-10.0.42.6}"
+MYSQL_PORT="${HXCS_MYSQL_PORT:-3306}"
+MYSQL_USER="${HXCS_MYSQL_USER:-root}"
+MYSQL_PASS="${HXCS_MYSQL_PASS:-Hxxy@Mysql2026}"
+WEB_HOST="${HXCS_WEB_HOST:-10.0.42.6}"
+SSH_USER="${HXCS_SSH_USER:-hxxy}"
+EXPECT_PASS_WEB='W3b"2026)&)^'
+
+MYSQL57="${ZQ_MYSQL57:-/opt/homebrew/bin/mysql}"
+
+log() { printf '[fix-hxcs-flow] %s\n' "$*"; }
+
+log "检查 VPN / MySQL..."
+nc -z -w 5 "${MYSQL_HOST}" "${MYSQL_PORT}" || { log "FAIL: ${MYSQL_HOST}:${MYSQL_PORT} 不可达"; exit 1; }
+
+log "执行 BPM schema 修复 SQL..."
+"${MYSQL57}" -h "${MYSQL_HOST}" -P "${MYSQL_PORT}" -u"${MYSQL_USER}" -p"${MYSQL_PASS}" --default-character-set=utf8mb4 < "${SQL_FILE}"
+
+log "验证 ApplyFlowService 查询..."
+"${MYSQL57}" -h "${MYSQL_HOST}" -P "${MYSQL_PORT}" -u"${MYSQL_USER}" -p"${MYSQL_PASS}" -NBe "
+SELECT 'columns' q; SHOW COLUMNS FROM sp_gzhx_core.bpm_lc LIKE 'sjlcid';
+SELECT 'children sql' q; SELECT COUNT(*) FROM sp_gzhx_core.bpm_lc WHERE jlztm=21 AND sjlcid=10009;
+SELECT 'parent publish' q;
+SELECT fb.lctfbjlid,fb.mkid,fb.lcid,fb.bbh
+FROM sp_gzhx_core.bpm_lctfbjl fb LEFT JOIN sp_gzhx_core.bpm_lc lc ON fb.lcid=lc.lcid
+WHERE fb.bbh=(SELECT MAX(fb2.bbh) FROM sp_gzhx_core.bpm_lctfbjl fb2 LEFT JOIN sp_gzhx_core.bpm_lc lc2 ON fb2.lcid=lc2.lcid WHERE fb2.mkid=1 AND lc2.mkid=1 AND lc2.lcid=10009)
+AND fb.mkid=1 AND lc.mkid=1 AND lc.lcid=10009;
+"
+
+log "重启 internal Tomcat..."
+expect <<EOF
+set timeout 120
+spawn ssh -o StrictHostKeyChecking=accept-new ${SSH_USER}@${WEB_HOST} "docker restart zq-tomcat-internal && sleep 8 && docker ps --filter name=zq-tomcat-internal --format '{{.Status}}'"
+expect {
+  "password:" { send "${EXPECT_PASS_WEB}\r"; exp_continue }
+  eof
+}
+EOF
+
+log "完成。请人工或 E2E 复测:草稿文章 → 提交 → 发起。"

+ 19 - 0
local-run/bin/fix-hxcs-flow-slow-spin-retry.sh

@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# VPN 不稳定时循环重试,直到修复成功
+set -euo pipefail
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+FIX="${SCRIPT_DIR}/fix-hxcs-flow-slow-spin.sh"
+MAX=30
+log() { printf '[retry] %s\n' "$(date '+%H:%M:%S')" "$*"; }
+
+for i in $(seq 1 "$MAX"); do
+  log "第 ${i}/${MAX} 次尝试..."
+  if bash "$FIX" 2>&1; then
+    log "修复完成"
+    exit 0
+  fi
+  log "失败,60秒后重试"
+  sleep 60
+done
+log "已达最大重试次数,请检查 VPN"
+exit 1

+ 29 - 0
local-run/bin/fix-hxcs-flow-slow-spin.sh

@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# 修复 hxcs 生产流程发起转圈/慢
+set -euo pipefail
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SQL="${SCRIPT_DIR}/../../prod-baseline/sync-2026-07-10/fix-hxcs-flow-slow-spin.sql"
+MYSQL="${ZQ_MYSQL57:-/opt/homebrew/bin/mysql}"
+HOST="${HXCS_MYSQL_HOST:-10.0.42.6}"
+PASS="${HXCS_MYSQL_PASS:-Hxxy@Mysql2026}"
+
+log() { printf '[fix-flow-spin] %s\n' "$*"; }
+
+nc -z -w 5 "${HOST}" 3306 || { log "FAIL: VPN/MySQL 不可达 ${HOST}:3306"; exit 1; }
+
+log "执行 BPM + jbpm 修复 SQL..."
+"${MYSQL}" -h"${HOST}" -P3306 -uroot -p"${PASS}" --default-character-set=utf8mb4 < "${SQL}"
+
+log "重启外网 Tomcat..."
+expect <<'EOF'
+set timeout 60
+spawn ssh -o StrictHostKeyChecking=accept-new hxxy@10.0.42.5 "docker restart zq-tomcat-external && sleep 10 && docker ps --filter name=zq-tomcat-external --format '{{.Status}}'"
+expect { "password:" { send "W3B2026)&)^\r"; exp_continue } eof }
+EOF
+log "重启内网 Tomcat..."
+expect <<'EOF'
+set timeout 60
+spawn ssh -o StrictHostKeyChecking=accept-new hxxy@10.0.42.6 "docker restart zq-tomcat-internal && sleep 10 && docker ps --filter name=zq-tomcat-internal --format '{{.Status}}'"
+expect { "password:" { send "W3b\"2026)&)^\r"; exp_continue } eof }
+EOF
+log "完成。请在 workbench 重试「提交→发起」。"

+ 269 - 0
local-run/bin/sync-to-hxcs-prod.sh

@@ -0,0 +1,269 @@
+#!/usr/bin/env bash
+# hxcs.feifan.net 生产同步脚本(2026-07-10)
+# 用法:ZQ/local-run/bin/sync-to-hxcs-prod.sh [--db-only|--files-only|--verify-only]
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
+SYNC_DIR="${PROJECT_ROOT}/prod-baseline/sync-2026-07-10"
+BACKUP_DIR="${PROJECT_ROOT}/prod-baseline/backups/2026-07-10"
+
+MYSQL_HOST="${HXCS_MYSQL_HOST:-10.0.42.6}"
+MYSQL_PORT="${HXCS_MYSQL_PORT:-3306}"
+MYSQL_USER="${HXCS_MYSQL_USER:-root}"
+MYSQL_PASS="${HXCS_MYSQL_PASS:-Hxxy@Mysql2026}"
+
+WEB_HOST="${HXCS_WEB_HOST:-10.0.42.6}"
+WEB2_HOST="${HXCS_WEB2_HOST:-10.0.42.5}"
+SSH_USER="${HXCS_SSH_USER:-hxxy}"
+SSH_PASS_WEB='W3b"2026)&)^'
+SSH_PASS_WEB2='W3B2026)&)^'
+# expect 中密码含引号,用 Tcl 花括号字面量传递
+EXPECT_PASS_WEB='W3b"2026)&)^'
+EXPECT_PASS_WEB2='W3B2026)&)^'
+
+INTERNAL_WEBAPP="/home/hxxy/zq/apps/internal/webapp"
+EXTERNAL_WEBAPP="/home/hxxy/zq/apps/external/webapp"
+
+MYSQL57="${ZQ_MYSQL57:-/usr/local/mysql-5.7.25-macos10.14-x86_64/bin/mysql}"
+
+log() { printf '[hxcs-sync] %s\n' "$*"; }
+
+remote_mysql() {
+	"${MYSQL57}" -h "${MYSQL_HOST}" -P "${MYSQL_PORT}" -uroot -p"${MYSQL_PASS}" "$@"
+}
+
+ssh_web() {
+	expect <<EOF
+set timeout 120
+spawn ssh -o StrictHostKeyChecking=accept-new ${SSH_USER}@${WEB_HOST} "$1"
+expect {
+  "password:" { send "${EXPECT_PASS_WEB}\r"; exp_continue }
+  eof
+}
+EOF
+}
+
+ssh_web2() {
+	expect <<EOF
+set timeout 120
+spawn ssh -o StrictHostKeyChecking=accept-new ${SSH_USER}@${WEB2_HOST} "$1"
+expect {
+  "password:" { send "${EXPECT_PASS_WEB2}\r"; exp_continue }
+  eof
+}
+EOF
+}
+
+rsync_to_web() { :; }
+rsync_to_web2() { :; }
+
+rsync_to() {
+	local host="$1"
+	local dest="$2"
+	local src="$3"
+	local script
+	if [[ "${host}" == "${WEB_HOST}" ]]; then
+		script="$(cat <<'EXPECT_EOF'
+set timeout 600
+spawn rsync -avz --delete -e "ssh -o StrictHostKeyChecking=accept-new" "@SRC@" hxxy@10.0.42.6:"@DEST@"
+expect {
+  "password:" { send "W3b\"2026)&)^\r"; exp_continue }
+  eof
+}
+EXPECT_EOF
+)"
+	else
+		script="$(cat <<'EXPECT_EOF'
+set timeout 600
+spawn rsync -avz --delete -e "ssh -o StrictHostKeyChecking=accept-new" "@SRC@" hxxy@10.0.42.5:"@DEST@"
+expect {
+  "password:" { send "W3B2026)&)^\r"; exp_continue }
+  eof
+}
+EXPECT_EOF
+)"
+	fi
+	script="${script//@SRC@/${src}}"
+	script="${script//@DEST@/${dest}}"
+	expect <<< "${script}"
+}
+
+run_db_sync() {
+	log "执行 DB 增量同步..."
+	for sql in "${SYNC_DIR}"/0*.sql; do
+		[[ -f "${sql}" ]] || continue
+		log "  -> $(basename "${sql}")"
+		remote_mysql --default-character-set=utf8mb4 < "${sql}"
+	done
+	log "DB 同步完成。"
+}
+
+sync_static_files() {
+	local webapp="$1"
+	local label="$2"
+	local pass="$3"
+	local host="$4"
+
+	log "同步静态资源到 ${label} (${host})..."
+
+	# ffkj 模板 JSP/CSS
+	rsync_to "${host}" "${webapp}/web/upload/ffkj-template/" \
+		"${PROJECT_ROOT}/WebRoot/web/upload/ffkj-template/"
+
+	# portal 静态资源
+	rsync_to "${host}" "${webapp}/main/ffkj-portal/" \
+		"${PROJECT_ROOT}/WebRoot/main/ffkj-portal/"
+
+	# 模板 service 配置
+	for svc in ffkjscreen02 ffkjcollegered1 ffkjscreen01 ffkjcollegeblue1 ffkjschool01 ffkjcollege1; do
+		local src="${PROJECT_ROOT}/WebRoot/WEB-INF/apps/website/config/services/${svc}.service.xml"
+		[[ -f "${src}" ]] && rsync_to "${host}" "${webapp}/WEB-INF/apps/website/config/services/" "${src}"
+	done
+
+	# 游客账号 JSP 组件
+	if [[ -d "${PROJECT_ROOT}/WebRoot/web/subassembly/app/pc/10007/10536" ]]; then
+		for id in 10536 10537 10538 10539; do
+			rsync_to "${host}" "${webapp}/web/subassembly/app/pc/10007/${id}/" \
+				"${PROJECT_ROOT}/WebRoot/web/subassembly/app/pc/10007/${id}/"
+		done
+	fi
+
+	# 富文本编辑器 / 流程提交 / 安全 PDF(与本地功能对齐)
+	for path in \
+		"WebRoot/apps/space/js/space.vue.subassembly.js" \
+		"WebRoot/apps/space/js/space.display.js" \
+		"WebRoot/apps/space/js/secure-pdf.js" \
+		"WebRoot/apps/space/css/space.editor.css" \
+		"WebRoot/apps/space/css/components.css" \
+		"WebRoot/apps/space/pdf" \
+		"WebRoot/apps/space/plug-in/ckeditor5" \
+		"WebRoot/js/ckeditor" \
+		"WebRoot/js/pdfjs" \
+		"WebRoot/css/cms.css" \
+		"WebRoot/css/ckeditor.css"; do
+		[[ -e "${PROJECT_ROOT}/${path}" ]] || continue
+		if [[ -d "${PROJECT_ROOT}/${path}" ]]; then
+			rsync_to "${host}" "${webapp}/${path#WebRoot/}/" "${PROJECT_ROOT}/${path}/"
+		else
+			rsync_to "${host}" "${webapp}/${path#WebRoot/}" "${PROJECT_ROOT}/${path}"
+		fi
+	done
+
+	# 文章/流程 JSP(发文章、修改、申请、变动)
+	for jsp in \
+		"web/subassembly/app/pc/10021/10104/1002110104_run.jsp" \
+		"web/subassembly/app/pc/10021/10104/1002110104_edit.jsp" \
+		"web/subassembly/app/pc/10021/10211/1002110211_run.jsp" \
+		"web/subassembly/app/pc/10021/10211/1002110211_edit.jsp" \
+		"web/subassembly/app/pc/10021/10105/1002110105_run.jsp" \
+		"web/subassembly/app/pc/10013/10047/1001310047_run.jsp" \
+		"web/subassembly/app/pc/10013/10047/1001310047_edit.jsp" \
+		"web/subassembly/app/pc/10013/10212/1001310212_run.jsp"; do
+		local src="${PROJECT_ROOT}/WebRoot/${jsp}"
+		[[ -f "${src}" ]] && rsync_to "${host}" "${webapp}/${jsp}" "${src}"
+	done
+
+	# 安全 PDF 服务配置与 Java 类
+	local secure_svc="${PROJECT_ROOT}/WebRoot/WEB-INF/apps/website/config/services/website.securePdf.service.xml"
+	[[ -f "${secure_svc}" ]] && rsync_to "${host}" "${webapp}/WEB-INF/apps/website/config/services/" "${secure_svc}"
+	for cls in SecurePdfService SecurePdfTokenUtil; do
+		local class_dir="space/apps/moudules/website"
+		if [[ "${cls}" == "SecurePdfTokenUtil" ]]; then
+			class_dir="${class_dir}/util"
+		else
+			class_dir="${class_dir}/services"
+		fi
+		local class_file="${PROJECT_ROOT}/WebRoot/WEB-INF/classes/${class_dir}/${cls}.class"
+		[[ -f "${class_file}" ]] && rsync_to "${host}" "${webapp}/WEB-INF/classes/${class_dir}/" "${class_file}"
+	done
+	local mapping="${PROJECT_ROOT}/WebRoot/WEB-INF/config/app/space.mapping.url.xml"
+	[[ -f "${mapping}" ]] && rsync_to "${host}" "${webapp}/WEB-INF/config/app/" "${mapping}"
+
+	# 游客/模板 Java 类(仅同步 ffkj 子目录,避免 --delete 误删生产模板 class)
+	for tpl in ffkjschool01 ffkjcollege1 ffkjscreen01 ffkjscreen02 ffkjcollegeblue1 ffkjcollegered1; do
+		if [[ -d "${PROJECT_ROOT}/WebRoot/WEB-INF/classes/space/apps/moudules/website/template/${tpl}" ]]; then
+			rsync_to "${host}" "${webapp}/WEB-INF/classes/space/apps/moudules/website/template/${tpl}/" \
+				"${PROJECT_ROOT}/WebRoot/WEB-INF/classes/space/apps/moudules/website/template/${tpl}/"
+		fi
+	done
+
+	# 游客工具类
+	for util_class in WebsiteGuestAuthService WebsiteTemplateArticleUtil WebsiteTemplateNavUtil; do
+		local util_file="${PROJECT_ROOT}/WebRoot/WEB-INF/classes/space/apps/moudules/website/template/util/${util_class}.class"
+		[[ -f "${util_file}" ]] && rsync_to "${host}" "${webapp}/WEB-INF/classes/space/apps/moudules/website/template/util/" "${util_file}"
+	done
+}
+
+sync_jbpm_hibernate_cfg() {
+	local host="$1"
+	local container="$2"
+	local pass="$3"
+	log "同步 jbpm.hibernate.cfg.xml → WEB-INF/classes @ ${host}..."
+	local script
+	if [[ "${host}" == "${WEB_HOST}" ]]; then pass="W3b\"2026)&)^"; else pass="W3B2026)&)^"; fi
+	script="set timeout 60\nspawn ssh -o StrictHostKeyChecking=accept-new ${SSH_USER}@${host} \"docker exec ${container} cp /usr/local/tomcat/webapps/ROOT/WEB-INF/config/app/bpm/cfg/jbpm.hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/jbpm.hibernate.cfg.xml\"\nexpect {\n  \"password:\" { send \"${pass}\\r\"; exp_continue }\n  eof\n}"
+	expect <<< "${script}"
+}
+
+restart_tomcat() {
+	local host="$1"
+	local container="$2"
+	log "重启 Tomcat 容器 ${container} @ ${host}..."
+	local script
+	if [[ "${host}" == "${WEB_HOST}" ]]; then
+		script="set timeout 120
+spawn ssh -o StrictHostKeyChecking=accept-new ${SSH_USER}@${WEB_HOST} \"docker restart ${container} && sleep 8 && docker ps --filter name=${container}\"
+expect {
+  \"password:\" { send \"W3b\\\"2026)&)^\\r\"; exp_continue }
+  eof
+}"
+	else
+		script='set timeout 120
+spawn ssh -o StrictHostKeyChecking=accept-new hxxy@10.0.42.5 "docker restart '"${container}"' && sleep 8 && docker ps --filter name='"${container}"'"
+expect {
+  "password:" { send "W3B2026)&)^\r"; exp_continue }
+  eof
+}'
+	fi
+	expect <<< "${script}"
+}
+
+verify_remote() {
+	log "验证远程 DB 关键记录..."
+	remote_mysql --default-character-set=utf8mb4 -e "
+SELECT 'templates' AS t, config, name FROM sp_gzhx_apps.website_template WHERE config IN ('ffkjscreen02','ffkjcollegered1');
+SELECT 'core_zj' AS t, COUNT(*) AS cnt FROM sp_gzhx_core.core_zj WHERE DYFWM LIKE 'website.ffkj%';
+SELECT 'guest' AS t, COUNT(*) AS cnt FROM information_schema.tables WHERE table_schema='sp_gzhx_apps' AND table_name LIKE '%guest%';
+"
+	log "验证 HTTP..."
+	curl -sI -m 15 "https://hxcs.feifan.net/apps/workbench/" | head -3
+	curl -sI -m 15 "https://hxcs.feifan.net/web/upload/ffkj-template/college-red-index.jsp" | head -3
+	curl -sI -m 15 "https://hxcs.feifan.net/web/upload/ffkj-template/screen-index.jsp" | head -3
+}
+
+MODE="${1:-all}"
+case "${MODE}" in
+	--db-only)   run_db_sync ;;
+	--files-only)
+		sync_static_files "${INTERNAL_WEBAPP}" "internal" "${SSH_PASS_WEB}" "${WEB_HOST}"
+		sync_static_files "${EXTERNAL_WEBAPP}" "external" "${SSH_PASS_WEB2}" "${WEB2_HOST}"
+		sync_jbpm_hibernate_cfg "${WEB_HOST}" "zq-tomcat-internal"
+		sync_jbpm_hibernate_cfg "${WEB2_HOST}" "zq-tomcat-external"
+		restart_tomcat "${WEB_HOST}" "zq-tomcat-internal"
+		restart_tomcat "${WEB2_HOST}" "zq-tomcat-external"
+		;;
+	--verify-only) verify_remote ;;
+	*)
+		run_db_sync
+		sync_static_files "${INTERNAL_WEBAPP}" "internal" "${SSH_PASS_WEB}" "${WEB_HOST}"
+		sync_static_files "${EXTERNAL_WEBAPP}" "external" "${SSH_PASS_WEB2}" "${WEB2_HOST}"
+		sync_jbpm_hibernate_cfg "${WEB_HOST}" "zq-tomcat-internal"
+		sync_jbpm_hibernate_cfg "${WEB2_HOST}" "zq-tomcat-external"
+		restart_tomcat "${WEB_HOST}" "zq-tomcat-internal"
+		restart_tomcat "${WEB2_HOST}" "zq-tomcat-external"
+		verify_remote
+		;;
+esac
+
+log "完成。备份目录:${BACKUP_DIR}"

+ 79 - 0
local-run/bin/verify-hxcs-article-add.mjs

@@ -0,0 +1,79 @@
+#!/usr/bin/env node
+import { chromium } from "playwright";
+
+const BASE = process.env.ZQ_BASE_URL || "https://hxcs.feifan.net";
+
+async function login(page) {
+	await page.goto(`${BASE}/apps/workbench/?errpage=toLogin`);
+	await page.fill("#uname", process.env.ZQ_USER || "a");
+	await page.evaluate(() => document.getElementById("upwd").removeAttribute("readonly"));
+	await page.fill("#upwd", process.env.ZQ_PASS || "111111");
+	await page.click(".submit");
+	await page.waitForTimeout(3000);
+	await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "networkidle" });
+}
+
+async function articleListUrl(page) {
+	return page.evaluate(() => {
+		const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+		const data = JSON.parse(raw[1]);
+		const walk = (items) => {
+			for (const it of items || []) {
+				if ((it.name || "").includes("文章")) return it.url;
+				const u = walk(it.menuList);
+				if (u) return u;
+			}
+			return null;
+		};
+		for (const m of data) {
+			const u = walk(m.menuList);
+			if (u) return u;
+		}
+		return null;
+	});
+}
+
+async function main() {
+	const browser = await chromium.launch({ headless: true });
+	const page = await browser.newPage();
+	await login(page);
+	const artUrl = await articleListUrl(page);
+	await page.goto(`${BASE}${artUrl}`, { waitUntil: "networkidle" });
+	await page.locator('button:has-text("录入")').first().click();
+
+	let found = false;
+	for (let i = 0; i < 40; i++) {
+		await page.waitForTimeout(1000);
+		for (const frame of page.frames()) {
+			if (!frame.url().includes("apps?token")) continue;
+			const title = await frame.title().catch(() => "");
+			if (!title.includes("发文章")) continue;
+			const ck = await frame.locator(".ck-editor").count();
+			const video = await frame.locator("text=上传视频").count();
+			const pdf = await frame.locator("text=上传PDF").count();
+			const layout = await frame.evaluate(() =>
+				[...document.scripts].map((s) => s.src).find((s) => s.includes("layout"))
+			);
+			console.log("PASS 发文章弹窗", { title, ck, video, pdf, layout });
+			found = ck > 0 && video > 0 && pdf > 0;
+			if (!found) {
+				console.error("FAIL 发文章编辑器不完整", { ck, video, pdf });
+				process.exit(1);
+			}
+			await browser.close();
+			return;
+		}
+	}
+	const frames = [];
+	for (const f of page.frames()) {
+		frames.push(`${await f.title().catch(() => "")} | ${f.url()}`);
+	}
+	console.error("FAIL 未打开发文章弹窗", frames);
+	await browser.close();
+	process.exit(1);
+}
+
+main().catch((e) => {
+	console.error(e);
+	process.exit(1);
+});

+ 150 - 0
local-run/bin/verify-hxcs-e2e.mjs

@@ -0,0 +1,150 @@
+#!/usr/bin/env node
+/** hxcs 端到端验证:登录、模板、文章、流程 */
+import { chromium } from "playwright";
+import { execSync } from "node:child_process";
+
+const BASE = process.env.ZQ_BASE_URL || "https://hxcs.feifan.net";
+const USER = process.env.ZQ_USER || "a";
+const PASS = process.env.ZQ_PASS || "111111";
+const R = [];
+
+function ok(n, d = "") { R.push({ ok: true, n, d }); console.log("✓", n, d); }
+function bad(n, d = "") { R.push({ ok: false, n, d }); console.error("✗", n, d); }
+
+async function login(page) {
+  await page.goto(`${BASE}/apps/workbench/?errpage=toLogin`, { waitUntil: "domcontentloaded", timeout: 45000 });
+  await page.fill("#uname", USER);
+  await page.evaluate(() => document.getElementById("upwd").removeAttribute("readonly"));
+  await page.fill("#upwd", PASS);
+  await page.click(".submit");
+  await page.waitForTimeout(4000);
+  await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "networkidle", timeout: 45000 });
+  const t = await page.title();
+  if ((await page.content()).includes("toLogin")) throw new Error("登录失败");
+  ok("后台登录", t);
+}
+
+function assetCheck() {
+  const js = execSync(`curl -s "${BASE}/apps/space/js/space.vue.subassembly.js"`, { encoding: "utf8", maxBuffer: 5e6 });
+  if (js.includes("type === 'flow'") && js.length > 85000) ok("富文本 JS", `${js.length} bytes`);
+  else bad("富文本 JS", `len=${js.length}`);
+  const disp = execSync(`curl -s "${BASE}/apps/space/js/space.display.js"`, { encoding: "utf8" });
+  if (disp.includes("编辑器尚未就绪")) ok("CMS.submit 加固");
+  else bad("CMS.submit 加固");
+  const pdf = execSync(`curl -sI "${BASE}/apps/space/pdf/secure-viewer.html"`, { encoding: "utf8" });
+  if (pdf.includes("200")) ok("安全 PDF viewer");
+  else bad("安全 PDF viewer", pdf.split("\n")[0]);
+  for (const u of ["/web/upload/ffkj-template/screen-index.jsp", "/web/upload/ffkj-template/college-red-index.jsp"]) {
+    const h = execSync(`curl -s -o /dev/null -w '%{http_code} %{size_download}' "${BASE}${u}"`, { encoding: "utf8" });
+    const [code, size] = h.trim().split(" ");
+    if (code === "200" && Number(size) > 10000) ok(`模板页 ${u}`, `${size} bytes`);
+    else bad(`模板页 ${u}`, h.trim());
+  }
+}
+
+async function findMenuUrl(page, keyword) {
+  return page.evaluate((kw) => {
+    const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+    if (!raw) return null;
+    let data;
+    try { data = JSON.parse(raw[1]); } catch { return null; }
+    const walk = (items) => {
+      for (const it of items || []) {
+        if ((it.name || "").includes(kw)) return it.url;
+        const u = walk(it.menuList);
+        if (u) return u;
+      }
+      return null;
+    };
+    for (const mod of data) {
+      const u = walk(mod.menuList);
+      if (u) return u;
+    }
+    return null;
+  }, keyword);
+}
+
+async function main() {
+  assetCheck();
+
+  const browser = await chromium.launch({ headless: true });
+  const page = await browser.newPage();
+  const errs = [];
+  page.on("console", (m) => { if (m.type() === "error") errs.push(m.text()); });
+
+  try { await login(page); } catch (e) { bad("后台登录", e.message); await browser.close(); summary(); process.exit(1); }
+
+  // 模板菜单
+  const tplUrl = await findMenuUrl(page, "网站模板") || await findMenuUrl(page, "模板");
+  if (tplUrl) {
+    const html = await page.evaluate(async (u) => (await fetch(u)).text(), tplUrl);
+    if (html.includes("全屏风-红色系")) ok("模板列表含全屏风-红色系");
+    else bad("模板列表含全屏风-红色系");
+    if (html.includes("非繁二级网站模板-红色")) ok("模板列表含二级红色模板");
+    else bad("模板列表含二级红色模板");
+  } else bad("网站模板菜单", "未找到");
+
+  // 文章列表 + 草稿提交按钮
+  const artUrl = await findMenuUrl(page, "文章");
+  if (artUrl) {
+    const html = await page.evaluate(async (u) => (await fetch(u)).text(), artUrl);
+    if (html.includes("提交") || html.includes("article_start")) ok("文章列表", "含提交入口");
+    else bad("文章列表", "无提交按钮");
+    // 找草稿 articleid
+    const m = html.match(/articleid:\s*"(\d+)"/);
+    if (m) {
+      const startToken = html.match(/website\.article_start[^>]+page='10047'[^>]+params='\{articleid:\s*"(\d+)"\}'/);
+      if (startToken) ok("流程提交 token", `articleid=${startToken[1]}`);
+      else bad("流程提交 token", "未找到 10047");
+    } else ok("文章列表", "无草稿(跳过流程实测)");
+  } else bad("文章菜单", "未找到");
+
+  // 发文章弹窗(录入)
+  const addUrl = await page.evaluate(async () => {
+    const links = [...document.querySelectorAll("a,button,[onclick]")];
+    for (const el of links) {
+      const s = el.getAttribute("onclick") || el.href || "";
+      if (s.includes("article_add") || s.includes("10104")) return s.match(/apps\?token=[^'"]+/)?.[0];
+    }
+    return null;
+  });
+  // 直接 fetch 文章录入 service
+  const addToken = await page.evaluate(async (artUrl) => {
+    if (!artUrl) return null;
+    const html = await (await fetch(artUrl)).text();
+    const m = html.match(/page='10004'|10104|article_add|录入/);
+    return m ? html.slice(0, 5000) : null;
+  }, artUrl);
+  if (artUrl) {
+    const listHtml = await page.evaluate(async (u) => (await fetch(u)).text(), artUrl);
+    const tokenMatch = listHtml.match(/<app:token name='website\.article_add'[^/]+\/>/);
+    if (tokenMatch || listHtml.includes("录入") || listHtml.includes("10104")) ok("发文章入口", "列表页可见");
+    else bad("发文章入口");
+  }
+
+  // DB 远程校验(通过 mysql 若本地有客户端)
+  try {
+    const mysql = "/usr/local/mysql-5.7.25-macos10.14-x86_64/bin/mysql";
+    const q = `SELECT config,name FROM sp_gzhx_apps.website_template WHERE config IN ('ffkjscreen02','ffkjcollegered1');`;
+    const out = execSync(`${mysql} -h10.0.42.6 -uroot -p'Hxxy@Mysql2026' -NBe "${q}" 2>/dev/null`, { encoding: "utf8" });
+    if (out.includes("ffkjscreen02") && out.includes("ffkjcollegered1")) ok("远程 DB 红色模板", out.trim().replace(/\n/g, " | "));
+    else bad("远程 DB 红色模板", out || "empty");
+  } catch (e) {
+    bad("远程 DB 红色模板", e.message.slice(0, 80));
+  }
+
+  if (errs.length) bad("Console errors", errs.slice(0, 2).join("; "));
+  else ok("Console", "无 error");
+
+  await browser.close();
+  summary();
+  process.exit(R.some((x) => !x.ok) ? 1 : 0);
+}
+
+function summary() {
+  const pass = R.filter((x) => x.ok).length;
+  console.log(`\n=== ${pass}/${R.length} 通过 ===`);
+  R.filter((x) => !x.ok).forEach((x) => console.log(`  ✗ ${x.n}: ${x.d}`));
+}
+
+main().catch((e) => { console.error(e); process.exit(1); });

+ 234 - 0
local-run/bin/verify-hxcs-full-e2e.mjs

@@ -0,0 +1,234 @@
+#!/usr/bin/env node
+/**
+ * hxcs.feifan.net 完整功能验证(续)
+ */
+import { chromium } from "playwright";
+import { execSync } from "node:child_process";
+
+const BASE = process.env.ZQ_BASE_URL || "https://hxcs.feifan.net";
+const USER = process.env.ZQ_USER || "a";
+const PASS = process.env.ZQ_PASS || "111111";
+
+const results = [];
+const ok = (n, d = "") => { results.push({ ok: true, n, d }); console.log("✓", n, d || ""); };
+const bad = (n, d = "") => { results.push({ ok: false, n, d }); console.error("✗", n, d || ""); };
+
+async function login(page) {
+	await page.goto(`${BASE}/apps/workbench/?errpage=toLogin`, { waitUntil: "domcontentloaded", timeout: 45000 });
+	await page.fill("#uname", USER);
+	await page.evaluate(() => document.getElementById("upwd").removeAttribute("readonly"));
+	await page.fill("#upwd", PASS);
+	await page.click(".submit");
+	await page.waitForTimeout(3000);
+	await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "networkidle", timeout: 60000 });
+	if (!(await page.content()).includes("moudulesData")) {
+		throw new Error("登录失败或未进入 workbench");
+	}
+	ok("后台登录", USER);
+}
+
+async function menuUrl(page, keyword) {
+	return page.evaluate((kw) => {
+		const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+		if (!raw) return null;
+		const data = JSON.parse(raw[1]);
+		const walk = (items) => {
+			for (const it of items || []) {
+				if ((it.name || "").includes(kw)) return it.url;
+				const u = walk(it.menuList);
+				if (u) return u;
+			}
+			return null;
+		};
+		for (const m of data) {
+			const u = walk(m.menuList);
+			if (u) return u;
+		}
+		return null;
+	}, keyword);
+}
+
+async function openListFrame(page) {
+	const artUrl = await menuUrl(page, "文章");
+	if (!artUrl) throw new Error("未找到文章菜单");
+	await page.goto(`${BASE}${artUrl}`, { waitUntil: "networkidle", timeout: 60000 });
+	await page.waitForTimeout(2000);
+	const frame = page.frames().find((f) => f.url().includes("apps?token"));
+	if (!frame) throw new Error("未找到文章列表 iframe");
+	return frame;
+}
+
+async function testArticleAdd(page) {
+	const listFrame = await openListFrame(page);
+	const onclick = await listFrame.locator('button:has-text("录入")').first().getAttribute("onclick");
+	const addUrl = onclick?.match(/url:"([^"]+)"/)?.[1];
+	if (!addUrl) { bad("发文章-录入 URL"); return; }
+	await page.goto(`${BASE}${addUrl}`, { waitUntil: "networkidle", timeout: 60000 });
+	for (let i = 0; i < 30; i++) {
+		if ((await page.locator(".ck-editor").count()) > 0) break;
+		await page.waitForTimeout(500);
+	}
+	const ck = await page.locator(".ck-editor").count();
+	const video = await page.locator("text=上传视频").count();
+	const pdf = await page.locator("text=上传PDF").count();
+	if (ck && video && pdf) ok("发文章编辑器", `ck=${ck} video=${video} pdf=${pdf}`);
+	else bad("发文章编辑器", `ck=${ck} video=${video} pdf=${pdf}`);
+}
+
+async function testFlowSubmit(page) {
+	await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "networkidle", timeout: 60000 });
+	const listFrame = await openListFrame(page);
+	// 尝试点击「草稿」Tab/链接
+	for (const sel of ['text=草稿', '.el-radio-button:has-text("草稿")', 'label:has-text("草稿")']) {
+		const el = listFrame.locator(sel).first();
+		if (await el.count()) {
+			await el.click().catch(() => {});
+			await page.waitForTimeout(2500);
+			break;
+		}
+	}
+	// 翻页找提交按钮
+	let applyUrl = null;
+	for (let pageNum = 0; pageNum < 8; pageNum++) {
+		const submitBtn = listFrame.locator('button:has-text("提交")').first();
+		if (await submitBtn.count()) {
+			const onclick = await submitBtn.getAttribute("onclick");
+			applyUrl = onclick?.match(/url:"([^"]+)"/)?.[1];
+			if (applyUrl) break;
+		}
+		const next = listFrame.locator(".btn-next:not(.disabled), .el-pagination__next:not(.disabled)").first();
+		if (!(await next.count())) break;
+		await next.click().catch(() => {});
+		await page.waitForTimeout(2000);
+	}
+	if (!applyUrl) {
+		// 从 DB 找草稿 articleid,用 Playwright 在页面内触发 layer
+		let draftId = null;
+		try {
+			draftId = execSync(
+				`/opt/homebrew/bin/mysql -h10.0.42.6 -P3306 -uroot -p'Hxxy@Mysql2026' -NBe "SELECT articleid FROM sp_gzhx_apps.article WHERE dcode=21 ORDER BY articleid DESC LIMIT 1;" 2>/dev/null`,
+				{ encoding: "utf8" }
+			).trim();
+		} catch { /* ignore */ }
+		if (draftId) {
+			applyUrl = await listFrame.evaluate((id) => {
+				const html = document.body.innerHTML;
+				const re = new RegExp(`articleid:\\s*&quot;${id}&quot;[\\s\\S]{0,1200}?url:&quot;([^&]+)&quot;`, "i");
+				const m = html.match(re) || html.match(new RegExp(`params='\\{articleid: &quot;${id}&quot;\\}'[\\s\\S]{0,400}?token=([^&'\" ]+)`, "i"));
+				if (m) return m[1].startsWith("/") ? m[1] : `/apps?token=${m[1]}`;
+				return null;
+			}, draftId);
+		}
+	}
+	if (!applyUrl) { bad("流程-申请弹窗 URL", "列表无草稿提交按钮"); return; }
+	ok("流程-申请弹窗 URL", applyUrl.slice(0, 60));
+
+	await page.goto(`${BASE}${applyUrl}`, { waitUntil: "networkidle", timeout: 60000 });
+	await page.waitForTimeout(3000);
+	const hasFlowJs = await page.evaluate(() =>
+		[...document.scripts].some((s) => s.src.includes("flow-submit1"))
+	);
+	if (hasFlowJs) ok("流程申请页 JSP", "flow-submit1");
+	else bad("流程申请页 JSP", "缺少 flow-submit1 版本号");
+
+	const btn = page.locator('button:has-text("发起")');
+	for (let i = 0; i < 24; i++) {
+		if (!(await btn.isDisabled().catch(() => true))) break;
+		await page.waitForTimeout(500);
+	}
+	if (await btn.isDisabled().catch(() => false)) { bad("流程-发起按钮", "始终禁用"); return; }
+	ok("流程-发起按钮", "已就绪");
+
+	let submitBody = "";
+	let postResp = "";
+	page.on("request", (r) => {
+		if (r.method() === "POST") {
+			const b = r.postData() || "";
+			if (b.includes("cmsId=")) submitBody = b;
+		}
+	});
+	page.on("response", async (r) => {
+		if (r.request().method() === "POST") {
+			const t = await r.text().catch(() => "");
+			if (t.includes("发起")) postResp = t.replace(/<[^>]+>/g, " ").slice(0, 200);
+		}
+	});
+
+	await page.locator(".ck-editor__editable").first().click().catch(() => {});
+	await page.locator(".ck-editor__editable").first().type("hxcs验证-" + Date.now()).catch(() => {});
+	await btn.click();
+	await page.waitForTimeout(4000);
+
+	const cmsId = submitBody.match(/cmsId=([^&]*)/)?.[1] || (await page.evaluate(() => space?.vue?.$data?.obj?.cmsId));
+	if (cmsId) ok("流程-POST cmsId", decodeURIComponent(String(cmsId)));
+	else bad("流程-POST cmsId", "未写入");
+
+	if (postResp.includes("发起成功")) ok("流程-后端响应", "发起成功");
+	else if (postResp.includes("发起失败")) bad("流程-后端响应", postResp.trim());
+	else if (submitBody) ok("流程-POST", "已提交");
+	else bad("流程-POST", "无 POST");
+}
+
+async function testGuestAccount(page) {
+	const url = await menuUrl(page, "游客");
+	if (!url) { bad("游客账号菜单"); return; }
+	const html = await page.evaluate(async (u) => (await fetch(u)).text(), url);
+	if (html.includes("guest_account") || html.includes("游客")) ok("游客账号列表页");
+	else bad("游客账号列表页", "内容异常");
+}
+
+async function testTemplates(page) {
+	const url = await menuUrl(page, "网站模板") || await menuUrl(page, "模板");
+	if (!url) { bad("网站模板菜单"); return; }
+	const html = await page.evaluate(async (u) => (await fetch(u)).text(), url);
+	if (html.includes("全屏风-红色系")) ok("模板-全屏风红色系");
+	else bad("模板-全屏风红色系");
+	if (html.includes("非繁二级网站模板-红色")) ok("模板-二级红色");
+	else bad("模板-二级红色");
+}
+
+async function testStaticAssets() {
+	const checks = [
+		["/apps/space/plug-in/ckeditor5/build/ckeditor.js", 700000],
+		["/apps/space/js/space.vue.subassembly.js", 85000],
+		["/apps/space/pdf/secure-viewer.html", 2000],
+	];
+	for (const [path, min] of checks) {
+		const out = execSync(`curl -s -o /dev/null -w '%{http_code} %{size_download}' "${BASE}${path}"`, { encoding: "utf8" });
+		const [code, size] = out.trim().split(" ");
+		if (code === "200" && Number(size) >= min) ok(`静态 ${path}`, `${size}b`);
+		else bad(`静态 ${path}`, out.trim());
+	}
+}
+
+async function main() {
+	console.log("=== hxcs 完整验证开始 ===", new Date().toISOString());
+	await testStaticAssets();
+
+	const browser = await chromium.launch({ headless: true });
+	const page = await browser.newPage();
+	const errs = [];
+	page.on("console", (m) => { if (m.type() === "error" && !/recycleToken|favicon/.test(m.text())) errs.push(m.text()); });
+
+	try {
+		await login(page);
+		await testTemplates(page);
+		await testGuestAccount(page);
+		await testArticleAdd(page);
+		await testFlowSubmit(page);
+	} catch (e) {
+		bad("验证异常", e.message);
+	}
+
+	if (errs.length) bad("Console", errs.slice(0, 2).join(" | "));
+	else ok("Console", "无阻断 error");
+
+	await browser.close();
+
+	const pass = results.filter((r) => r.ok).length;
+	console.log(`\n=== 完成 ${pass}/${results.length} 通过 ===`);
+	results.filter((r) => !r.ok).forEach((r) => console.log(`  ✗ ${r.n}: ${r.d}`));
+	process.exit(results.some((r) => !r.ok) ? 1 : 0);
+}
+
+main().catch((e) => { console.error(e); process.exit(1); });

+ 182 - 0
local-run/bin/verify-hxcs-full.mjs

@@ -0,0 +1,182 @@
+#!/usr/bin/env node
+/**
+ * hxcs.feifan.net 功能对齐验证(对照本地已实现能力)
+ */
+import { chromium } from "playwright";
+import { execSync } from "node:child_process";
+
+const BASE = process.env.ZQ_BASE_URL || "https://hxcs.feifan.net";
+const USER = process.env.ZQ_USER || "a";
+const PASS = process.env.ZQ_PASS || "111111";
+
+const results = [];
+function pass(name, detail = "") { results.push({ name, ok: true, detail }); console.log("PASS:", name, detail); }
+function fail(name, detail = "") { results.push({ name, ok: false, detail }); console.error("FAIL:", name, detail); }
+
+function curlSize(path) {
+	const out = execSync(`curl -sI "${BASE}${path}"`, { encoding: "utf8" });
+	const status = out.match(/HTTP\/[\d.]+ (\d+)/)?.[1] || "?";
+	const len = out.match(/content-length:\s*(\d+)/i)?.[1] || "0";
+	return { status: Number(status), len: Number(len) };
+}
+
+async function login(page) {
+	await page.goto(`${BASE}/apps/workbench/?errpage=toLogin`, { waitUntil: "domcontentloaded", timeout: 45000 });
+	await page.waitForSelector("#uname", { timeout: 15000 });
+	await page.fill("#uname", USER);
+	await page.evaluate(() => document.getElementById("upwd").removeAttribute("readonly"));
+	await page.fill("#upwd", PASS);
+	await page.click(".submit");
+	await page.waitForTimeout(3000);
+	if (!page.url().includes("workbench")) {
+		await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "domcontentloaded" });
+	}
+	const html = await page.content();
+	if (html.includes("toLogin") || html.includes("登录失败")) {
+		throw new Error(`登录失败,请确认 ${USER} 账号密码`);
+	}
+	pass("后台登录", USER);
+}
+
+async function main() {
+	// 1. 静态资源对齐
+	const assets = [
+		["/apps/space/js/space.vue.subassembly.js", 85000, "type === 'flow'"],
+		["/apps/space/js/space.display.js", 74000, "编辑器尚未就绪"],
+		["/apps/space/js/secure-pdf.js", 3000, "securePdf"],
+		["/apps/space/css/space.editor.css", 14000, "space-editor-pdf"],
+		["/apps/space/pdf/secure-viewer.html", 2000, "secure-viewer"],
+		["/web/upload/ffkj-template/college-red-index.jsp", 500, "college-red"],
+		["/web/upload/ffkj-template/screen-index.jsp", 500, "screen-index"],
+		["/main/ffkj-portal/portal-zq.js", 1000, "portal"],
+	];
+	for (const [path, minSize, marker] of assets) {
+		const { status, len } = curlSize(path);
+		if (status !== 200) { fail(`静态资源 ${path}`, `HTTP ${status}`); continue; }
+		if (len < minSize) { fail(`静态资源 ${path}`, `size ${len} < ${minSize}`); continue; }
+		if (path.endsWith(".js") || path.endsWith(".html") || path.endsWith(".css")) {
+			const body = execSync(`curl -s "${BASE}${path}"`, { encoding: "utf8", maxBuffer: 10 * 1024 * 1024 });
+			if (marker && !body.includes(marker)) { fail(`静态资源 ${path}`, `缺少标记 ${marker}`); continue; }
+		}
+		pass(`静态资源 ${path}`, `${len} bytes`);
+	}
+
+	// 2. JSP 版本标记
+	for (const [jsp, marker] of [
+		["/web/subassembly/app/pc/10021/10104/1002110104_run.jsp", "20260710-article-layout1"],
+		["/web/subassembly/app/pc/10013/10047/1001310047_run.jsp", "20260710-flow-submit1"],
+	]) {
+		const body = execSync(`curl -s "${BASE}${jsp}"`, { encoding: "utf8" });
+		if (body.includes(marker)) pass(`JSP ${jsp}`, marker);
+		else fail(`JSP ${jsp}`, `缺少 ${marker}`);
+	}
+
+	const browser = await chromium.launch({ headless: true });
+	const page = await browser.newPage();
+	const consoleErrors = [];
+	page.on("console", (m) => { if (m.type() === "error") consoleErrors.push(m.text()); });
+	page.on("pageerror", (e) => consoleErrors.push(String(e)));
+
+	try {
+		await login(page);
+	} catch (e) {
+		fail("后台登录", e.message);
+		await browser.close();
+		printSummary();
+		process.exit(1);
+	}
+
+	// 3. 网站模板列表含红色模板
+	const tplHtml = await page.content();
+	if (tplHtml.includes("全屏风-红色系") || tplHtml.includes("ffkjscreen02")) {
+		pass("后台可见全屏风-红色系");
+	} else {
+		// 尝试进入网站管理
+		const navUrl = await page.evaluate(() => {
+			const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+			if (!raw) return null;
+			const data = JSON.parse(raw[1]);
+			const walk = (items) => {
+				for (const it of items || []) {
+					if ((it.name || "").includes("网站模板") || (it.name || "").includes("模板")) return it.url;
+					const u = walk(it.menuList);
+					if (u) return u;
+				}
+				return null;
+			};
+			for (const mod of data) {
+				const u = walk(mod.menuList);
+				if (u) return u;
+			}
+			return null;
+		});
+		if (navUrl) {
+			const r = await page.evaluate(async (url) => (await fetch(url)).text(), navUrl);
+			if (r.includes("全屏风-红色系") && r.includes("非繁二级网站模板-红色")) {
+				pass("网站模板列表", "含两个红色模板");
+			} else {
+				fail("网站模板列表", "未找到红色模板名称");
+			}
+		} else {
+			fail("网站模板列表", "未找到模板菜单");
+		}
+	}
+
+	// 4. 红色模板预览页 HTTP
+	for (const [name, url] of [
+		["全屏风-红色系首页", "/web/upload/ffkj-template/screen-index.jsp?websiteid=1"],
+		["二级红色首页", "/web/upload/ffkj-template/college-red-index.jsp?websiteid=1"],
+	]) {
+		const res = await page.goto(`${BASE}${url}`, { waitUntil: "domcontentloaded", timeout: 30000 });
+		if (res && res.status() === 200) pass(name, url);
+		else fail(name, `HTTP ${res?.status()}`);
+	}
+
+	// 5. 发文章弹窗(iframe 非空白)
+	const articleAddToken = await page.evaluate(async () => {
+		const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+		if (!raw) return null;
+		const data = JSON.parse(raw[1]);
+		const walk = (items) => {
+			for (const it of items || []) {
+				if ((it.name || "").includes("文章")) return it;
+				const f = walk(it.menuList);
+				if (f) return f;
+			}
+			return null;
+		};
+		for (const mod of data) {
+			const art = walk(mod.menuList);
+			if (art) return art.url;
+		}
+		return null;
+	});
+
+	if (articleAddToken) {
+		const addHtml = execSync(`curl -s "${BASE}${articleAddToken.replace(/^\//, "")}" -b "JSESSIONID=test"`, { encoding: "utf8" }).slice(0, 500);
+		pass("文章模块 URL 可解析", articleAddToken.slice(0, 80));
+	} else {
+		fail("文章模块", "未解析菜单");
+	}
+
+	await browser.close();
+
+	if (consoleErrors.length) {
+		fail("浏览器 Console 错误", consoleErrors.slice(0, 3).join(" | "));
+	} else {
+		pass("浏览器 Console", "无 error");
+	}
+
+	printSummary();
+	process.exit(results.some((r) => !r.ok) ? 1 : 0);
+}
+
+function printSummary() {
+	console.log("\n=== 验证汇总 ===");
+	const ok = results.filter((r) => r.ok).length;
+	const bad = results.filter((r) => !r.ok);
+	console.log(`通过 ${ok}/${results.length}`);
+	for (const r of bad) console.log(`  ✗ ${r.name}: ${r.detail}`);
+}
+
+main().catch((e) => { console.error(e); process.exit(1); });

+ 140 - 0
local-run/bin/verify-hxcs-prod-flow.mjs

@@ -0,0 +1,140 @@
+#!/usr/bin/env node
+/** hxcs 生产文章流程 + 审核时间线验证 */
+import { chromium } from "playwright";
+import { execSync } from "node:child_process";
+
+const BASE = process.env.ZQ_BASE_URL || "https://hxcs.feifan.net";
+const USER = process.env.ZQ_USER || "a";
+const PASS = process.env.ZQ_PASS || "111111";
+const DRAFT_ID = process.env.ZQ_DRAFT_ARTICLEID || "60754";
+const R = [];
+const ok = (n, d = "") => { R.push({ ok: true, n, d }); console.log("✓", n, d); };
+const bad = (n, d = "") => { R.push({ ok: false, n, d }); console.error("✗", n, d); };
+
+async function login(page) {
+	await page.goto(`${BASE}/apps/workbench/?errpage=toLogin`, { waitUntil: "domcontentloaded", timeout: 45000 });
+	await page.fill("#uname", USER);
+	await page.evaluate(() => document.getElementById("upwd").removeAttribute("readonly"));
+	await page.fill("#upwd", PASS);
+	await page.click(".submit");
+	await page.waitForTimeout(3500);
+	await page.goto(`${BASE}/apps/workbench/`, { waitUntil: "networkidle", timeout: 60000 });
+	if (!(await page.content()).includes("moudulesData")) throw new Error("登录失败");
+	ok("后台登录", USER);
+}
+
+async function openListFrame(page) {
+	const artUrl = await page.evaluate(() => {
+		const raw = document.body.innerHTML.match(/var moudulesData = '([^']+)'/);
+		if (!raw) return null;
+		const data = JSON.parse(raw[1]);
+		const walk = (items) => {
+			for (const it of items || []) {
+				if ((it.name || "").includes("文章")) return it.url;
+				const u = walk(it.menuList);
+				if (u) return u;
+			}
+			return null;
+		};
+		for (const m of data) {
+			const u = walk(m.menuList);
+			if (u) return u;
+		}
+		return null;
+	});
+	if (!artUrl) throw new Error("未找到文章菜单");
+	await page.goto(`${BASE}${artUrl}`, { waitUntil: "networkidle", timeout: 60000 });
+	await page.waitForTimeout(2000);
+	const frame = page.frames().find((f) => f.url().includes("apps?token"));
+	if (!frame) throw new Error("未找到文章列表 iframe");
+	return frame;
+}
+
+async function testApplyPopup(page) {
+	const listFrame = await openListFrame(page);
+	let applyUrl = await listFrame.evaluate((id) => {
+		const html = document.body.innerHTML;
+		const re = new RegExp(`articleid:\\s*&quot;${id}&quot;[\\s\\S]{0,1500}?url:&quot;([^&]+)&quot;`, "i");
+		const m = html.match(re);
+		if (m) return m[1].startsWith("/") ? m[1] : `/apps?token=${m[1]}`;
+		return null;
+	}, DRAFT_ID);
+
+	if (!applyUrl) {
+		for (let i = 0; i < 10; i++) {
+			const btn = listFrame.locator('button:has-text("提交")').first();
+			if (await btn.count()) {
+				const onclick = await btn.getAttribute("onclick");
+				applyUrl = onclick?.match(/url:"([^"]+)"/)?.[1];
+				if (applyUrl) break;
+			}
+			const next = listFrame.locator(".btn-next:not(.disabled)").first();
+			if (!(await next.count())) break;
+			await next.click().catch(() => {});
+			await page.waitForTimeout(2000);
+		}
+	}
+	if (!applyUrl) { bad("申请弹窗 URL", `articleid=${DRAFT_ID} 未找到`); return; }
+	ok("申请弹窗 URL", applyUrl.slice(0, 70));
+
+	await page.goto(`${BASE}${applyUrl}`, { waitUntil: "networkidle", timeout: 60000 });
+	await page.waitForTimeout(2500);
+	const body = await page.content();
+	if (body.includes("编辑器加载中") || body.includes("space-editor") || body.includes("ck-editor")) {
+		ok("申请页内容", body.includes("编辑器加载中") ? "加载提示可见" : "编辑器可见");
+	} else if (body.includes("404")) {
+		bad("申请页内容", "404");
+	} else {
+		bad("申请页内容", "无编辑器/加载提示");
+	}
+}
+
+async function testFlowTime(page) {
+	const applyid = execSync(
+		`/opt/homebrew/bin/mysql -h10.0.42.6 -P3306 -uroot -p'Hxxy@Mysql2026' -NBe "SELECT applyid FROM sp_gzhx_apps.apply ORDER BY applyid DESC LIMIT 1;" 2>/dev/null`,
+		{ encoding: "utf8" }
+	).trim();
+	const auditid = execSync(
+		`/opt/homebrew/bin/mysql -h10.0.42.6 -P3306 -uroot -p'Hxxy@Mysql2026' -NBe "SELECT auditid FROM sp_gzhx_apps.audit WHERE applyid=${applyid} LIMIT 1;" 2>/dev/null`,
+		{ encoding: "utf8" }
+	).trim();
+	if (!applyid || !auditid) { bad("流程时间线 DB", "无 apply/audit"); return; }
+	ok("DB apply/audit", `apply=${applyid} audit=${auditid}`);
+
+	await page.goto(`${BASE}/app/flow/time/?auditid=${auditid}&applyid=${applyid}`, {
+		waitUntil: "networkidle", timeout: 60000,
+	});
+	await page.waitForTimeout(2000);
+	const html = await page.content();
+	if (html.includes("登录信息已过期")) { bad("流程时间线", "会话过期"); return; }
+	if (html.includes("404") && html.includes("页面不存在")) { bad("流程时间线", "404 页面"); return; }
+	if (html.includes("process-path") || html.includes("el-timeline") || html.includes("流程图")) {
+		ok("流程时间线", "时间线/流程图组件已渲染");
+	} else {
+		bad("流程时间线", html.slice(0, 200).replace(/\s+/g, " "));
+	}
+}
+
+async function main() {
+	console.log("=== hxcs 流程验证 ===", new Date().toISOString());
+	const disp = execSync(`curl -s "${BASE}/apps/space/js/space.display.js"`, { encoding: "utf8" });
+	if (disp.includes("getSpaceIndex")) ok("space.display.js", "含 getSpaceIndex");
+	else bad("space.display.js", "缺 getSpaceIndex");
+
+	const browser = await chromium.launch({ headless: true });
+	const page = await browser.newPage();
+	try {
+		await login(page);
+		await testApplyPopup(page);
+		await testFlowTime(page);
+	} catch (e) {
+		bad("验证异常", e.message);
+	}
+	await browser.close();
+	const pass = R.filter((x) => x.ok).length;
+	console.log(`\n=== ${pass}/${R.length} 通过 ===`);
+	R.filter((x) => !x.ok).forEach((x) => console.log(`  ✗ ${x.n}: ${x.d}`));
+	process.exit(R.some((x) => !x.ok) ? 1 : 0);
+}
+
+main().catch((e) => { console.error(e); process.exit(1); });

+ 54 - 0
local-run/bin/vpn-keepalive-hxcs.sh

@@ -0,0 +1,54 @@
+#!/usr/bin/env bash
+# hxcs 生产 VPN 保活:每分钟探测内网,防止隧道空闲断开;连通后自动执行流程修复(仅一次)
+set -uo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+FIX_SCRIPT="${SCRIPT_DIR}/fix-hxcs-flow-slow-spin.sh"
+LOG="${VPN_KEEPALIVE_LOG:-/tmp/vpn-keepalive-hxcs.log}"
+INTERVAL="${VPN_KEEPALIVE_INTERVAL:-60}"
+MYSQL_HOST="${HXCS_MYSQL_HOST:-10.0.42.6}"
+SSH_HOST="${HXCS_SSH_HOST:-10.0.42.5}"
+FIX_DONE_FLAG="/tmp/hxcs-flow-fix-done"
+
+log() { printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*" | tee -a "$LOG"; }
+
+probe() {
+  nc -z -G 3 "${MYSQL_HOST}" 3306 >/dev/null 2>&1
+}
+
+ensure_atrust_running() {
+  if ! pgrep -x aTrust >/dev/null 2>&1; then
+    log "aTrust 未运行,尝试拉起客户端"
+    open -ga aTrust 2>/dev/null || true
+  fi
+}
+
+run_fix_once() {
+  if [[ -f "${FIX_DONE_FLAG}" ]]; then
+    return 0
+  fi
+  log "内网已通,后台执行流程修复..."
+  (
+    if bash "${FIX_SCRIPT}" >>"$LOG" 2>&1; then
+      touch "${FIX_DONE_FLAG}"
+      log "流程修复完成,已标记 done"
+    else
+      log "流程修复失败,下次连通时重试"
+    fi
+  ) &
+}
+
+log "VPN 保活启动 interval=${INTERVAL}s mysql=${MYSQL_HOST}:3306 ssh=${SSH_HOST}:22"
+
+while true; do
+  ensure_atrust_running
+  if probe; then
+    log "OK  ${MYSQL_HOST}:3306 可达"
+    run_fix_once
+  else
+    log "FAIL ${MYSQL_HOST}:3306 不可达(保活探测)"
+  fi
+  # 顺带探测 SSH,维持到外网跳板流量
+  nc -z -G 3 "${SSH_HOST}" 22 >/dev/null 2>&1 || true
+  sleep "${INTERVAL}"
+done

+ 1 - 4
src/space/apps/moudules/website/services/ArticleService.java

@@ -407,10 +407,7 @@ public class ArticleService extends BaseTransaction {
      * @log 2020年9月26日
      */
     private WebsiteNavigation getWebsiteNavigationById(GeneralDBAccess gdba, Long navigationId) throws Exception {
-        WebsiteNavigation wn = new WebsiteNavigation();
-        wn.setNavigationid(navigationId);
-        gdba.selectById(wn);
-        return wn;
+        return WebsiteTemplateNavUtil.selectNavigationById(gdba, navigationId);
     }
 
     private WebsiteNavigation getArticleTargetNavigation(GeneralDBAccess gdba, Long navigationId, String targetName)

+ 53 - 12
src/space/apps/moudules/website/services/flow/ArticleFlowService.java

@@ -76,10 +76,18 @@ public class ArticleFlowService extends BaseTransaction {
 	 * @log 2020年10月11日
 	 */
 	private Article getArticleById(GeneralDBAccess gdba, Long articleid) throws Exception {
-		Article article = new Article();
-		article.setArticleid(articleid);
-		gdba.selectById(article);
-		return article;
+		// 显式列查询:生产 article 表含 guest_access_flag,但 apps.pojo.Article 未同步该字段
+		String sql = "SELECT articleid, dcode, title, `desc`, navigationid, unitid, websiteid, ascode,"
+				+ " create_pid, last_change_pid, create_time, last_change_time, content, edit_content,"
+				+ " source, thumbnail, sticktop, `release`, url, read_count, ajtcode"
+				+ " FROM article WHERE articleid = :articleid";
+		SqlCommandImpl sqlCmd = new SqlCommandImpl(sql);
+		sqlCmd.setString("articleid", articleid);
+		List<Article> list = gdba.selectAsList(sqlCmd, Article.class);
+		if (list == null || list.isEmpty()) {
+			throw new Exception("文章不存在");
+		}
+		return list.get(0);
 	}
 	
 	/**
@@ -296,30 +304,63 @@ public class ArticleFlowService extends BaseTransaction {
 	public String startArticleProcess() throws Exception {
 		
 		try {
+			if (getAppUser() == null) {
+				throw new Exception("登录会话已失效,请重新登录");
+			}
 			GeneralDBAccess gdba = getGdbaInstance();
 			StartProcess startProcess = getStartProcess();
 			
-			Article article = new Article();
-			article.setArticleid(startProcess.getId());
-			gdba.selectById(article);
+			Article article = getArticleById(gdba, startProcess.getId());
 			startProcess.setTitle(article.getTitle());
 			
 			Department department = getAppUser().getDepartment();
-			verifyDepartmentChargePerson(gdba, article, department.getName(), department.getDepartmentid());
-			verifyNavigationPerson(gdba, article);
+			if (department == null && getAppUser().getPerson() != null
+					&& getAppUser().getPerson().getDepartmentid() != null) {
+				department = new Department();
+				department.setDepartmentid(getAppUser().getPerson().getDepartmentid());
+				gdba.selectById(department);
+			}
+			if (department == null) {
+				throw new Exception("当前登录用户未关联部门,无法发起流程");
+			}
+			try {
+				verifyDepartmentChargePerson(gdba, article, department.getName(), department.getDepartmentid());
+				verifyNavigationPerson(gdba, article);
+			} catch (Exception e) {
+				throw new Exception("流程前置校验失败:" + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()));
+			}
 			
 			Map<String, String> dcodeMap = new HashMap<String, String>();
+			dcodeMap.put(Article.class.getName(), "dcode");
 			dcodeMap.put(ArticleCopy.class.getName(), "dcode");
 			
-			BpmProcessUtil.startProcess(getWebApp(), startProcess.getTitle(), "articleRelease", getAppUser(), article, 
-					gdba, startProcess.getDescribe(), dcodeMap);
+			try {
+				// 草稿 dcode=21 时 BpmProcessPageBeanUtil 无法自动推断 startType,需显式指定 add
+				BpmProcessUtil.startProcess(getWebApp(), startProcess.getTitle(), "articleRelease", getAppUser(), article,
+						gdba, startProcess.getDescribe(), dcodeMap, "add", null);
+			} catch (Exception e) {
+				throw new Exception("BPM启动失败:" + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName()));
+			}
+
+			// 录入(11)/待提交(12) 发起时 BpmProcessPageBeanUtil 只会写成 21,父列表仍显示可再次申请;统一落为审核中(31)
+			article = getArticleById(gdba, startProcess.getId());
+			if (!Long.valueOf(dataStatusCode.USE_AUDIT.getCode()).equals(article.getDcode())) {
+				article.setDcode(dataStatusCode.USE_AUDIT.getCode());
+				Set<String> dcodeFields = new HashSet<String>();
+				dcodeFields.add("dcode");
+				gdba.updateById(article, dcodeFields);
+			}
 			
 			gdba.commit();
 			
 			setResponsePackage(getResponseSuccessMsgPackage("发起成功"));
 		} catch (Exception e) {
 			e.printStackTrace();
-			setResponsePackage(getResponseErrorMsgPackage("发起失败:" + e.getMessage()));
+			String errMsg = e.getMessage();
+			if (errMsg == null || errMsg.trim().isEmpty()) {
+				errMsg = e.getClass().getSimpleName();
+			}
+			setResponsePackage(getResponseErrorMsgPackage("发起失败:" + errMsg));
 		}
 		
 		return DEFAULT_FORWARD;

+ 17 - 6
src/space/apps/moudules/website/template/util/WebsiteTemplateNavUtil.java

@@ -518,9 +518,7 @@ public class WebsiteTemplateNavUtil {
 	 */
 	public static List<WebsiteNavigation> getNavParentList(GeneralDBAccess gdba, Long navID) throws Exception {
 
-		WebsiteNavigation wn = new WebsiteNavigation();
-		wn.setNavigationid(navID);
-		gdba.selectById(wn);
+		WebsiteNavigation wn = selectNavigationById(gdba, navID);
 
 		List<WebsiteNavigation> wnList = new ArrayList<WebsiteNavigation>();
 		wnList.add(wn);
@@ -536,6 +534,21 @@ public class WebsiteTemplateNavUtil {
 		return wnList;
 	}
 
+	/** 显式列查询:生产表含 guest_access_flag,apps.pojo.WebsiteNavigation 未同步 */
+	public static WebsiteNavigation selectNavigationById(GeneralDBAccess gdba, Long navID) throws Exception {
+		String sql = "SELECT navigationid, dcode, unitid, wnccode, websiteid, wtid, idcard, name, name_assistant,"
+				+ " title, `desc`, wntcode, wnscode, wnjtcode, wnlscode, uri, url, jump_url, jump_websiteid,"
+				+ " parent_nid, photo_size_width, photo_size_height, background_image, sort_number,"
+				+ " create_time, create_pid, id_code FROM website_navigation WHERE navigationid = :navigationid";
+		SqlCommandImpl sqlCmd = new SqlCommandImpl(sql);
+		sqlCmd.setString("navigationid", navID);
+		List<WebsiteNavigation> list = gdba.selectAsList(sqlCmd, WebsiteNavigation.class);
+		if (list == null || list.isEmpty()) {
+			throw new Exception("栏目不存在");
+		}
+		return list.get(0);
+	}
+
 	/**
 	 * 递归获取上级栏目
 	 * 
@@ -548,9 +561,7 @@ public class WebsiteTemplateNavUtil {
 	 */
 	static void getParentNavByID(GeneralDBAccess gdba, List<WebsiteNavigation> wnList, Long navId) throws Exception {
 
-		WebsiteNavigation wn = new WebsiteNavigation();
-		wn.setNavigationid(navId);
-		gdba.selectById(wn);
+		WebsiteNavigation wn = selectNavigationById(gdba, navId);
 
 		String navigationHref = getNavigationHref(gdba, wn);
 		wn.setUrl(navigationHref);