|
@@ -11,14 +11,11 @@ import {Logger} from "@util/Logger";
|
|
import {PrjTaskOutcome} from "@core-models/PrjTaskOutcome";
|
|
import {PrjTaskOutcome} from "@core-models/PrjTaskOutcome";
|
|
import {BizContractInfo} from "@core-models/BizContractInfo";
|
|
import {BizContractInfo} from "@core-models/BizContractInfo";
|
|
import {PrjFile} from "@core-models/PrjFile";
|
|
import {PrjFile} from "@core-models/PrjFile";
|
|
-import {BpmnModel} from "@core-models/BpmnModel";
|
|
|
|
import {FlowEngine} from "@src/bpmn/flow_engine";
|
|
import {FlowEngine} from "@src/bpmn/flow_engine";
|
|
-import {UploadedFiles} from "@core-models/UploadedFiles";
|
|
|
|
import {BpmnCase} from "@core-models/BpmnCase";
|
|
import {BpmnCase} from "@core-models/BpmnCase";
|
|
import {bpmn_flow_on_end} from "@src/utils/bpmn_work_helper";
|
|
import {bpmn_flow_on_end} from "@src/utils/bpmn_work_helper";
|
|
import {OutcomeStatus} from "@src/utils/define";
|
|
import {OutcomeStatus} from "@src/utils/define";
|
|
-import {Op} from "sequelize";
|
|
|
|
-import * as os from "os";
|
|
|
|
|
|
+import {prj_stat_monthly} from "@src/utils/prj_stat";
|
|
const { report } = require('node:process');
|
|
const { report } = require('node:process');
|
|
|
|
|
|
const schedule = require('node-schedule');
|
|
const schedule = require('node-schedule');
|
|
@@ -52,32 +49,11 @@ new ServiceApp().start(new MyRouter('@src/routes', guards), Models).then(async (
|
|
returning: ['id', 'task_id'],
|
|
returning: ['id', 'task_id'],
|
|
transaction: t
|
|
transaction: t
|
|
});
|
|
});
|
|
- // if (result && result[0]) {
|
|
|
|
- // let outcomes = await PrjTaskOutcome.findAll({
|
|
|
|
- // where: {
|
|
|
|
- // task_id: result[0].task_id,
|
|
|
|
- // status: OutcomeStatus.New,
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // if (outcomes.length === 0) { // 所有交付物都上传完成,启动任务审核流程
|
|
|
|
- //
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 'week_report':
|
|
case 'week_report':
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- // if (path[2] === 'outcome') {
|
|
|
|
- // let outcome_id = path[3];
|
|
|
|
- // if (outcome_id) {
|
|
|
|
- // let [count, result] = await PrjTaskOutcome.update({status: OutcomeStatus.Uploaded, uploaded: true}, {
|
|
|
|
- // where: {id: outcome_id},
|
|
|
|
- // returning: [],
|
|
|
|
- // transaction: t
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
await PrjFile.update({
|
|
await PrjFile.update({
|
|
uploaded_at: dayjs(),
|
|
uploaded_at: dayjs(),
|
|
uploaded: true,
|
|
uploaded: true,
|
|
@@ -146,7 +122,10 @@ new ServiceApp().start(new MyRouter('@src/routes', guards), Models).then(async (
|
|
}, bpmn_flow_on_end).run(flow.state);
|
|
}, bpmn_flow_on_end).run(flow.state);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ // 项目数统计
|
|
|
|
+ schedule.scheduleJob('50 23 * * *', async function () {
|
|
|
|
+ await prj_stat_monthly();
|
|
|
|
+ });
|
|
|
|
|
|
// let bpmn = await BpmnModel.findOne({where: {id: 'task'}, raw: true});
|
|
// let bpmn = await BpmnModel.findOne({where: {id: 'task'}, raw: true});
|
|
// if (bpmn) {
|
|
// if (bpmn) {
|