完善保险端前后端和养殖端小程序
This commit is contained in:
259
insurance_backend/routes/installationTasks.js
Normal file
259
insurance_backend/routes/installationTasks.js
Normal file
@@ -0,0 +1,259 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const installationTaskController = require('../controllers/installationTaskController');
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* tags:
|
||||
* name: InstallationTasks
|
||||
* description: 待安装任务管理
|
||||
*/
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks:
|
||||
* get:
|
||||
* summary: 获取待安装任务列表
|
||||
* tags: [InstallationTasks]
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: page
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 1
|
||||
* description: 页码
|
||||
* - in: query
|
||||
* name: limit
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 10
|
||||
* description: 每页数量
|
||||
* - in: query
|
||||
* name: policyNumber
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 保单编号搜索
|
||||
* - in: query
|
||||
* name: customerName
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 客户姓名搜索
|
||||
* - in: query
|
||||
* name: keyword
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 关键字搜索
|
||||
* - in: query
|
||||
* name: installationStatus
|
||||
* schema:
|
||||
* type: string
|
||||
* enum: [待安装, 安装中, 已安装, 安装失败, 已取消]
|
||||
* description: 安装状态筛选
|
||||
* - in: query
|
||||
* name: priority
|
||||
* schema:
|
||||
* type: string
|
||||
* enum: [低, 中, 高, 紧急]
|
||||
* description: 优先级筛选
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/', installationTaskController.getInstallationTasks);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks:
|
||||
* post:
|
||||
* summary: 创建待安装任务
|
||||
* tags: [InstallationTasks]
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - applicationNumber
|
||||
* - policyNumber
|
||||
* - productName
|
||||
* - customerName
|
||||
* properties:
|
||||
* applicationNumber:
|
||||
* type: string
|
||||
* description: 申请单号
|
||||
* policyNumber:
|
||||
* type: string
|
||||
* description: 保单编号
|
||||
* productName:
|
||||
* type: string
|
||||
* description: 产品名称
|
||||
* customerName:
|
||||
* type: string
|
||||
* description: 客户姓名
|
||||
* idType:
|
||||
* type: string
|
||||
* enum: [身份证, 护照, 军官证, 士兵证, 港澳台居民居住证, 其他]
|
||||
* description: 证件类型
|
||||
* idNumber:
|
||||
* type: string
|
||||
* description: 证件号码
|
||||
* livestockSupplyType:
|
||||
* type: string
|
||||
* description: 养殖生资种类
|
||||
* pendingDevices:
|
||||
* type: array
|
||||
* description: 待安装设备
|
||||
* priority:
|
||||
* type: string
|
||||
* enum: [低, 中, 高, 紧急]
|
||||
* description: 优先级
|
||||
* assignedTo:
|
||||
* type: integer
|
||||
* description: 分配给用户ID
|
||||
* responses:
|
||||
* 201:
|
||||
* description: 创建成功
|
||||
*/
|
||||
router.post('/', installationTaskController.createInstallationTask);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/{id}:
|
||||
* get:
|
||||
* summary: 获取待安装任务详情
|
||||
* tags: [InstallationTasks]
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 任务ID
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/:id', installationTaskController.getInstallationTaskById);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/{id}:
|
||||
* put:
|
||||
* summary: 更新待安装任务
|
||||
* tags: [InstallationTasks]
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 任务ID
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* installationStatus:
|
||||
* type: string
|
||||
* enum: [待安装, 安装中, 已安装, 安装失败, 已取消]
|
||||
* priority:
|
||||
* type: string
|
||||
* enum: [低, 中, 高, 紧急]
|
||||
* assignedTo:
|
||||
* type: integer
|
||||
* installationCompletedAt:
|
||||
* type: string
|
||||
* format: date-time
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 更新成功
|
||||
*/
|
||||
router.put('/:id', installationTaskController.updateInstallationTask);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/{id}:
|
||||
* delete:
|
||||
* summary: 删除待安装任务
|
||||
* tags: [InstallationTasks]
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 任务ID
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 删除成功
|
||||
*/
|
||||
router.delete('/:id', installationTaskController.deleteInstallationTask);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/batch/operate:
|
||||
* post:
|
||||
* summary: 批量操作待安装任务
|
||||
* tags: [InstallationTasks]
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - ids
|
||||
* - operation
|
||||
* properties:
|
||||
* ids:
|
||||
* type: array
|
||||
* items:
|
||||
* type: integer
|
||||
* description: 任务ID数组
|
||||
* operation:
|
||||
* type: string
|
||||
* enum: [assign, updateStatus, delete]
|
||||
* description: 操作类型
|
||||
* data:
|
||||
* type: object
|
||||
* description: 操作数据
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 操作成功
|
||||
*/
|
||||
router.post('/batch/operate', installationTaskController.batchOperateInstallationTasks);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/export:
|
||||
* get:
|
||||
* summary: 导出待安装任务数据
|
||||
* tags: [InstallationTasks]
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: ids
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 任务ID列表(逗号分隔)
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 导出成功
|
||||
*/
|
||||
router.get('/export', installationTaskController.exportInstallationTasks);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/installation-tasks/stats:
|
||||
* get:
|
||||
* summary: 获取安装任务统计数据
|
||||
* tags: [InstallationTasks]
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/stats', installationTaskController.getInstallationTaskStats);
|
||||
|
||||
module.exports = router;
|
||||
266
insurance_backend/routes/supervisoryTasks.js
Normal file
266
insurance_backend/routes/supervisoryTasks.js
Normal file
@@ -0,0 +1,266 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const SupervisoryTaskController = require('../controllers/supervisoryTaskController');
|
||||
const auth = require('../middleware/auth');
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* tags:
|
||||
* name: SupervisionTasks
|
||||
* description: 监管任务管理
|
||||
*/
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks:
|
||||
* get:
|
||||
* summary: 获取监管任务列表
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: page
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 1
|
||||
* description: 页码
|
||||
* - in: query
|
||||
* name: pageSize
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 10
|
||||
* description: 每页数量
|
||||
* - in: query
|
||||
* name: status
|
||||
* schema:
|
||||
* type: string
|
||||
* enum: [pending, processing, completed, rejected]
|
||||
* description: 状态筛选
|
||||
* - in: query
|
||||
* name: taskType
|
||||
* schema:
|
||||
* type: string
|
||||
* enum: [new_application, task_guidance, batch_operation]
|
||||
* description: 任务类型筛选
|
||||
* - in: query
|
||||
* name: applicationId
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 申请单号搜索
|
||||
* - in: query
|
||||
* name: policyId
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 保单编号搜索
|
||||
* - in: query
|
||||
* name: customerName
|
||||
* schema:
|
||||
* type: string
|
||||
* description: 客户姓名搜索
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/', SupervisoryTaskController.getList);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks:
|
||||
* post:
|
||||
* summary: 创建监管任务
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - applicationId
|
||||
* - policyId
|
||||
* - productName
|
||||
* - customerName
|
||||
* - taskType
|
||||
* properties:
|
||||
* applicationId:
|
||||
* type: string
|
||||
* description: 申请单号
|
||||
* policyId:
|
||||
* type: string
|
||||
* description: 保单编号
|
||||
* productName:
|
||||
* type: string
|
||||
* description: 产品名称
|
||||
* insurancePeriod:
|
||||
* type: string
|
||||
* description: 保险期间
|
||||
* customerName:
|
||||
* type: string
|
||||
* description: 客户姓名
|
||||
* documentType:
|
||||
* type: string
|
||||
* description: 证件类型
|
||||
* documentNumber:
|
||||
* type: string
|
||||
* description: 证件号码
|
||||
* applicableAmount:
|
||||
* type: number
|
||||
* description: 适用金额
|
||||
* taskType:
|
||||
* type: string
|
||||
* enum: [new_application, task_guidance, batch_operation]
|
||||
* description: 任务类型
|
||||
* assignedTo:
|
||||
* type: integer
|
||||
* description: 分配给用户ID
|
||||
* priority:
|
||||
* type: string
|
||||
* enum: [low, medium, high, urgent]
|
||||
* description: 优先级
|
||||
* dueDate:
|
||||
* type: string
|
||||
* format: date
|
||||
* description: 截止日期
|
||||
* remarks:
|
||||
* type: string
|
||||
* description: 备注
|
||||
* responses:
|
||||
* 201:
|
||||
* description: 创建成功
|
||||
*/
|
||||
router.post('/', SupervisoryTaskController.create);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks/{id}:
|
||||
* get:
|
||||
* summary: 获取监管任务详情
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 监管任务ID
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/:id', SupervisoryTaskController.getById);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks/{id}:
|
||||
* put:
|
||||
* summary: 更新监管任务
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 监管任务ID
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* status:
|
||||
* type: string
|
||||
* enum: [pending, processing, completed, rejected]
|
||||
* assignedTo:
|
||||
* type: integer
|
||||
* priority:
|
||||
* type: string
|
||||
* enum: [low, medium, high, urgent]
|
||||
* remarks:
|
||||
* type: string
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 更新成功
|
||||
*/
|
||||
router.put('/:id', SupervisoryTaskController.update);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks/{id}:
|
||||
* delete:
|
||||
* summary: 删除监管任务
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
* required: true
|
||||
* schema:
|
||||
* type: integer
|
||||
* description: 监管任务ID
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 删除成功
|
||||
*/
|
||||
router.delete('/:id', SupervisoryTaskController.delete);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks/batch/operate:
|
||||
* post:
|
||||
* summary: 批量操作监管任务
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - ids
|
||||
* - operation
|
||||
* properties:
|
||||
* ids:
|
||||
* type: array
|
||||
* items:
|
||||
* type: integer
|
||||
* description: 监管任务ID数组
|
||||
* operation:
|
||||
* type: string
|
||||
* enum: [assign, updateStatus, delete]
|
||||
* description: 操作类型
|
||||
* data:
|
||||
* type: object
|
||||
* description: 操作数据
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 操作成功
|
||||
*/
|
||||
router.post('/batch/operate', SupervisoryTaskController.bulkCreate);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/supervision-tasks/stats:
|
||||
* get:
|
||||
* summary: 获取监管任务统计数据
|
||||
* tags: [SupervisionTasks]
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* responses:
|
||||
* 200:
|
||||
* description: 获取成功
|
||||
*/
|
||||
router.get('/stats', SupervisoryTaskController.getStatistics);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user