feat: 完成全部11项优化需求 + 模板必填项标注 + 归档重算个税

- 高优先级: 花名册导入模板必填项标注、性别自动识别、导入结果反馈、证据链Excel导出、身份证搜索修复、试用期区分与转正提醒、薪税批次流程优化
- 中优先级: 专项附加扣除批量导入、文本模板库完善(Word下载/复制/使用说明)、用工体检评分标准说明、考勤页面导入入口
- 所有导入模板表头标注必填项(*后缀)并含示例行
- 导入逻辑统一改用getField兼容*后缀列名
- 批次归档时强制重算所有条目个税和社保,解决多未归档批次并存时累计计算不准问题
- 更新需求梳理文档
This commit is contained in:
freedakgmail
2026-07-29 19:08:45 +08:00
parent 7c24ebe3d9
commit 0372cbe243
14 changed files with 1275 additions and 171 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ import { Request, Response, NextFunction } from 'express'
import { verifyAccessToken } from '../lib/jwt'
export interface AuthRequest extends Request {
user?: { id: string; orgId: string | null; role: string }
orgId?: string | null
user?: { id: string; orgId: string; role: string }
orgId?: string
}
export function authMiddleware(req: AuthRequest, res: Response, next: NextFunction) {
@@ -16,7 +16,7 @@ export function authMiddleware(req: AuthRequest, res: Response, next: NextFuncti
if (!payload) {
return res.status(401).json({ success: false, error: { code: 'TOKEN_INVALID', message: '令牌无效或已过期' } })
}
req.user = payload
req.user = { id: payload.id, orgId: payload.orgId || '', role: payload.role }
// 非 SUPER_ADMIN 用户必须有 orgId,否则企业端 API 会因 orgId=null 报错
if (payload.role !== 'SUPER_ADMIN' && !payload.orgId) {
return res.status(403).json({ success: false, error: { code: 'NO_ORG', message: '该账号未绑定企业' } })