@nger/fk-upload 1.0.211 → 1.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/check-task.d.ts +3 -0
- package/dist/entities/check-task.js +38 -0
- package/dist/main.js +1 -13
- package/dist/tasks/check-task.js +9 -8
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FkJiQun } from "./fk-jiqun";
|
|
1
2
|
import { FkW7Account } from "./w7-account";
|
|
2
3
|
export declare class FkCheckTask {
|
|
3
4
|
id: number;
|
|
@@ -9,5 +10,7 @@ export declare class FkCheckTask {
|
|
|
9
10
|
time: string;
|
|
10
11
|
w7AccountId: number;
|
|
11
12
|
w7Account: FkW7Account;
|
|
13
|
+
jiqunId: number;
|
|
14
|
+
jiqun: FkJiQun;
|
|
12
15
|
deleteDate: Date;
|
|
13
16
|
}
|
|
@@ -7,6 +7,7 @@ const rest_1 = require("@nger/rest");
|
|
|
7
7
|
const typeorm_1 = require("@nger/typeorm");
|
|
8
8
|
const typeorm_2 = require("typeorm");
|
|
9
9
|
const check_service_1 = require("../services/check.service");
|
|
10
|
+
const fk_jiqun_1 = require("./fk-jiqun");
|
|
10
11
|
const w7_account_1 = require("./w7-account");
|
|
11
12
|
let FkCheckTask = FkCheckTask_1 = class FkCheckTask {
|
|
12
13
|
id;
|
|
@@ -18,6 +19,8 @@ let FkCheckTask = FkCheckTask_1 = class FkCheckTask {
|
|
|
18
19
|
time;
|
|
19
20
|
w7AccountId;
|
|
20
21
|
w7Account;
|
|
22
|
+
jiqunId;
|
|
23
|
+
jiqun;
|
|
21
24
|
deleteDate;
|
|
22
25
|
};
|
|
23
26
|
tslib_1.__decorate([
|
|
@@ -160,6 +163,41 @@ tslib_1.__decorate([
|
|
|
160
163
|
}),
|
|
161
164
|
tslib_1.__metadata("design:type", w7_account_1.FkW7Account)
|
|
162
165
|
], FkCheckTask.prototype, "w7Account", void 0);
|
|
166
|
+
tslib_1.__decorate([
|
|
167
|
+
(0, rest_1.Widget)({
|
|
168
|
+
title: `执行者`,
|
|
169
|
+
path: 'jiqun.clientId',
|
|
170
|
+
width: '180px',
|
|
171
|
+
span: 24,
|
|
172
|
+
required: true,
|
|
173
|
+
widget: {
|
|
174
|
+
type: 'selector',
|
|
175
|
+
from: 'fk_ji_qun',
|
|
176
|
+
config: {
|
|
177
|
+
label: 'clientId',
|
|
178
|
+
value: 'id'
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
(0, typeorm_2.Column)({
|
|
183
|
+
name: 'jiqun_id',
|
|
184
|
+
nullable: true
|
|
185
|
+
}),
|
|
186
|
+
tslib_1.__metadata("design:type", Number)
|
|
187
|
+
], FkCheckTask.prototype, "jiqunId", void 0);
|
|
188
|
+
tslib_1.__decorate([
|
|
189
|
+
(0, rest_1.Widget)({
|
|
190
|
+
hideInAdd: true,
|
|
191
|
+
hideInEdit: true,
|
|
192
|
+
hideInSearch: true,
|
|
193
|
+
hideInTable: true
|
|
194
|
+
}),
|
|
195
|
+
(0, typeorm_2.ManyToOne)(() => fk_jiqun_1.FkJiQun),
|
|
196
|
+
(0, typeorm_2.JoinColumn)({
|
|
197
|
+
name: 'jiqun_id'
|
|
198
|
+
}),
|
|
199
|
+
tslib_1.__metadata("design:type", fk_jiqun_1.FkJiQun)
|
|
200
|
+
], FkCheckTask.prototype, "jiqun", void 0);
|
|
163
201
|
tslib_1.__decorate([
|
|
164
202
|
(0, rest_1.Widget)({
|
|
165
203
|
hideInAdd: true,
|
package/dist/main.js
CHANGED
|
@@ -7,25 +7,13 @@ require("reflect-metadata");
|
|
|
7
7
|
require('dotenv').config();
|
|
8
8
|
const main_1 = require("@nger/main");
|
|
9
9
|
const core_1 = require("@nger/core");
|
|
10
|
-
const sirv_1 = require("@nger/sirv");
|
|
11
|
-
const rest_1 = require("@nger/rest");
|
|
12
|
-
const upload_1 = require("@nger/upload");
|
|
13
|
-
const rabbitmq_1 = require("@nger/rabbitmq");
|
|
14
10
|
const fk_upload_module_1 = require("./fk-upload.module");
|
|
15
|
-
const menu_1 = require("@nger/menu");
|
|
16
|
-
const setting_1 = require("@nger/setting");
|
|
17
11
|
let AppModule = class AppModule {
|
|
18
12
|
};
|
|
19
13
|
AppModule = tslib_1.__decorate([
|
|
20
14
|
(0, core_1.Module)({
|
|
21
15
|
imports: [
|
|
22
|
-
|
|
23
|
-
sirv_1.SirvModule.forRoot(),
|
|
24
|
-
rest_1.RestModule,
|
|
25
|
-
upload_1.UploadModule,
|
|
26
|
-
fk_upload_module_1.FkUploadModule,
|
|
27
|
-
menu_1.MenuModule,
|
|
28
|
-
setting_1.SettingModule
|
|
16
|
+
fk_upload_module_1.FkUploadModule
|
|
29
17
|
]
|
|
30
18
|
})
|
|
31
19
|
], AppModule);
|
package/dist/tasks/check-task.js
CHANGED
|
@@ -33,6 +33,7 @@ class CheckTask extends rabbitmq_1.Task {
|
|
|
33
33
|
complete();
|
|
34
34
|
return next && next();
|
|
35
35
|
}
|
|
36
|
+
console.log(`receive mq message: ${new Date()}-${check.status}-${check.type}`);
|
|
36
37
|
const manager = injector.get(rabbitmq_1.TaskManager);
|
|
37
38
|
if (this.ids.has(id)) {
|
|
38
39
|
complete();
|
|
@@ -104,7 +105,7 @@ class CheckTask extends rabbitmq_1.Task {
|
|
|
104
105
|
await finish(`人为关闭`);
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
|
-
console.log(
|
|
108
|
+
console.log(`run in schedule: ${time}-${runtimeCheck.status}-${runtimeCheck.type}`);
|
|
108
109
|
if (type === 'create_download') {
|
|
109
110
|
const now = new Date().getTime() - 1000 * 60 * 60 * 24 * 8;
|
|
110
111
|
(0, date_fns_1.format)(now, 'yyyy');
|
|
@@ -126,7 +127,7 @@ class CheckTask extends rabbitmq_1.Task {
|
|
|
126
127
|
await db.manager.save(download_task_1.FkDownloadTask, downloadTask);
|
|
127
128
|
});
|
|
128
129
|
// start download
|
|
129
|
-
const one = await db.manager.findOne(download_task_1.FkDownloadTask, { where: { status: `1` } });
|
|
130
|
+
const one = await db.manager.findOne(download_task_1.FkDownloadTask, { where: { status: `1` }, order: { id: "desc" } });
|
|
130
131
|
if (one) {
|
|
131
132
|
const downloadService = injector.get(download_service_1.DownloadService);
|
|
132
133
|
await downloadService.startDownload(one.id);
|
|
@@ -147,10 +148,10 @@ class CheckTask extends rabbitmq_1.Task {
|
|
|
147
148
|
});
|
|
148
149
|
});
|
|
149
150
|
// start upload
|
|
150
|
-
const waitUploads = await db.manager.
|
|
151
|
+
const waitUploads = await db.manager.findOne(upload_task_1.FkUploadTask, { where: { status: '1' }, order: { id: 'desc' } });
|
|
151
152
|
const uploadService = injector.get(upload_service_1.UploadService);
|
|
152
|
-
if (waitUploads
|
|
153
|
-
await uploadService.
|
|
153
|
+
if (waitUploads) {
|
|
154
|
+
await uploadService.startUpload(waitUploads.id);
|
|
154
155
|
}
|
|
155
156
|
// downloadService.startDownload()
|
|
156
157
|
await db.manager.update(check_task_1.FkCheckTask, id, { count: count + 1 });
|
|
@@ -168,10 +169,10 @@ class CheckTask extends rabbitmq_1.Task {
|
|
|
168
169
|
});
|
|
169
170
|
});
|
|
170
171
|
// start effect
|
|
171
|
-
const waitEffects = await db.manager.
|
|
172
|
+
const waitEffects = await db.manager.findOne(effect_task_1.FkEffectTask, { where: { status: '1' } });
|
|
172
173
|
const effectService = injector.get(effect_service_1.EffectService);
|
|
173
|
-
if (waitEffects
|
|
174
|
-
await effectService.
|
|
174
|
+
if (waitEffects) {
|
|
175
|
+
await effectService.start(waitEffects.id);
|
|
175
176
|
}
|
|
176
177
|
await db.manager.update(check_task_1.FkCheckTask, id, { count: count + 1 });
|
|
177
178
|
// await finish(`执行完成`)
|