rez_core 2.0.44 → 2.0.45
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/entity/school.entity.d.ts +1 -0
- package/dist/module/enterprise/entity/school.entity.js +4 -0
- package/dist/module/enterprise/entity/school.entity.js.map +1 -1
- package/dist/module/enterprise/repository/school.repository.js +12 -3
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/meta/entity/app-master.entity.d.ts +1 -0
- package/dist/module/meta/entity/app-master.entity.js +4 -0
- package/dist/module/meta/entity/app-master.entity.js.map +1 -1
- package/dist/module/meta/service/app-master.service.d.ts +1 -1
- package/dist/module/meta/service/app-master.service.js +8 -5
- package/dist/module/meta/service/app-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/entity/school.entity.ts +3 -0
- package/src/module/enterprise/repository/school.repository.ts +19 -2
- package/src/module/meta/entity/app-master.entity.ts +3 -0
- package/src/module/meta/service/app-master.service.ts +8 -5
package/package.json
CHANGED
|
@@ -43,10 +43,12 @@ export class SchoolRepository {
|
|
|
43
43
|
.select([
|
|
44
44
|
'org.id AS org_id',
|
|
45
45
|
'org.name AS org_name',
|
|
46
|
+
'org.address AS org_address',
|
|
46
47
|
'br.id AS brand_id',
|
|
47
48
|
'br.name AS brand_name',
|
|
48
49
|
'sch.id AS school_id',
|
|
49
50
|
'sch.name AS school_name',
|
|
51
|
+
'sch.location AS school_location',
|
|
50
52
|
])
|
|
51
53
|
.from('cr_school', 'sch')
|
|
52
54
|
.innerJoin('cr_brand', 'br', 'sch.brand_id = br.id')
|
|
@@ -59,16 +61,19 @@ export class SchoolRepository {
|
|
|
59
61
|
const {
|
|
60
62
|
org_id,
|
|
61
63
|
org_name,
|
|
64
|
+
org_address,
|
|
62
65
|
brand_id,
|
|
63
66
|
brand_name,
|
|
64
67
|
school_id,
|
|
65
68
|
school_name,
|
|
69
|
+
school_location,
|
|
66
70
|
} = row;
|
|
67
71
|
|
|
68
72
|
if (!result[org_id]) {
|
|
69
73
|
result[org_id] = {
|
|
70
74
|
org_id,
|
|
71
75
|
org_name,
|
|
76
|
+
org_address,
|
|
72
77
|
brands: {},
|
|
73
78
|
};
|
|
74
79
|
}
|
|
@@ -82,6 +87,7 @@ export class SchoolRepository {
|
|
|
82
87
|
result[org_id].brands[brand_id].schools.push({
|
|
83
88
|
school_id,
|
|
84
89
|
school_name,
|
|
90
|
+
school_location,
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -98,6 +104,7 @@ export class SchoolRepository {
|
|
|
98
104
|
'brand.name AS brand_name',
|
|
99
105
|
'school.id AS school_id',
|
|
100
106
|
'school.name AS school_name',
|
|
107
|
+
'school.location AS school_location',
|
|
101
108
|
])
|
|
102
109
|
.from('cr_user_role_mapping', 'urm')
|
|
103
110
|
.innerJoin('cr_brand', 'brand', 'brand.id = urm.level_id')
|
|
@@ -130,7 +137,13 @@ export class SchoolRepository {
|
|
|
130
137
|
// 4. Group by brand
|
|
131
138
|
const result = {};
|
|
132
139
|
for (const row of allMappings) {
|
|
133
|
-
const {
|
|
140
|
+
const {
|
|
141
|
+
brand_id,
|
|
142
|
+
brand_name,
|
|
143
|
+
school_id,
|
|
144
|
+
school_name,
|
|
145
|
+
school_location,
|
|
146
|
+
} = row;
|
|
134
147
|
|
|
135
148
|
if (!result[brand_id]) {
|
|
136
149
|
result[brand_id] = {
|
|
@@ -145,7 +158,11 @@ export class SchoolRepository {
|
|
|
145
158
|
school_id &&
|
|
146
159
|
!result[brand_id].schools.some((s) => s.school_id === school_id)
|
|
147
160
|
) {
|
|
148
|
-
result[brand_id].schools.push({
|
|
161
|
+
result[brand_id].schools.push({
|
|
162
|
+
school_id,
|
|
163
|
+
school_name,
|
|
164
|
+
school_location,
|
|
165
|
+
});
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
168
|
|
|
@@ -13,22 +13,25 @@ export class AppMasterService {
|
|
|
13
13
|
const app_code =
|
|
14
14
|
await this.userRoleMappingRepository.findDistinctAppcodeByUserId(userId);
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const finalResult: any[] = [];
|
|
17
17
|
|
|
18
18
|
if (app_code.appcode.length > 0) {
|
|
19
19
|
const resolvedData = await Promise.all(
|
|
20
20
|
app_code.appcode.map(async (element) => {
|
|
21
21
|
const data =
|
|
22
22
|
await this.appMasterRepository.getAppMasterDataByAppCode(element);
|
|
23
|
-
return
|
|
23
|
+
return data || [];
|
|
24
24
|
}),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
resolvedData.forEach((
|
|
28
|
-
|
|
27
|
+
resolvedData.flat().forEach((item) => {
|
|
28
|
+
finalResult.push({
|
|
29
|
+
key: item.name,
|
|
30
|
+
details: item,
|
|
31
|
+
});
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
return
|
|
35
|
+
return finalResult;
|
|
33
36
|
}
|
|
34
37
|
}
|