代码整理
This commit is contained in:
1 parent
0f1c3b51e5
commit
1f99dcd134
6 files changed
+97
-111
No files matched your search
+10
-5
@@ -49,6 +49,7 @@ class TaskService extends Service {
|
||||
|
||||
await jianghuKnex('task', this.ctx).jhInsert(actionData);
|
||||
|
||||
// 如果首节点是抄送节点,继续往下走
|
||||
if (taskConfigId.startsWith('noticeTask-')) {
|
||||
var data = {
|
||||
...actionData,
|
||||
@@ -56,7 +57,7 @@ class TaskService extends Service {
|
||||
taskWorkflow: JSON.parse(taskWorkflow),
|
||||
taskFormInput: JSON.parse(taskFormInput),
|
||||
}
|
||||
// 往下走
|
||||
|
||||
await this.submitNode(data, '同意', 1, 'createTask')
|
||||
}
|
||||
}
|
||||
@@ -79,14 +80,18 @@ class TaskService extends Service {
|
||||
await this.submitNode(updateItem, '同意', 1, 'createTask')
|
||||
}
|
||||
|
||||
/**
|
||||
* @ target: 提交节点
|
||||
* @ params:
|
||||
* taskData: 审批单信息
|
||||
* type: 审批操作:同意/拒绝
|
||||
* times: 首次进入该方法,0:首次;1:迭代进入的
|
||||
* action: 新建/审核审批, createTask:新建审批单;updateTask:审核审批单
|
||||
*/
|
||||
async submitNode(taskData, type, times, action) {
|
||||
const { jianghuKnex } = this.app;
|
||||
const { updateTaskData, historyInsertData, noticeInsertData } = await this.buildNext({ taskData: taskData, type: type, times: times, action: action })
|
||||
|
||||
console.log('updateTaskData------', updateTaskData);
|
||||
console.log('historyInsertData------', historyInsertData);
|
||||
console.log('noticeInsertData------', noticeInsertData);
|
||||
|
||||
await jianghuKnex.transaction(async trx => {
|
||||
if (updateTaskData) await trx("task", this.ctx).where({ taskId: taskData.taskId }).jhUpdate(updateTaskData);
|
||||
if (noticeInsertData.length > 0) await trx("notice_push", this.ctx).jhInsert(noticeInsertData);
|
||||
|
||||
Reference in new issue
Block a user