rez_core 2.1.128 → 2.1.129
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/workflow/controller/action-template-mapping.controller.d.ts +2 -0
- package/dist/module/workflow/controller/action-template-mapping.controller.js +5 -4
- package/dist/module/workflow/controller/action-template-mapping.controller.js.map +1 -1
- package/dist/module/workflow/entity/comm-template.entity.d.ts +1 -1
- package/dist/module/workflow/entity/comm-template.entity.js +2 -2
- package/dist/module/workflow/entity/comm-template.entity.js.map +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.d.ts +1 -1
- package/dist/module/workflow/service/action-template-mapping.service.js +4 -3
- package/dist/module/workflow/service/action-template-mapping.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/controller/action-template-mapping.controller.ts +4 -1
- package/src/module/workflow/entity/comm-template.entity.ts +2 -2
- package/src/module/workflow/service/action-template-mapping.service.ts +13 -3
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
HttpCode,
|
|
5
5
|
HttpStatus,
|
|
6
6
|
Post,
|
|
7
|
+
Req,
|
|
7
8
|
UseGuards,
|
|
8
9
|
} from '@nestjs/common';
|
|
9
10
|
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
@@ -20,12 +21,14 @@ export class ActionTemplateMappingController {
|
|
|
20
21
|
@HttpCode(HttpStatus.OK)
|
|
21
22
|
async getTemplate(
|
|
22
23
|
@Body() body: { stage_id: number; action_id: number; mode: number },
|
|
24
|
+
@Req() req: Request & { user: any },
|
|
23
25
|
) {
|
|
24
|
-
|
|
26
|
+
const loggedInUser = req.user.userData;
|
|
25
27
|
const result = this.actionTemplateMappingService.getTemplateByMode(
|
|
26
28
|
body.stage_id,
|
|
27
29
|
body.action_id,
|
|
28
30
|
body.mode,
|
|
31
|
+
loggedInUser,
|
|
29
32
|
);
|
|
30
33
|
return result;
|
|
31
34
|
}
|
|
@@ -7,7 +7,12 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
7
7
|
constructor(private readonly dataSource: DataSource) {
|
|
8
8
|
super();
|
|
9
9
|
}
|
|
10
|
-
async getTemplateByMode(
|
|
10
|
+
async getTemplateByMode(
|
|
11
|
+
stage_id: number,
|
|
12
|
+
action_id: number,
|
|
13
|
+
mode: number,
|
|
14
|
+
loggedInUser,
|
|
15
|
+
) {
|
|
11
16
|
const stageAction = await this.dataSource.query(
|
|
12
17
|
`
|
|
13
18
|
SELECT id FROM cr_wf_stage_action_mapping
|
|
@@ -26,6 +31,11 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
26
31
|
`,
|
|
27
32
|
[stgActMappingId],
|
|
28
33
|
);
|
|
34
|
+
const listMasterItemData = await this.dataSource.query(
|
|
35
|
+
`SELECT code FROM cr_list_master_items WHERE id = ?`,
|
|
36
|
+
[mode],
|
|
37
|
+
);
|
|
38
|
+
|
|
29
39
|
const templateCodes = templates.map((t) => t.template_code);
|
|
30
40
|
if (!templateCodes.length) return [];
|
|
31
41
|
|
|
@@ -33,9 +43,9 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
|
|
|
33
43
|
`
|
|
34
44
|
SELECT id, name
|
|
35
45
|
FROM cr_wf_comm_template
|
|
36
|
-
WHERE code IN (?) AND mode = ?
|
|
46
|
+
WHERE code IN (?) AND mode = ? AND organization_id = ?
|
|
37
47
|
`,
|
|
38
|
-
[templateCodes,
|
|
48
|
+
[templateCodes, listMasterItemData[0].code, loggedInUser.organization_id],
|
|
39
49
|
);
|
|
40
50
|
return commTemplates.map((t) => ({ id: t.id, name: t.name }));
|
|
41
51
|
}
|