- 后端新增 app/lib/productImport.js:模板列定义(含表头别名)、xlsx 解析、行校验、金额解析 - 新增 GET /api/products/import-template(下载仅含表头的模板) - 新增 POST /api/products/import:同主体下商品编码已存在则更新(空单元格不覆盖原值, 软删除的会恢复),否则新建;文件内重复编码按最后一行处理;未知列在结果中返回 - 导入结果返回 total/created/updated/restored/failed/duplicated/errors/ignored_columns, 并写入操作日志、对更新的商品触发待审核订单明细重算 - multipart 白名单增加 .xlsx - 前端商品页新增「批量导入」:下载模板、选择 xlsx、展示导入结果与失败明细 - .eslintrc 为 config 目录放开 no-restricted-modules(config 需要 path 等核心模块) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
42 lines
790 B
Plaintext
42 lines
790 B
Plaintext
{
|
|
"extends": "eslint-config-egg",
|
|
"rules": {
|
|
"jsdoc/check-tag-names": [
|
|
"warn",
|
|
{
|
|
"definedTags": [ "controller", "router", "request", "response", "apikey" ]
|
|
}
|
|
]
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": [ "scripts/**/*.js" ],
|
|
"rules": {
|
|
"no-restricted-modules": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": [ "app/lib/**/*.js" ],
|
|
"rules": {
|
|
"no-restricted-modules": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": [ "config/**/*.js" ],
|
|
"rules": {
|
|
"no-restricted-modules": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"app/controller/exportTask.js",
|
|
"app/service/exportTask.js",
|
|
"app/schedule/cleanupExport.js"
|
|
],
|
|
"rules": {
|
|
"no-restricted-modules": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|