You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
3.6 KiB
30 lines
3.6 KiB
/**
|
|
* 文件作用:注册财务发票判重模块的 HTTP 路由。
|
|
* 职责范围:将上传、查询、确认入库、台账和统计请求分发到控制器。
|
|
* 不负责:具体的 OCR、数据库事务与权限规则实现。
|
|
*/
|
|
'use strict';
|
|
|
|
const financeInvoice = require('../controllers/financeInvoice');
|
|
const financeInvoiceAuth = require('../middlewares/financeInvoiceAuth');
|
|
|
|
module.exports = function (app, router) {
|
|
const { middlewares: { auth, resolveExternalUserId } } = app;
|
|
router.post('/finance-invoices/uploads', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.createUploadBatch, { content: '上传并识别发票', visible: true });
|
|
router.get('/finance-invoices/uploads/:batchId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getUploadBatch, { content: '获取发票上传结果', visible: true });
|
|
router.post('/finance-invoices/uploads/:batchId/re-recognize', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.reRecognizeUploadBatch, { content: '重新识别发票上传批次', visible: true });
|
|
router.put('/finance-invoices/uploads/:batchId/items/:itemId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.updateUploadItem, { content: '修正发票识别信息', visible: true });
|
|
router.delete('/finance-invoices/uploads/:batchId/items/:itemId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.deleteUploadItem, { content: '删除发票识别结果', visible: true });
|
|
router.post('/finance-invoices/uploads/:batchId/confirm', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.confirmUploadBatch, { content: '确认发票入库', visible: true });
|
|
// 普通登录用户可进行判重查询;不要求财务上传权限,以便按用户归属统计调用量。
|
|
router.post('/finance-invoices/check', auth, resolveExternalUserId, financeInvoice.checkInvoice, { content: '查询发票是否重复', visible: true });
|
|
router.get('/finance-invoices/records', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getRecords, { content: '获取发票台账', visible: true });
|
|
router.put('/finance-invoices/records/batch-reimbursement', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.updateBatchReimbursement, { content: '批量修改发票报销人', visible: true });
|
|
router.get('/finance-invoices/records/upload/:uploadItemId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getUploadRecordDetail, { content: '获取上传发票详情', visible: true });
|
|
router.put('/finance-invoices/records/:recordType/:recordId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.updateLedgerRecord, { content: '保存台账发票详情', visible: true });
|
|
router.get('/finance-invoices/records/:invoiceId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getRecordDetail, { content: '获取发票详情', visible: true });
|
|
router.get('/finance-invoices/duplicates', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getDuplicates, { content: '获取发票拦截记录', visible: true });
|
|
router.get('/finance-invoices/duplicates/:duplicateId', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getDuplicateDetail, { content: '获取发票拦截详情', visible: true });
|
|
router.get('/finance-invoices/dashboard', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.getDashboard, { content: '获取发票判重仪表盘', visible: true });
|
|
router.get('/finance-invoices/export', auth, resolveExternalUserId, financeInvoiceAuth, financeInvoice.exportRecordsToExcel, { content: '导出发票台账为 Excel', visible: true });
|
|
};
|
|
|