{
+ const source = read('NotificationDetail')
+ assert.match(source, /\{\{ plan.body \}\}<\/pre>/)
+ assert.doesNotMatch(source, /v-html|el-dialog/)
+ assert.match(source, /确认发送邮件/)
+ assert.match(source, /previewToken: plan.value.previewToken/)
+ assert.match(source, /retryConfirmed/)
+ assert.match(source, /onBeforeUnmount\(\(\) => \{ generation\+\+; clearTimeout\(timer\)/)
+})
+test('roles use current membership and auto-send has a clear opt-in warning', () => {
+ const source = read('NotificationSettings')
+ assert.match(source, /roleIds: item.roleIds/)
+ assert.match(source, /管理员预览后发送/)
+ assert.match(source, /保存即允许此模块的新反馈自动通知/)
+ assert.match(source, /不会补发历史反馈/)
+ assert.match(source, /只有管理员可查看全部反馈/)
+})
diff --git a/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs b/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs
index 1d41fe1..e7ff4ef 100644
--- a/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs
+++ b/ruoyi-ui-vue3/tests/unit/purchase-project.test.mjs
@@ -35,6 +35,7 @@ test('both procurement screens expose a common project while retaining mixed-his
const native=fs.readFileSync(new URL('../../src/components/PurchaseSheet/index.vue',import.meta.url),'utf8')
assert.match(native,/批次所属项目/);assert.match(native,/历史多项目批次/);assert.match(native,/this\.batchProject\.mixed/);assert.match(native,/row\.projectId=this\.batchProject\.value/)
assert.match(native,/this\.commonProject=this\.projectId\|\|null;this\.sheet=null/)
+ assert.ok(native.indexOf('更正已有物品的类别将在保存时同步修改物品档案')>native.indexOf('class="sheet-selection"'),'Correction notice belongs to the detail editor, not the batch list')
const ai=fs.readFileSync(new URL('../../src/components/BusinessAssistant/AssistantDraft.vue',import.meta.url),'utf8')
assert.match(ai,/assistant-purchase-project/);assert.match(ai,/purchaseDraftBatchCount\(props\.rows\) <= 1/);assert.match(ai,/!sharedProject\.value \|\| field\.key !== 'projectId'/)
})
diff --git a/scripts/deploy/mail.env.example b/scripts/deploy/mail.env.example
new file mode 100644
index 0000000..9eb3d3a
--- /dev/null
+++ b/scripts/deploy/mail.env.example
@@ -0,0 +1,16 @@
+# Spring Boot 3.5 / Jakarta Mail; never reuse javax.mail dependencies.
+MAIL_HOST=smtp.qq.com
+MAIL_PORT=587
+MAIL_USERNAME=
+MAIL_PASSWORD=
+MAIL_ENABLED=false
+# Apply sql/projectdev/20261016_feedback_mail.sql to the intended environment first.
+# This migration currently guards cmvr-project-dev; production is intentionally not enabled.
+FEEDBACK_NOTIFICATION_ENABLED=false
+FEEDBACK_NOTIFICATION_ENV=dev
+NOTIFICATION_CENTER_ENABLED=false
+# Initialize sql/projectdev/20261016_notification_center.sql in the dev database before enabling.
+# NotificationGateway and NotificationPolicy live in ruoyi-common; implementations live in ruoyi-system.
+# New business sources register a NotificationPolicy bean; unregistered sources are denied.
+# Admin: User feedback -> Notification settings -> choose roles per module.
+# Default is manual preview/send. Role membership never grants additional data access.
diff --git a/scripts/deploy/minio-dev-secrets.properties.example b/scripts/deploy/minio-dev-secrets.properties.example
new file mode 100644
index 0000000..462b60b
--- /dev/null
+++ b/scripts/deploy/minio-dev-secrets.properties.example
@@ -0,0 +1,8 @@
+# Development only. Copy to .codex-tmp/minio-dev-secrets.properties (Git ignored),
+# or supply MINIO_ACCESS_KEY and MINIO_SECRET_KEY in the process environment.
+# Never put real credentials in this example or application*.yml.
+minio.access-key=
+minio.secret-key=
+# application-druid.yml enforces bucket cmvr-wms-dev.
+# application-prod.yml enforces bucket cmvr-wms-prod, using the server EnvironmentFile.
+# The existing cmvr-iot bucket is not used or modified.
diff --git a/scripts/deploy/production.env.example b/scripts/deploy/production.env.example
index b1b092f..da975d5 100644
--- a/scripts/deploy/production.env.example
+++ b/scripts/deploy/production.env.example
@@ -12,3 +12,7 @@ PROD_BIND_ADDRESS=127.0.0.1
PROD_BACKEND_PORT=8182
PROD_UPLOAD_PATH=/app/uploads
RUOYI_LOG_PATH=/app/logs
+MINIO_ENABLED=true
+MINIO_URL=http://192.168.28.10:9000
+MINIO_ACCESS_KEY=
+MINIO_SECRET_KEY=
diff --git a/sql/projectdev/20261016_feedback_mail.sql b/sql/projectdev/20261016_feedback_mail.sql
new file mode 100644
index 0000000..1f561c8
--- /dev/null
+++ b/sql/projectdev/20261016_feedback_mail.sql
@@ -0,0 +1,34 @@
+-- target-database: cmvr-project-dev
+-- Additive only. Role membership, collaboration tables and existing feedback are unchanged.
+CREATE TABLE IF NOT EXISTS sys_feedback_notify_route (
+ module varchar(24) CHARACTER SET ascii COLLATE ascii_bin NOT NULL PRIMARY KEY,
+ role_ids_json varchar(1000) NOT NULL DEFAULT '[]',
+ auto_send tinyint NOT NULL DEFAULT 0,
+ version int NOT NULL DEFAULT 0,
+ update_by varchar(64) NOT NULL,
+ update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS sys_feedback_notification (
+ feedback_id bigint NOT NULL PRIMARY KEY,
+ module varchar(24) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT 'UNCLASSIFIED',
+ confidence decimal(5,4) NOT NULL DEFAULT 0,
+ reason varchar(600) NOT NULL DEFAULT '',
+ analysis_state varchar(16) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT 'PENDING',
+ mail_state varchar(16) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT 'REVIEW',
+ recipients_json text NULL,
+ subject varchar(240) NULL,
+ body text NULL,
+ route_version int NULL,
+ version int NOT NULL DEFAULT 0,
+ attempt_count int NOT NULL DEFAULT 0,
+ lease_token char(36) CHARACTER SET ascii COLLATE ascii_bin NULL,
+ locked_at datetime NULL,
+ sent_at datetime NULL,
+ last_error varchar(300) NOT NULL DEFAULT '',
+ create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ KEY idx_feedback_notify_analysis (analysis_state,create_time),
+ KEY idx_feedback_notify_mail (mail_state,update_time),
+ CONSTRAINT fk_feedback_notify_parent FOREIGN KEY(feedback_id) REFERENCES sys_feedback(id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/sql/projectdev/20261016_notification_center.sql b/sql/projectdev/20261016_notification_center.sql
new file mode 100644
index 0000000..c636f9f
--- /dev/null
+++ b/sql/projectdev/20261016_notification_center.sql
@@ -0,0 +1,34 @@
+-- target-database: cmvr-project-dev
+-- Additive independent notification tables; no collaboration/announcement/feedback data changes.
+CREATE TABLE IF NOT EXISTS sys_notification_event (
+ id char(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL PRIMARY KEY,
+ business_type varchar(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ business_id varchar(100) NOT NULL,
+ event_key varchar(128) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ fingerprint char(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ command_json mediumtext NOT NULL,
+ create_user_id bigint NULL,
+ create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE KEY uk_notification_event (business_type,event_key)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+CREATE TABLE IF NOT EXISTS sys_notification_delivery (
+ id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ event_id char(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ user_id bigint NOT NULL,
+ channel varchar(8) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ state varchar(16) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
+ recipient_email varchar(254) NOT NULL DEFAULT '',
+ version int NOT NULL DEFAULT 0,
+ attempts int NOT NULL DEFAULT 0,
+ lease_token char(32) CHARACTER SET ascii COLLATE ascii_bin NULL,
+ locked_at datetime NULL,
+ delivered_at datetime NULL,
+ read_at datetime NULL,
+ last_error varchar(300) NOT NULL DEFAULT '',
+ create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE KEY uk_notification_recipient (event_id,user_id,channel),
+ KEY idx_notification_mail (channel,state,id),
+ KEY idx_notification_inbox (user_id,channel,read_at,id),
+ CONSTRAINT fk_notification_event FOREIGN KEY (event_id) REFERENCES sys_notification_event(id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;