rez_core 2.1.123 → 2.1.124
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/module/enterprise/repository/school.repository.js +1 -1
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/workflow/controller/workflow-list-master.controller.d.ts +1 -0
- package/dist/module/workflow/controller/workflow-list-master.controller.js +11 -0
- package/dist/module/workflow/controller/workflow-list-master.controller.js.map +1 -1
- package/dist/module/workflow/service/workflow-list-master.service.d.ts +1 -0
- package/dist/module/workflow/service/workflow-list-master.service.js +12 -0
- package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/repository/school.repository.ts +1 -1
- package/src/module/workflow/controller/workflow-list-master.controller.ts +15 -1
- package/src/module/workflow/service/workflow-list-master.service.ts +23 -0
package/package.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Controller,
|
|
3
|
+
Post,
|
|
4
|
+
Body,
|
|
5
|
+
HttpCode,
|
|
6
|
+
HttpStatus,
|
|
7
|
+
Get,
|
|
8
|
+
} from '@nestjs/common';
|
|
2
9
|
import { WorkflowListMasterService } from '../service/workflow-list-master.service';
|
|
3
10
|
|
|
4
11
|
@Controller('/workflow-list')
|
|
@@ -22,4 +29,11 @@ export class WorkflowListMasterController {
|
|
|
22
29
|
);
|
|
23
30
|
return result;
|
|
24
31
|
}
|
|
32
|
+
|
|
33
|
+
@Get('/getModes')
|
|
34
|
+
@HttpCode(HttpStatus.OK)
|
|
35
|
+
async getModes() {
|
|
36
|
+
const result = await this.workflowService.getModes();
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
25
39
|
}
|
|
@@ -41,4 +41,27 @@ export class WorkflowListMasterService extends EntityServiceImpl {
|
|
|
41
41
|
);
|
|
42
42
|
return results;
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
async getModes(): Promise<any[]> {
|
|
46
|
+
// Step 1: Get all list masters with type 'MOD'
|
|
47
|
+
const modeLists = await this.dataSource.query(
|
|
48
|
+
`SELECT id FROM cr_list_master WHERE type = 'MOD'`,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
if (modeLists.length === 0) return [];
|
|
52
|
+
|
|
53
|
+
const listIds = modeLists.map((item) => item.id);
|
|
54
|
+
|
|
55
|
+
// Step 2: Get all list items where list_id is in the MOD list IDs
|
|
56
|
+
const modes = await this.dataSource.query(
|
|
57
|
+
`
|
|
58
|
+
SELECT id, name
|
|
59
|
+
FROM cr_list_master_items
|
|
60
|
+
WHERE list_id IN (${listIds.map(() => '?').join(',')})
|
|
61
|
+
`,
|
|
62
|
+
listIds,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return modes;
|
|
66
|
+
}
|
|
44
67
|
}
|