档案培训如何成为企业发展的隐形引擎?从合规到创新,一文读懂其战略价值
在数字化浪潮席卷各行各业的今天,企业竞争已深入到数据与知识的层面。许多人将档案管理视为简单的文件存储,却忽略了其背后巨大的战略潜能。事实上,一套专业、系统的档案培训,正是激活这种潜能、驱动企业稳健发展...
2026年08月29日 15:30:18
先梳理企业规范的通用必填项,再准备100%可用的开源工具:
sudo apt updatesudo apt install -y ca-certificates curl gnupg lsb-releasesudo mkdir -m 0755 -p /etc/apt/keyringscurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpgecho \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt updatesudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginsudo docker run hello-world
新建一个名为onlyoffice-archive的文件夹,进入后新建docker-compose.yml,粘贴完整配置:
version: '3.7'
services:
onlyoffice-community-server:
image: onlyoffice/communityserver:12.1.0.1760
container_name: onlyoffice-archive
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./data:/var/www/onlyoffice/Data
- ./logs:/var/log/onlyoffice
environment:
- ONLYOFFICE_LICENSE=FREE
- ONLYOFFICE_DB_TYPE=POSTGRESQL
- POSTGRESQL_SERVER_HOST=onlyoffice-postgres
- POSTGRESQL_SERVER_PORT=5432
- POSTGRESQL_SERVER_DB_NAME=onlyoffice
- POSTGRESQL_SERVER_USER=onlyoffice
- POSTGRESQL_SERVER_PASSWORD=archive123456
onlyoffice-postgres:
image: postgres:14-alpine
container_name: onlyoffice-postgres
restart: always
volumes:
- ./postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_PASSWORD=archive123456
onlyoffice-archive文件夹,执行sudo docker-compose up -d(Windows/Mac不需要sudo)http://localhost查看是否进入登录页(如果是服务器,替换成服务器公网IP)在onlyoffice-archive文件夹下新建archive_reminder.py,粘贴完整代码:
import requests
from datetime import datetime, timedelta
配置部分(根据实际修改)
PORTAL_URL = "http://localhost"
ADMIN_EMAIL = "your-admin-email@example.com"
ADMIN_PASSWORD = "your-admin-password"
REMIND_BEFORE_DAYS = 7 提前7天提醒
SMTP_SERVER = "smtp.example.com" 仅需发送邮件时配置
SMTP_PORT = 587
SMTP_USER = "your-sender-email@example.com"
SMTP_PASSWORD = "your-sender-password"
RECIPIENT_EMAILS = ["admin@example.com", "department-head@example.com"]
获取管理员Token
def get_token():
url = f"{PORTAL_URL}/api/2.0/authentication.json"
data = {"email": ADMIN_EMAIL, "password": ADMIN_PASSWORD}
response = requests.post(url, json=data)
return response.json()["response"]["token"]
获取所有带到期日期的档案
def get_expiring_files(token):
url = f"{PORTAL_URL}/api/2.0/files.json"
headers = {"Authorization": f"Bearer {token}"}
params = {"filter": "customFields"}
response = requests.get(url, headers=headers, params=params)
files = response.json()["response"]
expiring_files = []
today = datetime.now().date()
remind_date = today + timedelta(days=REMIND_BEFORE_DAYS)
for file in files:
custom_fields = file.get("customFields", [])
expiry_date_str = None
file_code = None
for field in custom_fields:
if field["label"] == "到期日期":
expiry_date_str = field["value"]
elif field["label"] == "档案编号":
file_code = field["value"]
if expiry_date_str:
try:
expiry_date = datetime.strptime(expiry_date_str, "%Y-%m-%d").date()
if remind_date >= expiry_date >= today:
expiring_files.append({
"name": file["title"],
"code": file_code,
"expiry_date": expiry_date_str,
"link": f"{PORTAL_URL}/Products/Files/DocEditor.aspx?fileId={file['id']}"
})
except ValueError:
continue
return expiring_files
主函数
if __name__ == "__main__":
token = get_token()
expiring_files = get_expiring_files(token)
if expiring_files:
print("即将到期的档案:")
for file in expiring_files:
print(f"编号:{file['code']} | 名称:{file['name']} | 到期日:{file['expiry_date']} | 链接:{file['link']}")
如需发送邮件,可取消以下代码注释
import smtplib
from email.mime.text import MIMEText
subject = f"档案到期提醒({REMIND_BEFORE_DAYS}天内)"
content = "\n".join([f"- {f['code']}:{f['name']},到期日:{f['expiry_date']},链接:{f['link']}" for f in expiring_files])
msg = MIMEText(content, "plain", "utf-8")
msg["Subject"] = subject
msg["From"] = SMTP_USER
msg["To"] = ",".join(RECIPIENT_EMAILS)
with smtplib.SMTP(SMTP_SERVER, SMTP_PORT) as server:
server.starttls()
server.login(SMTP_USER, SMTP_PASSWORD)
server.sendmail(SMTP_USER, RECIPIENT_EMAILS, msg.as_string())
python.exe C:\onlyoffice-archive\archive_reminder.pycrontab -e,添加0 9 /usr/bin/python3 /root/onlyoffice-archive/archive_reminder.py(路径根据实际修改)