@dssp/project 1.0.0-alpha.2 → 1.0.0-alpha.5
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-client/pages/lib/select2-component.js +1 -1
- package/dist-client/pages/lib/select2-component.js.map +1 -1
- package/dist-client/pages/lib/waether.js.map +1 -1
- package/dist-client/pages/project/component/project-update-header.js.map +1 -1
- package/dist-client/pages/project/popup/popup-plan-upload.js.map +1 -1
- package/dist-client/pages/project/popup/popup-project-create.js.map +1 -1
- package/dist-client/pages/project/popup/popup-schedule-upload.js.map +1 -1
- package/dist-client/pages/project/project-completed-list.js +0 -1
- package/dist-client/pages/project/project-completed-list.js.map +1 -1
- package/dist-client/pages/project/project-detail.js.map +1 -1
- package/dist-client/pages/project/project-list.js +9 -8
- package/dist-client/pages/project/project-list.js.map +1 -1
- package/dist-client/pages/project/project-plan-management.js.map +1 -1
- package/dist-client/pages/project/project-schedule-list.js.map +1 -1
- package/dist-client/pages/project/project-schedule.js.map +1 -1
- package/dist-client/pages/project/project-setting-list.js +25 -24
- package/dist-client/pages/project/project-setting-list.js.map +1 -1
- package/dist-client/pages/project/project-update.js.map +1 -1
- package/dist-client/pages/resource/construction-detail-type-popup.js.map +1 -1
- package/dist-client/pages/resource/construction-type-management.js.map +1 -1
- package/dist-client/pages/resource/inspection-drawing-type-management.js.map +1 -1
- package/dist-client/pages/resource/inspection-part-popup.js.map +1 -1
- package/dist-client/pages/resource/resource-importer.js.map +1 -1
- package/dist-client/pages/resource/resource-list-page.js.map +1 -1
- package/dist-client/pages/resource/worker-type-management.js.map +1 -1
- package/dist-client/pages/task/task-importer.js.map +1 -1
- package/dist-client/pages/task/task-list-page.js.map +1 -1
- package/dist-client/pages/task-resource/task-resource-importer.js.map +1 -1
- package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/export-tasks.js +1 -2
- package/dist-server/controllers/export-tasks.js.map +1 -1
- package/dist-server/controllers/import-task.js +1 -2
- package/dist-server/controllers/import-task.js.map +1 -1
- package/dist-server/controllers/parse-excel.d.ts +0 -2
- package/dist-server/controllers/parse-excel.js +1 -2
- package/dist-server/controllers/parse-excel.js.map +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/1723861466413-seed-roles.js.map +1 -1
- package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -1
- package/dist-server/migrations/1723861476419-seed-resources.js.map +1 -1
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +1 -1
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js +4 -4
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +1 -1
- package/dist-server/service/construction-detail-type/construction-detail-type.js +2 -2
- package/dist-server/service/construction-detail-type/construction-detail-type.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-mutation.js +2 -2
- package/dist-server/service/construction-type/construction-type-mutation.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-query.js +2 -2
- package/dist-server/service/construction-type/construction-type-query.js.map +1 -1
- package/dist-server/service/construction-type/construction-type-type.js +4 -4
- package/dist-server/service/construction-type/construction-type-type.js.map +1 -1
- package/dist-server/service/construction-type/construction-type.js +2 -2
- package/dist-server/service/construction-type/construction-type.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -0
- package/dist-server/service/index.js +1 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +4 -4
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +1 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +2 -2
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-mutation.js +2 -2
- package/dist-server/service/inspection-part/inspection-part-mutation.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-query.js +2 -2
- package/dist-server/service/inspection-part/inspection-part-query.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part-type.js +4 -4
- package/dist-server/service/inspection-part/inspection-part-type.js.map +1 -1
- package/dist-server/service/inspection-part/inspection-part.js +2 -2
- package/dist-server/service/inspection-part/inspection-part.js.map +1 -1
- package/dist-server/service/manager/index.d.ts +2 -0
- package/dist-server/service/manager/index.js +3 -1
- package/dist-server/service/manager/index.js.map +1 -1
- package/dist-server/service/manager/manager-mutation.js +2 -2
- package/dist-server/service/manager/manager-mutation.js.map +1 -1
- package/dist-server/service/manager/manager-query.js +3 -3
- package/dist-server/service/manager/manager-query.js.map +1 -1
- package/dist-server/service/manager/manager-type.js +4 -4
- package/dist-server/service/manager/manager-type.js.map +1 -1
- package/dist-server/service/manager/manager.js +2 -2
- package/dist-server/service/manager/manager.js.map +1 -1
- package/dist-server/service/project/project-mutation.js +7 -12
- package/dist-server/service/project/project-mutation.js.map +1 -1
- package/dist-server/service/project/project-query.d.ts +1 -0
- package/dist-server/service/project/project-query.js +14 -3
- package/dist-server/service/project/project-query.js.map +1 -1
- package/dist-server/service/project/project-type.js +8 -8
- package/dist-server/service/project/project-type.js.map +1 -1
- package/dist-server/service/project/project.d.ts +4 -0
- package/dist-server/service/project/project.js +9 -4
- package/dist-server/service/project/project.js.map +1 -1
- package/dist-server/service/resource/resource-mutation.js +2 -2
- package/dist-server/service/resource/resource-mutation.js.map +1 -1
- package/dist-server/service/resource/resource-query.js +2 -2
- package/dist-server/service/resource/resource-query.js.map +1 -1
- package/dist-server/service/resource/resource-type.js +6 -6
- package/dist-server/service/resource/resource-type.js.map +1 -1
- package/dist-server/service/resource/resource.js +3 -3
- package/dist-server/service/resource/resource.js.map +1 -1
- package/dist-server/service/task/task-mutation.js +2 -2
- package/dist-server/service/task/task-mutation.js.map +1 -1
- package/dist-server/service/task/task-query.js +4 -4
- package/dist-server/service/task/task-query.js.map +1 -1
- package/dist-server/service/task/task-type.js +10 -10
- package/dist-server/service/task/task-type.js.map +1 -1
- package/dist-server/service/task/task.js +7 -8
- package/dist-server/service/task/task.js.map +1 -1
- package/dist-server/service/task-resource/task-resource-mutation.js +2 -2
- package/dist-server/service/task-resource/task-resource-mutation.js.map +1 -1
- package/dist-server/service/task-resource/task-resource-query.js +2 -2
- package/dist-server/service/task-resource/task-resource-query.js.map +1 -1
- package/dist-server/service/task-resource/task-resource-type.js +6 -6
- package/dist-server/service/task-resource/task-resource-type.js.map +1 -1
- package/dist-server/service/task-resource/task-resource.js +2 -2
- package/dist-server/service/task-resource/task-resource.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-mutation.js +2 -2
- package/dist-server/service/worker-type/worker-type-mutation.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-query.js +2 -2
- package/dist-server/service/worker-type/worker-type-query.js.map +1 -1
- package/dist-server/service/worker-type/worker-type-type.js +4 -4
- package/dist-server/service/worker-type/worker-type-type.js.map +1 -1
- package/dist-server/service/worker-type/worker-type.js +2 -2
- package/dist-server/service/worker-type/worker-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -10,7 +10,7 @@ const auth_base_1 = require("@things-factory/auth-base");
|
|
|
10
10
|
let ManagerQuery = class ManagerQuery {
|
|
11
11
|
async managers(context) {
|
|
12
12
|
const { domain } = context.state;
|
|
13
|
-
const queryBuilder =
|
|
13
|
+
const queryBuilder = (0, shell_1.getRepository)(auth_base_1.User)
|
|
14
14
|
.createQueryBuilder('u')
|
|
15
15
|
.select('m.id', 'id')
|
|
16
16
|
.addSelect('m.phone', 'phone')
|
|
@@ -25,6 +25,7 @@ let ManagerQuery = class ManagerQuery {
|
|
|
25
25
|
return await queryBuilder.getRawMany();
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
exports.ManagerQuery = ManagerQuery;
|
|
28
29
|
tslib_1.__decorate([
|
|
29
30
|
(0, type_graphql_1.Query)(returns => [manager_type_1.ManagerOutput], { description: '담당자 리스트' }),
|
|
30
31
|
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
@@ -32,8 +33,7 @@ tslib_1.__decorate([
|
|
|
32
33
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
33
34
|
tslib_1.__metadata("design:returntype", Promise)
|
|
34
35
|
], ManagerQuery.prototype, "managers", null);
|
|
35
|
-
ManagerQuery = tslib_1.__decorate([
|
|
36
|
+
exports.ManagerQuery = ManagerQuery = tslib_1.__decorate([
|
|
36
37
|
(0, type_graphql_1.Resolver)(manager_1.Manager)
|
|
37
38
|
], ManagerQuery);
|
|
38
|
-
exports.ManagerQuery = ManagerQuery;
|
|
39
39
|
//# sourceMappingURL=manager-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-query.js","sourceRoot":"","sources":["../../../server/service/manager/manager-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AACnD,iDAAqD;AACrD,uCAAmC;AACnC,iDAA8C;AAC9C,yDAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAwB;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"manager-query.js","sourceRoot":"","sources":["../../../server/service/manager/manager-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AACnD,iDAAqD;AACrD,uCAAmC;AACnC,iDAA8C;AAC9C,yDAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,QAAQ,CAAQ,OAAwB;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qBAAa,EAAC,gBAAI,CAAC;aACrC,kBAAkB,CAAC,GAAG,CAAC;aACvB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;aACpB,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC;aAC7B,SAAS,CAAC,YAAY,EAAE,UAAU,CAAC;aACnC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC;aAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;aAC3B,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;aACtC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,oBAAoB,CAAC;aACtD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,kBAAkB,CAAC;aAC7C,KAAK,CAAC,yBAAyB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;aACvD,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAE5B,OAAO,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;IACxC,CAAC;CACF,CAAA;AApBY,oCAAY;AAEjB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,4BAAa,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4CAiBpB;uBAnBU,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CAoBxB","sourcesContent":["import { Resolver, Query, Ctx } from 'type-graphql'\nimport { getRepository } from '@things-factory/shell'\nimport { Manager } from './manager'\nimport { ManagerOutput } from './manager-type'\nimport { User } from '@things-factory/auth-base'\n\n@Resolver(Manager)\nexport class ManagerQuery {\n @Query(returns => [ManagerOutput], { description: '담당자 리스트' })\n async managers(@Ctx() context: ResolverContext): Promise<ManagerOutput[]> {\n const { domain } = context.state\n\n const queryBuilder = getRepository(User)\n .createQueryBuilder('u')\n .select('m.id', 'id')\n .addSelect('m.phone', 'phone')\n .addSelect('m.position', 'position')\n .addSelect('u.id', 'userId')\n .addSelect('u.name', 'name')\n .addSelect('u.updated_at', 'updatedAt')\n .innerJoin('users_domains', 'ud', 'u.id = ud.users_id')\n .leftJoin('managers', 'm', 'u.id = m.user_id')\n .where('ud.domains_id = :domain', { domain: domain.id })\n .orderBy('u.name', 'DESC')\n\n return await queryBuilder.getRawMany()\n }\n}\n"]}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
6
|
let ManagerPatch = class ManagerPatch {
|
|
7
7
|
};
|
|
8
|
+
exports.ManagerPatch = ManagerPatch;
|
|
8
9
|
tslib_1.__decorate([
|
|
9
10
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
10
11
|
tslib_1.__metadata("design:type", String)
|
|
@@ -25,12 +26,12 @@ tslib_1.__decorate([
|
|
|
25
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
26
27
|
tslib_1.__metadata("design:type", String)
|
|
27
28
|
], ManagerPatch.prototype, "name", void 0);
|
|
28
|
-
ManagerPatch = tslib_1.__decorate([
|
|
29
|
+
exports.ManagerPatch = ManagerPatch = tslib_1.__decorate([
|
|
29
30
|
(0, type_graphql_1.InputType)()
|
|
30
31
|
], ManagerPatch);
|
|
31
|
-
exports.ManagerPatch = ManagerPatch;
|
|
32
32
|
let ManagerOutput = class ManagerOutput {
|
|
33
33
|
};
|
|
34
|
+
exports.ManagerOutput = ManagerOutput;
|
|
34
35
|
tslib_1.__decorate([
|
|
35
36
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
36
37
|
tslib_1.__metadata("design:type", String)
|
|
@@ -55,8 +56,7 @@ tslib_1.__decorate([
|
|
|
55
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
56
57
|
tslib_1.__metadata("design:type", String)
|
|
57
58
|
], ManagerOutput.prototype, "updatedAt", void 0);
|
|
58
|
-
ManagerOutput = tslib_1.__decorate([
|
|
59
|
+
exports.ManagerOutput = ManagerOutput = tslib_1.__decorate([
|
|
59
60
|
(0, type_graphql_1.ObjectType)()
|
|
60
61
|
], ManagerOutput);
|
|
61
|
-
exports.ManagerOutput = ManagerOutput;
|
|
62
62
|
//# sourceMappingURL=manager-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-type.js","sourceRoot":"","sources":["../../../server/service/manager/manager-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA+D;AAGxD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAexB,CAAA;
|
|
1
|
+
{"version":3,"file":"manager-type.js","sourceRoot":"","sources":["../../../server/service/manager/manager-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA+D;AAGxD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAexB,CAAA;AAfY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACZ;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACvB;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;uBAdF,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAexB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAkBzB,CAAA;AAlBY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACZ;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;6CACH;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;wBAjBP,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAkBzB","sourcesContent":["import { ObjectType, Field, InputType, ID } from 'type-graphql'\n\n@InputType()\nexport class ManagerPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field({ nullable: true })\n position?: string\n\n @Field(type => ID, { nullable: true })\n userId?: string\n\n @Field({ nullable: true })\n name?: string\n}\n\n@ObjectType()\nexport class ManagerOutput {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field({ nullable: true })\n position?: string\n\n @Field(type => ID)\n userId?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n updatedAt?: string\n}\n"]}
|
|
@@ -7,6 +7,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
7
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
8
|
let Manager = class Manager {
|
|
9
9
|
};
|
|
10
|
+
exports.Manager = Manager;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
12
13
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -32,10 +33,9 @@ tslib_1.__decorate([
|
|
|
32
33
|
(0, typeorm_1.RelationId)((manager) => manager.user),
|
|
33
34
|
tslib_1.__metadata("design:type", String)
|
|
34
35
|
], Manager.prototype, "userId", void 0);
|
|
35
|
-
Manager = tslib_1.__decorate([
|
|
36
|
+
exports.Manager = Manager = tslib_1.__decorate([
|
|
36
37
|
(0, typeorm_1.Entity)(),
|
|
37
38
|
(0, typeorm_1.Index)('ix_manager_0', (manager) => [manager.user]),
|
|
38
39
|
(0, type_graphql_1.ObjectType)({ description: '담당자 관리' })
|
|
39
40
|
], Manager);
|
|
40
|
-
exports.Manager = Manager;
|
|
41
41
|
//# sourceMappingURL=manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../server/service/manager/manager.ts"],"names":[],"mappings":";;;;AAAA,qCAAyG;AACzG,+CAAoD;AAEpD,yDAAgD;AAKzC,IAAM,OAAO,GAAb,MAAM,OAAO;CAoBnB,CAAA;
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../server/service/manager/manager.ts"],"names":[],"mappings":";;;;AAAA,qCAAyG;AACzG,+CAAoD;AAEpD,yDAAgD;AAKzC,IAAM,OAAO,GAAb,MAAM,OAAO;CAoBnB,CAAA;AApBY,0BAAO;AAGT;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACZ;AAId;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACT;AAKjB;IAHC,IAAA,kBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACtB,IAAA,oBAAU,GAAE;IACZ,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACnB,gBAAI;qCAAA;AAGX;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;;uCAChC;kBAnBJ,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;GACzB,OAAO,CAoBnB","sourcesContent":["import { Entity, Index, Column, RelationId, OneToOne, PrimaryGeneratedColumn, JoinColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_manager_0', (manager: Manager) => [manager.user])\n@ObjectType({ description: '담당자 관리' })\nexport class Manager {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, comment: '핸드폰 번호' })\n @Field({ nullable: true })\n phone?: string\n\n @Column({ nullable: true, comment: '직위' })\n @Field({ nullable: true })\n position?: string\n\n @OneToOne(type => User)\n @JoinColumn()\n @Field({ nullable: true })\n user?: User\n\n @RelationId((manager: Manager) => manager.user)\n userId?: string\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProjectMutation = void 0;
|
|
4
|
+
exports.createAttachmentAfterDelete = createAttachmentAfterDelete;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const type_graphql_1 = require("type-graphql");
|
|
6
7
|
const typeorm_1 = require("typeorm");
|
|
@@ -147,16 +148,11 @@ let ProjectMutation = class ProjectMutation {
|
|
|
147
148
|
const stream = createReadStream();
|
|
148
149
|
const chunks = [];
|
|
149
150
|
try {
|
|
150
|
-
for (var _d = true, stream_1 = tslib_1.__asyncValues(stream), stream_1_1; stream_1_1 = await stream_1.next(), _a = stream_1_1.done, !_a;) {
|
|
151
|
+
for (var _d = true, stream_1 = tslib_1.__asyncValues(stream), stream_1_1; stream_1_1 = await stream_1.next(), _a = stream_1_1.done, !_a; _d = true) {
|
|
151
152
|
_c = stream_1_1.value;
|
|
152
153
|
_d = false;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
chunks.push(chunk);
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
_d = true;
|
|
159
|
-
}
|
|
154
|
+
const chunk = _c;
|
|
155
|
+
chunks.push(chunk);
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
158
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -178,6 +174,7 @@ let ProjectMutation = class ProjectMutation {
|
|
|
178
174
|
return true;
|
|
179
175
|
}
|
|
180
176
|
};
|
|
177
|
+
exports.ProjectMutation = ProjectMutation;
|
|
181
178
|
tslib_1.__decorate([
|
|
182
179
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
183
180
|
(0, type_graphql_1.Mutation)(returns => project_1.Project, { description: '프로젝트 생성' }),
|
|
@@ -223,10 +220,9 @@ tslib_1.__decorate([
|
|
|
223
220
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
224
221
|
tslib_1.__metadata("design:returntype", Promise)
|
|
225
222
|
], ProjectMutation.prototype, "deleteProject", null);
|
|
226
|
-
ProjectMutation = tslib_1.__decorate([
|
|
223
|
+
exports.ProjectMutation = ProjectMutation = tslib_1.__decorate([
|
|
227
224
|
(0, type_graphql_1.Resolver)(project_1.Project)
|
|
228
225
|
], ProjectMutation);
|
|
229
|
-
exports.ProjectMutation = ProjectMutation;
|
|
230
226
|
async function createAttachmentAfterDelete(context, file, refBy, refType) {
|
|
231
227
|
if (file === undefined) {
|
|
232
228
|
return null;
|
|
@@ -237,5 +233,4 @@ async function createAttachmentAfterDelete(context, file, refBy, refType) {
|
|
|
237
233
|
let result = await (0, attachment_base_1.createAttachment)(null, { attachment: { file, refType, refBy } }, context);
|
|
238
234
|
return await (0, shell_1.getRepository)(attachment_base_1.Attachment, tx).findOne({ where: { id: result.id } });
|
|
239
235
|
}
|
|
240
|
-
exports.createAttachmentAfterDelete = createAttachmentAfterDelete;
|
|
241
236
|
//# sourceMappingURL=project-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-mutation.js","sourceRoot":"","sources":["../../../server/service/project/project-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AACrD,qEAAuH;AACvH,uCAAiD;AACjD,iDAAqF;AACrF,6DAAiF;AACjF,uHAAwG;AAExG,+DAAwE;AAEjE,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAAC,iBAAO,EAAE,EAAE,CAAC,CAAA;QAC9C,MAAM,mBAAmB,GAAG,IAAA,qBAAa,EAAC,kCAAe,EAAE,EAAE,C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In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\nimport { Attachment, createAttachment, deleteAttachmentsByRef, ATTACHMENT_PATH } from '@things-factory/attachment-base'\nimport { Project, ProjectState } from './project'\nimport { NewProject, ProjectPatch, UploadProjectScheduleTable } from './project-type'\nimport { BuildingComplex, Building, BuildingLevel } from '@dssp/building-complex'\nimport { pdfToImage } from '@things-factory/board-service/dist-server/controllers/headless-pdf-to-image'\n\nimport { parseExcelAndImportTasks } from '../../controllers/parse-excel'\n@Resolver(Project)\nexport class ProjectMutation {\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 생성' })\n async createProject(@Arg('project') project: NewProject, @Ctx() context: ResolverContext): Promise<Project> {\n const { domain, user, tx } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n\n const newBuildingComplex = await buildingComplexRepo.save({\n domain,\n creator: user,\n updater: user\n })\n\n const result = await projectRepo.save({\n name: project.name,\n buildingComplex: newBuildingComplex,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 업데이트' })\n async updateProject(@Arg('project') project: ProjectPatch, @Ctx() context: ResolverContext): Promise<Project> {\n const { user, tx } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n const buildingRepo = getRepository(Building, tx)\n const buildingLevelRepo = getRepository(BuildingLevel, tx)\n\n const buildingComplex = project.buildingComplex\n const buildings = project.buildingComplex?.buildings || []\n\n // 1. 프로젝트 수정\n const projectState = project.totalProgress == 100 ? ProjectState.COMPLETED : ProjectState.ONGOING\n const projectResult = await projectRepo.save({ ...project, state: projectState, updater: user })\n\n // 2. 단지 정보 수정\n await buildingComplexRepo.save({ ...buildingComplex, updater: user })\n\n // 2-1. 프로젝트 메인 이미지 첨부파일 나머지 삭제 후 저장\n await createAttachmentAfterDelete(context, project?.mainPhotoUpload, project.id, Project.name)\n\n // 2-2. 단지 BIM 이미지 첨부파일 나머지 삭제 후 저장\n await createAttachmentAfterDelete(context, buildingComplex?.drawingUpload, buildingComplex.id, BuildingComplex.name + '_bim')\n\n // 3. 동의 층 정보가 바뀌었으면 층 초기화 후 다시 생성\n const originBuilding = await buildingRepo.findBy({ buildingComplex: { id: buildingComplex.id } }) // 이전 동 정보 가져오기\n const afterBuilding = buildings.reduce((acc, building) => ({ ...acc, [building.name]: building.floorCount }), {}) // 비교용으로 수정된 동 정보 데이터 파싱\n const isBuidlingChanged = originBuilding.some(building => afterBuilding[building.name] !== building.floorCount) // 층 개수가 달라진 동이 있는지 확인\n\n // 동의 층 개수가 달라지면 모든 층의 데이터 제거 후 생성\n if (isBuidlingChanged || originBuilding.length !== buildings.length) {\n // 3-1. 기존 동/층 첨부파일 및 데이터 제거\n const buildingIds = originBuilding.map((building: Building) => building.id)\n const buildingLevels = await buildingLevelRepo.findBy({ building: { id: In(buildingIds) } })\n const buildingLevelIds = buildingLevels.map((buildingLevel: BuildingLevel) => buildingLevel.id)\n\n await buildingLevelRepo.softDelete({ building: { id: In(buildingIds) } })\n await buildingRepo.softDelete({ id: In(buildingIds) })\n await deleteAttachmentsByRef(null, { refBys: [...buildingIds, ...buildingLevelIds] }, context)\n\n // 3-2. 단지 내 동 정보들 생성\n for (let buildingKey in buildings) {\n const building = buildings[buildingKey]\n const newBuilding = await buildingRepo.save({\n buildingComplex: buildingComplex,\n name: building.name,\n floorCount: building.floorCount,\n creator: user\n })\n\n // 3-3. 동별로 for문 돌면서 층 데이터 개수대로 생성\n for (let i = 1; i <= building.floorCount; i++) {\n await buildingLevelRepo.save({ building: newBuilding, floor: i, creator: user })\n }\n }\n }\n\n return projectResult\n }\n\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 도면 업데이트' })\n async updateProjectPlan(@Arg('project') project: ProjectPatch, @Ctx() context: ResolverContext): Promise<Project> {\n const { user, tx, domain } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n const buildingRepo = getRepository(Building, tx)\n const buildingLevelRepo = getRepository(BuildingLevel, tx)\n const buildingComplex = project.buildingComplex\n const buildings = project.buildingComplex?.buildings || []\n\n // 1. 프로젝트 수정 시간 업데이트\n const projectResult = await projectRepo.save({ ...project, updater: user })\n\n // 2. 단지 축척 정보 수정\n await buildingComplexRepo.save({ ...buildingComplex, updater: user })\n\n for (let buildingKey in buildings) {\n const building = buildings[buildingKey]\n\n for (let buildingLevelKey in building.buildingLevels) {\n const buildingLevel = building.buildingLevels[buildingLevelKey]\n\n // 3. 층별 도면 이미지 저장\n const mainDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.mainDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_mainDrawing'\n )\n // 첨부된 PDF가 있으면 PDF 파일대로 썸네일 생성\n if (mainDrawingAttatchment) {\n const mainDrawingUpload = await buildingLevel.mainDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${mainDrawingAttatchment.path}` // TODO ATTACHMENT_PATH 제거, mainDrawingAttachment.fullpath 로 해도 될 것 같은데...\n const fileName = mainDrawingUpload.filename.replace('.pdf', '')\n const pngFile = await pdfToImage({ pdfPath, fileName })\n await createAttachmentAfterDelete(context, pngFile, buildingLevel.id, BuildingLevel.name + '_mainDrawing_image')\n\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_mainDrawing_thumbnail'\n )\n }\n\n // 3-1. 입면도 파일 저장\n const elevationDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.elevationDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_elevationDrawing'\n )\n if (elevationDrawingAttatchment) {\n const elevationDrawingUpload = await buildingLevel.elevationDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${elevationDrawingAttatchment.path}`\n const fileName = elevationDrawingUpload.filename.replace('.pdf', '')\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_elevationDrawing_thumbnail'\n )\n }\n\n // 3-2. 철근배분도 파일 저장\n const rebarDistributionDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.rebarDistributionDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_rebarDistributionDrawing'\n )\n if (rebarDistributionDrawingAttatchment) {\n const rebarDistributionDrawingUpload = await buildingLevel.rebarDistributionDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${rebarDistributionDrawingAttatchment.path}`\n const fileName = rebarDistributionDrawingUpload.filename.replace('.pdf', '')\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_rebarDistributionDrawing_thumbnail'\n )\n }\n\n // 3-3. 층 업데이트 시간 갱신\n await buildingLevelRepo.save({ ...buildingLevel, updater: user })\n }\n\n // 4. 동별 도면 이미지 저장\n await createAttachmentAfterDelete(context, building?.drawingUpload, building.id, Building.name)\n\n // 4-1. 동 업데이트 시간 갱신\n await buildingRepo.save({ ...building, updater: user })\n }\n\n return projectResult\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: '프로젝트 공정표 업로드' })\n async uploadProjectScheduleTable(\n @Arg('param') param: UploadProjectScheduleTable,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, user, tx } = context.state\n const { projectId, scheduleTable } = param\n\n const projectRepo = getRepository(Project, tx)\n const project = await projectRepo.findOne({\n where: { domain: { id: domain.id }, id: projectId }\n })\n\n const { createReadStream, filename, mimetype } = await scheduleTable\n\n const stream = createReadStream()\n\n const chunks = []\n for await (const chunk of stream) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n\n await parseExcelAndImportTasks(buffer, project, context)\n // await parseExcelAndImportTasks(attachment.fullpath, project, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Project' })\n async deleteProject(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(Project, tx).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n}\n\nexport async function createAttachmentAfterDelete(context: ResolverContext, file: any, refBy: any, refType: any) {\n if (file === undefined) {\n return null\n }\n\n const { tx } = context.state\n\n // 기존 첨부 파일이 있으면 삭제\n await deleteAttachmentsByRef(null, { refBys: [refBy], refType }, context)\n\n let result = await createAttachment(null, { attachment: { file, refType, refBy } }, context)\n\n return await getRepository(Attachment, tx).findOne({ where: { id: result.id } })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"project-mutation.js","sourceRoot":"","sources":["../../../server/service/project/project-mutation.ts"],"names":[],"mappings":";;;AAiPA,kEAaC;;AA9PD,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AACrD,qEAAuH;AACvH,uCAAiD;AACjD,iDAAqF;AACrF,6DAAiF;AACjF,uHAAwG;AAExG,+DAAwE;AAEjE,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAAC,iBAAO,EAAE,EAAE,CAAC,CAAA;QAC9C,MAAM,mBAAmB,GAAG,IAAA,qBAAa,EAAC,kCAAe,EAAE,EAAE,CAAC,CAAA;QAE9D,MAAM,kBAAkB,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC;YACxD,MAAM;YACN,OAAO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-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\nimport { Attachment, createAttachment, deleteAttachmentsByRef, ATTACHMENT_PATH } from '@things-factory/attachment-base'\nimport { Project, ProjectState } from './project'\nimport { NewProject, ProjectPatch, UploadProjectScheduleTable } from './project-type'\nimport { BuildingComplex, Building, BuildingLevel } from '@dssp/building-complex'\nimport { pdfToImage } from '@things-factory/board-service/dist-server/controllers/headless-pdf-to-image'\n\nimport { parseExcelAndImportTasks } from '../../controllers/parse-excel'\n@Resolver(Project)\nexport class ProjectMutation {\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 생성' })\n async createProject(@Arg('project') project: NewProject, @Ctx() context: ResolverContext): Promise<Project> {\n const { domain, user, tx } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n\n const newBuildingComplex = await buildingComplexRepo.save({\n domain,\n creator: user,\n updater: user\n })\n\n const result = await projectRepo.save({\n name: project.name,\n buildingComplex: newBuildingComplex,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 업데이트' })\n async updateProject(@Arg('project') project: ProjectPatch, @Ctx() context: ResolverContext): Promise<Project> {\n const { user, tx } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n const buildingRepo = getRepository(Building, tx)\n const buildingLevelRepo = getRepository(BuildingLevel, tx)\n\n const buildingComplex = project.buildingComplex\n const buildings = project.buildingComplex?.buildings || []\n\n // 1. 프로젝트 수정\n const projectState = project.totalProgress == 100 ? ProjectState.COMPLETED : ProjectState.ONGOING\n const projectResult = await projectRepo.save({ ...project, state: projectState, updater: user })\n\n // 2. 단지 정보 수정\n await buildingComplexRepo.save({ ...buildingComplex, updater: user })\n\n // 2-1. 프로젝트 메인 이미지 첨부파일 나머지 삭제 후 저장\n await createAttachmentAfterDelete(context, project?.mainPhotoUpload, project.id, Project.name)\n\n // 2-2. 단지 BIM 이미지 첨부파일 나머지 삭제 후 저장\n await createAttachmentAfterDelete(context, buildingComplex?.drawingUpload, buildingComplex.id, BuildingComplex.name + '_bim')\n\n // 3. 동의 층 정보가 바뀌었으면 층 초기화 후 다시 생성\n const originBuilding = await buildingRepo.findBy({ buildingComplex: { id: buildingComplex.id } }) // 이전 동 정보 가져오기\n const afterBuilding = buildings.reduce((acc, building) => ({ ...acc, [building.name]: building.floorCount }), {}) // 비교용으로 수정된 동 정보 데이터 파싱\n const isBuidlingChanged = originBuilding.some(building => afterBuilding[building.name] !== building.floorCount) // 층 개수가 달라진 동이 있는지 확인\n\n // 동의 층 개수가 달라지면 모든 층의 데이터 제거 후 생성\n if (isBuidlingChanged || originBuilding.length !== buildings.length) {\n // 3-1. 기존 동/층 첨부파일 및 데이터 제거\n const buildingIds = originBuilding.map((building: Building) => building.id)\n const buildingLevels = await buildingLevelRepo.findBy({ building: { id: In(buildingIds) } })\n const buildingLevelIds = buildingLevels.map((buildingLevel: BuildingLevel) => buildingLevel.id)\n\n await buildingLevelRepo.softDelete({ building: { id: In(buildingIds) } })\n await buildingRepo.softDelete({ id: In(buildingIds) })\n await deleteAttachmentsByRef(null, { refBys: [...buildingIds, ...buildingLevelIds] }, context)\n\n // 3-2. 단지 내 동 정보들 생성\n for (let buildingKey in buildings) {\n const building = buildings[buildingKey]\n const newBuilding = await buildingRepo.save({\n buildingComplex: buildingComplex,\n name: building.name,\n floorCount: building.floorCount,\n creator: user\n })\n\n // 3-3. 동별로 for문 돌면서 층 데이터 개수대로 생성\n for (let i = 1; i <= building.floorCount; i++) {\n await buildingLevelRepo.save({ building: newBuilding, floor: i, creator: user })\n }\n }\n }\n\n return projectResult\n }\n\n @Directive('@transaction')\n @Mutation(returns => Project, { description: '프로젝트 도면 업데이트' })\n async updateProjectPlan(@Arg('project') project: ProjectPatch, @Ctx() context: ResolverContext): Promise<Project> {\n const { user, tx, domain } = context.state\n const projectRepo = getRepository(Project, tx)\n const buildingComplexRepo = getRepository(BuildingComplex, tx)\n const buildingRepo = getRepository(Building, tx)\n const buildingLevelRepo = getRepository(BuildingLevel, tx)\n const buildingComplex = project.buildingComplex\n const buildings = project.buildingComplex?.buildings || []\n\n // 1. 프로젝트 수정 시간 업데이트\n const projectResult = await projectRepo.save({ ...project, updater: user })\n\n // 2. 단지 축척 정보 수정\n await buildingComplexRepo.save({ ...buildingComplex, updater: user })\n\n for (let buildingKey in buildings) {\n const building = buildings[buildingKey]\n\n for (let buildingLevelKey in building.buildingLevels) {\n const buildingLevel = building.buildingLevels[buildingLevelKey]\n\n // 3. 층별 도면 이미지 저장\n const mainDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.mainDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_mainDrawing'\n )\n // 첨부된 PDF가 있으면 PDF 파일대로 썸네일 생성\n if (mainDrawingAttatchment) {\n const mainDrawingUpload = await buildingLevel.mainDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${mainDrawingAttatchment.path}` // TODO ATTACHMENT_PATH 제거, mainDrawingAttachment.fullpath 로 해도 될 것 같은데...\n const fileName = mainDrawingUpload.filename.replace('.pdf', '')\n const pngFile = await pdfToImage({ pdfPath, fileName })\n await createAttachmentAfterDelete(context, pngFile, buildingLevel.id, BuildingLevel.name + '_mainDrawing_image')\n\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_mainDrawing_thumbnail'\n )\n }\n\n // 3-1. 입면도 파일 저장\n const elevationDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.elevationDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_elevationDrawing'\n )\n if (elevationDrawingAttatchment) {\n const elevationDrawingUpload = await buildingLevel.elevationDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${elevationDrawingAttatchment.path}`\n const fileName = elevationDrawingUpload.filename.replace('.pdf', '')\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_elevationDrawing_thumbnail'\n )\n }\n\n // 3-2. 철근배분도 파일 저장\n const rebarDistributionDrawingAttatchment = await createAttachmentAfterDelete(\n context,\n buildingLevel.rebarDistributionDrawingUpload,\n buildingLevel.id,\n BuildingLevel.name + '_rebarDistributionDrawing'\n )\n if (rebarDistributionDrawingAttatchment) {\n const rebarDistributionDrawingUpload = await buildingLevel.rebarDistributionDrawingUpload\n const pdfPath = `/${ATTACHMENT_PATH}/${rebarDistributionDrawingAttatchment.path}`\n const fileName = rebarDistributionDrawingUpload.filename.replace('.pdf', '')\n const pngThumbnailFile = await pdfToImage({ pdfPath, fileName, defaultViewport: { width: 300, height: 200 } })\n await createAttachmentAfterDelete(\n context,\n pngThumbnailFile,\n buildingLevel.id,\n BuildingLevel.name + '_rebarDistributionDrawing_thumbnail'\n )\n }\n\n // 3-3. 층 업데이트 시간 갱신\n await buildingLevelRepo.save({ ...buildingLevel, updater: user })\n }\n\n // 4. 동별 도면 이미지 저장\n await createAttachmentAfterDelete(context, building?.drawingUpload, building.id, Building.name)\n\n // 4-1. 동 업데이트 시간 갱신\n await buildingRepo.save({ ...building, updater: user })\n }\n\n return projectResult\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: '프로젝트 공정표 업로드' })\n async uploadProjectScheduleTable(\n @Arg('param') param: UploadProjectScheduleTable,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, user, tx } = context.state\n const { projectId, scheduleTable } = param\n\n const projectRepo = getRepository(Project, tx)\n const project = await projectRepo.findOne({\n where: { domain: { id: domain.id }, id: projectId }\n })\n\n const { createReadStream, filename, mimetype } = await scheduleTable\n\n const stream = createReadStream()\n\n const chunks = []\n for await (const chunk of stream) {\n chunks.push(chunk)\n }\n\n const buffer = Buffer.concat(chunks)\n\n await parseExcelAndImportTasks(buffer, project, context)\n // await parseExcelAndImportTasks(attachment.fullpath, project, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Project' })\n async deleteProject(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(Project, tx).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n}\n\nexport async function createAttachmentAfterDelete(context: ResolverContext, file: any, refBy: any, refType: any) {\n if (file === undefined) {\n return null\n }\n\n const { tx } = context.state\n\n // 기존 첨부 파일이 있으면 삭제\n await deleteAttachmentsByRef(null, { refBys: [refBy], refType }, context)\n\n let result = await createAttachment(null, { attachment: { file, refType, refBy } }, context)\n\n return await getRepository(Attachment, tx).findOne({ where: { id: result.id } })\n}\n"]}
|
|
@@ -11,6 +11,7 @@ const task_1 = require("../task/task");
|
|
|
11
11
|
const project_type_1 = require("./project-type");
|
|
12
12
|
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
13
13
|
const building_complex_1 = require("@dssp/building-complex");
|
|
14
|
+
const env_1 = require("@things-factory/env");
|
|
14
15
|
let ProjectQuery = class ProjectQuery {
|
|
15
16
|
async project(id, context) {
|
|
16
17
|
const { domain } = context.state;
|
|
@@ -23,7 +24,7 @@ let ProjectQuery = class ProjectQuery {
|
|
|
23
24
|
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
24
25
|
domain,
|
|
25
26
|
params,
|
|
26
|
-
repository:
|
|
27
|
+
repository: (0, shell_1.getRepository)(project_1.Project),
|
|
27
28
|
searchables: ['name', 'description', 'state']
|
|
28
29
|
});
|
|
29
30
|
const [items, total] = await queryBuilder.getManyAndCount();
|
|
@@ -75,7 +76,11 @@ let ProjectQuery = class ProjectQuery {
|
|
|
75
76
|
async creator(project) {
|
|
76
77
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: project.creatorId });
|
|
77
78
|
}
|
|
79
|
+
async projectType(project) {
|
|
80
|
+
return env_1.config.get('projectType', project_1.ProjectType.DSSP);
|
|
81
|
+
}
|
|
78
82
|
};
|
|
83
|
+
exports.ProjectQuery = ProjectQuery;
|
|
79
84
|
tslib_1.__decorate([
|
|
80
85
|
(0, type_graphql_1.Query)(returns => project_1.Project, { nullable: true, description: 'To fetch a Project' }),
|
|
81
86
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
@@ -149,8 +154,14 @@ tslib_1.__decorate([
|
|
|
149
154
|
tslib_1.__metadata("design:paramtypes", [project_1.Project]),
|
|
150
155
|
tslib_1.__metadata("design:returntype", Promise)
|
|
151
156
|
], ProjectQuery.prototype, "creator", null);
|
|
152
|
-
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
(0, type_graphql_1.FieldResolver)(type => String),
|
|
159
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
160
|
+
tslib_1.__metadata("design:type", Function),
|
|
161
|
+
tslib_1.__metadata("design:paramtypes", [project_1.Project]),
|
|
162
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
163
|
+
], ProjectQuery.prototype, "projectType", null);
|
|
164
|
+
exports.ProjectQuery = ProjectQuery = tslib_1.__decorate([
|
|
153
165
|
(0, type_graphql_1.Resolver)(project_1.Project)
|
|
154
166
|
], ProjectQuery);
|
|
155
|
-
exports.ProjectQuery = ProjectQuery;
|
|
156
167
|
//# sourceMappingURL=project-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-query.js","sourceRoot":"","sources":["../../../server/service/project/project-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qCAAgC;AAChC,iDAAuG;AACvG,yDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"project-query.js","sourceRoot":"","sources":["../../../server/service/project/project-query.ts"],"names":[],"mappings":";;;;AAAA,+C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,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CAkGxB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Arg, Args, Ctx } from 'type-graphql'\nimport { IsNull } from 'typeorm'\nimport { Domain, getRepository, ListParam, getQueryBuilderFromListParams } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Project, ProjectType } from './project'\nimport { Task } from '../task/task'\nimport { ProjectList } from './project-type'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { BuildingComplex } from '@dssp/building-complex'\nimport { config } from '@things-factory/env'\n\n@Resolver(Project)\nexport class ProjectQuery {\n @Query(returns => Project!, { nullable: true, description: 'To fetch a Project' })\n async project(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Project> {\n const { domain } = context.state\n\n return await getRepository(Project).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => ProjectList, { description: '프로젝트 리스트' })\n async projects(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ProjectList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: getRepository(Project),\n searchables: ['name', 'description', 'state']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => Project!, { nullable: true, description: 'To fetch a Project' })\n async projectByBuildingComplexId(\n @Arg('buildingComplexId') buildingComplexId: string,\n @Ctx() context: ResolverContext\n ): Promise<Project> {\n const { domain } = context.state\n\n return await getRepository(Project).findOne({\n where: { domain: { id: domain.id }, buildingComplex: { id: buildingComplexId } }\n })\n }\n\n @FieldResolver(type => [Task], { nullable: true })\n async rootTasks(@Root() project: Project): Promise<Task[]> {\n return await getRepository(Task).find({\n where: {\n project: { id: project.id },\n parent: IsNull()\n }\n })\n }\n\n @FieldResolver(type => Attachment)\n async mainPhoto(@Root() project: Project): Promise<string | Attachment> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: project.domainId },\n refBy: project.id\n },\n order: { createdAt: 'ASC' }\n })\n\n return attachment\n }\n\n @FieldResolver(type => Attachment)\n async scheduleTable(@Root() project: Project): Promise<Attachment | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: project.domainId },\n refBy: project.id,\n refType: Project.name + '_schedule_table'\n }\n })\n\n return attachment\n }\n\n @FieldResolver(type => BuildingComplex)\n async buildingComplex(@Root() project: Project): Promise<BuildingComplex> {\n return await getRepository(BuildingComplex).findOneBy({ id: project.buildingComplexId })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() project: Project): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: project.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() project: Project): Promise<User> {\n return await getRepository(User).findOneBy({ id: project.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() project: Project): Promise<User> {\n return await getRepository(User).findOneBy({ id: project.creatorId })\n }\n\n @FieldResolver(type => String)\n async projectType(@Root() project: Project): Promise<string> {\n return config.get('projectType', ProjectType.DSSP)\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
9
9
|
const building_complex_1 = require("@dssp/building-complex");
|
|
10
10
|
let NewProject = class NewProject {
|
|
11
11
|
};
|
|
12
|
+
exports.NewProject = NewProject;
|
|
12
13
|
tslib_1.__decorate([
|
|
13
14
|
(0, type_graphql_1.Field)({ nullable: false, description: '프로젝트 이름' }),
|
|
14
15
|
tslib_1.__metadata("design:type", String)
|
|
@@ -17,12 +18,12 @@ tslib_1.__decorate([
|
|
|
17
18
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: '연관된 건물 복합체 정보 (선택 사항)' }),
|
|
18
19
|
tslib_1.__metadata("design:type", shell_1.ObjectRef)
|
|
19
20
|
], NewProject.prototype, "buildingComplex", void 0);
|
|
20
|
-
NewProject = tslib_1.__decorate([
|
|
21
|
+
exports.NewProject = NewProject = tslib_1.__decorate([
|
|
21
22
|
(0, type_graphql_1.InputType)()
|
|
22
23
|
], NewProject);
|
|
23
|
-
exports.NewProject = NewProject;
|
|
24
24
|
let ProjectPatch = class ProjectPatch {
|
|
25
25
|
};
|
|
26
|
+
exports.ProjectPatch = ProjectPatch;
|
|
26
27
|
tslib_1.__decorate([
|
|
27
28
|
(0, type_graphql_1.Field)({ nullable: false, description: '수정할 프로젝트의 ID' }),
|
|
28
29
|
tslib_1.__metadata("design:type", String)
|
|
@@ -71,12 +72,12 @@ tslib_1.__decorate([
|
|
|
71
72
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
72
73
|
tslib_1.__metadata("design:type", building_complex_1.BuildingComplexPatch)
|
|
73
74
|
], ProjectPatch.prototype, "buildingComplex", void 0);
|
|
74
|
-
ProjectPatch = tslib_1.__decorate([
|
|
75
|
+
exports.ProjectPatch = ProjectPatch = tslib_1.__decorate([
|
|
75
76
|
(0, type_graphql_1.InputType)()
|
|
76
77
|
], ProjectPatch);
|
|
77
|
-
exports.ProjectPatch = ProjectPatch;
|
|
78
78
|
let UploadProjectScheduleTable = class UploadProjectScheduleTable {
|
|
79
79
|
};
|
|
80
|
+
exports.UploadProjectScheduleTable = UploadProjectScheduleTable;
|
|
80
81
|
tslib_1.__decorate([
|
|
81
82
|
(0, type_graphql_1.Field)({ nullable: false, description: '수정할 프로젝트의 ID' }),
|
|
82
83
|
tslib_1.__metadata("design:type", String)
|
|
@@ -85,12 +86,12 @@ tslib_1.__decorate([
|
|
|
85
86
|
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true, description: '프로젝트 공정표 업로드' }),
|
|
86
87
|
tslib_1.__metadata("design:type", Object)
|
|
87
88
|
], UploadProjectScheduleTable.prototype, "scheduleTable", void 0);
|
|
88
|
-
UploadProjectScheduleTable = tslib_1.__decorate([
|
|
89
|
+
exports.UploadProjectScheduleTable = UploadProjectScheduleTable = tslib_1.__decorate([
|
|
89
90
|
(0, type_graphql_1.InputType)()
|
|
90
91
|
], UploadProjectScheduleTable);
|
|
91
|
-
exports.UploadProjectScheduleTable = UploadProjectScheduleTable;
|
|
92
92
|
let ProjectList = class ProjectList {
|
|
93
93
|
};
|
|
94
|
+
exports.ProjectList = ProjectList;
|
|
94
95
|
tslib_1.__decorate([
|
|
95
96
|
(0, type_graphql_1.Field)(type => [project_1.Project], { description: '프로젝트 리스트 항목들' }),
|
|
96
97
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -99,8 +100,7 @@ tslib_1.__decorate([
|
|
|
99
100
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '전체 프로젝트 수' }),
|
|
100
101
|
tslib_1.__metadata("design:type", Number)
|
|
101
102
|
], ProjectList.prototype, "total", void 0);
|
|
102
|
-
ProjectList = tslib_1.__decorate([
|
|
103
|
+
exports.ProjectList = ProjectList = tslib_1.__decorate([
|
|
103
104
|
(0, type_graphql_1.ObjectType)()
|
|
104
105
|
], ProjectList);
|
|
105
|
-
exports.ProjectList = ProjectList;
|
|
106
106
|
//# sourceMappingURL=project-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../../server/service/project/project-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAuE;AACvE,uCAAmC;AAEnC,+FAA2D;AAC3D,iDAA+D;AAC/D,6DAA6D;AAGtD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;
|
|
1
|
+
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../../server/service/project/project-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAuE;AACvE,uCAAmC;AAEnC,+FAA2D;AAC3D,iDAA+D;AAC/D,6DAA6D;AAGtD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;wCACvC;AAGZ;IADC,IAAA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,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","sourcesContent":["import { ObjectType, Field, InputType, Int, Float } from 'type-graphql'\nimport { Project } from './project'\nimport type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\nimport { BuildingComplexPatch } from '@dssp/building-complex'\n\n@InputType()\nexport class NewProject {\n @Field({ nullable: false, description: '프로젝트 이름' })\n name: string\n\n @Field(type => ObjectRef, { nullable: true, description: '연관된 건물 복합체 정보 (선택 사항)' })\n buildingComplex?: ObjectRef\n}\n\n@InputType()\nexport class ProjectPatch {\n @Field({ nullable: false, description: '수정할 프로젝트의 ID' })\n id: string\n\n @Field({ nullable: false, description: '프로젝트 이름' })\n name: string\n\n @Field({ nullable: true, description: '프로젝트 착공일정' })\n startDate?: string\n\n @Field({ nullable: true, description: '프로젝트 준공일정' })\n endDate?: string\n\n @Field(type => GraphQLUpload, { nullable: true, description: '프로젝트 대표 사진 업로드' })\n mainPhotoUpload?: FileUpload\n\n @Field(type => Float, { nullable: true, description: '프로젝트 전체 진행현황 (%)' })\n totalProgress?: number\n\n @Field(type => Float, { nullable: true, description: '프로젝트 주간 진행현황 (%)' })\n weeklyProgress?: number\n\n @Field(type => Float, { nullable: true, description: '프로젝트 KPI' })\n kpi?: number\n\n @Field(type => Float, { nullable: true, description: '검측/통과 비율 (%)' })\n inspPassRate?: number\n\n @Field(type => Float, { nullable: true, description: '로봇 작업 진행율 (%)' })\n robotProgressRate?: number\n\n @Field(type => Float, { nullable: true, description: '구조 안전도 (%)' })\n structuralSafetyRate?: number\n\n @Field({ nullable: true })\n buildingComplex?: BuildingComplexPatch\n}\n\n@InputType()\nexport class UploadProjectScheduleTable {\n @Field({ nullable: false, description: '수정할 프로젝트의 ID' })\n projectId: string\n\n @Field(type => GraphQLUpload, { nullable: true, description: '프로젝트 공정표 업로드' })\n scheduleTable?: FileUpload\n}\n\n@ObjectType()\nexport class ProjectList {\n @Field(type => [Project], { description: '프로젝트 리스트 항목들' })\n items: Project[]\n\n @Field(type => Int, { description: '전체 프로젝트 수' })\n total: number\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Project = exports.ProjectState = void 0;
|
|
3
|
+
exports.Project = exports.ProjectType = exports.ProjectState = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
@@ -13,9 +13,15 @@ var ProjectState;
|
|
|
13
13
|
(function (ProjectState) {
|
|
14
14
|
ProjectState["ONGOING"] = "10";
|
|
15
15
|
ProjectState["COMPLETED"] = "20";
|
|
16
|
-
})(ProjectState
|
|
16
|
+
})(ProjectState || (exports.ProjectState = ProjectState = {}));
|
|
17
|
+
var ProjectType;
|
|
18
|
+
(function (ProjectType) {
|
|
19
|
+
ProjectType["DSSP"] = "DSSP";
|
|
20
|
+
ProjectType["DCSP"] = "DCSP";
|
|
21
|
+
})(ProjectType || (exports.ProjectType = ProjectType = {}));
|
|
17
22
|
let Project = class Project {
|
|
18
23
|
};
|
|
24
|
+
exports.Project = Project;
|
|
19
25
|
tslib_1.__decorate([
|
|
20
26
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
27
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -140,10 +146,9 @@ tslib_1.__decorate([
|
|
|
140
146
|
(0, type_graphql_1.Field)(type => attachment_base_1.Attachment, { nullable: true }),
|
|
141
147
|
tslib_1.__metadata("design:type", attachment_base_1.Attachment)
|
|
142
148
|
], Project.prototype, "scheduleTable", void 0);
|
|
143
|
-
Project = tslib_1.__decorate([
|
|
149
|
+
exports.Project = Project = tslib_1.__decorate([
|
|
144
150
|
(0, type_graphql_1.ObjectType)({ description: '프로젝트' }),
|
|
145
151
|
(0, typeorm_1.Entity)(),
|
|
146
152
|
(0, typeorm_1.Index)('ix_project_building', (project) => [project.buildingComplex], { unique: true, where: '"deleted_at" IS NULL' })
|
|
147
153
|
], Project);
|
|
148
|
-
exports.Project = Project;
|
|
149
154
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../server/service/project/project.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAoD;AAEpD,iDAAgE;AAChE,yDAAgD;AAChD,uCAAmC;AACnC,6DAAwD;AACxD,qEAA4D;AAE5D,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAgB,CAAA;IAChB,gCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../server/service/project/project.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAoD;AAEpD,iDAAgE;AAChE,yDAAgD;AAChD,uCAAmC;AACnC,6DAAwD;AACxD,qEAA4D;AAE5D,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAgB,CAAA;IAChB,gCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AACD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAKM,IAAM,OAAO,GAAb,MAAM,OAAO;CAuGnB,CAAA;AAvGY,0BAAO;AAGT;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,C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C;;0CAChC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAIlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,4BAAU;8CAAA;kBAtGf,OAAO;IAHnB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACnC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;GAClH,OAAO,CAuGnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToOne,\n OneToMany,\n JoinColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, roundTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Task } from '../task/task'\nimport { BuildingComplex } from '@dssp/building-complex'\nimport { Attachment } from '@things-factory/attachment-base'\n\nexport enum ProjectState {\n 'ONGOING' = '10',\n 'COMPLETED' = '20'\n}\nexport enum ProjectType {\n DSSP = 'DSSP',\n DCSP = 'DCSP'\n}\n\n@ObjectType({ description: '프로젝트' })\n@Entity()\n@Index('ix_project_building', (project: Project) => [project.buildingComplex], { unique: true, where: '\"deleted_at\" IS NULL' })\nexport class Project {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((project: Project) => project.domain)\n domainId?: string\n\n @Column({ nullable: false, comment: '프로젝트 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: false, default: ProjectState.ONGOING, comment: '프로젝트 상태 (10: 진행중, 20: 완료)' })\n @Field({ nullable: false })\n state?: ProjectState\n\n @Column({ type: 'date', nullable: true, comment: '착공일정' })\n @Field({ nullable: true })\n startDate?: string\n\n @Column({ type: 'date', nullable: true, comment: '준공일정' })\n @Field({ nullable: true })\n endDate?: string\n\n // 대표 사진\n @Field(type => Attachment, { nullable: true })\n mainPhoto?: Attachment\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '전체 진행현황' })\n @Field({ nullable: true })\n totalProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '주간 진행현황' })\n @Field({ nullable: true })\n weeklyProgress?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: 'KPI' })\n @Field({ nullable: true })\n kpi?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '검측/통과 비율' })\n @Field({ nullable: true })\n inspPassRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '로봇 작업 진행율' })\n @Field({ nullable: true })\n robotProgressRate?: number\n\n @Column({ type: 'float', nullable: true, default: 0, transformer: roundTransformer, comment: '구조 안전도' })\n @Field({ nullable: true })\n structuralSafetyRate?: number\n\n // 단지 정보 (1:1 테이블 참조)\n @OneToOne(type => BuildingComplex)\n @JoinColumn()\n @Field({ nullable: true })\n buildingComplex?: BuildingComplex\n\n @RelationId((project: Project) => project.buildingComplex)\n buildingComplexId?: string\n\n // 작업 정보 (하위 테이블 참조)\n @OneToMany(() => Task, task => task.project)\n @Field(() => [Task], { nullable: true })\n tasks?: Task[]\n\n // 루트 작업 정보 (부모가 없는 상위 작업)\n @Field(() => [Task], { nullable: true })\n rootTasks?: Task[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((project: Project) => project.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((project: Project) => project.updater)\n updaterId?: string\n\n // 공정표 파일\n @Field(type => Attachment, { nullable: true })\n scheduleTable?: Attachment\n}\n"]}
|
|
@@ -65,6 +65,7 @@ let ResourceMutation = class ResourceMutation {
|
|
|
65
65
|
return true;
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
+
exports.ResourceMutation = ResourceMutation;
|
|
68
69
|
tslib_1.__decorate([
|
|
69
70
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
70
71
|
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
@@ -125,8 +126,7 @@ tslib_1.__decorate([
|
|
|
125
126
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
126
127
|
tslib_1.__metadata("design:returntype", Promise)
|
|
127
128
|
], ResourceMutation.prototype, "importResources", null);
|
|
128
|
-
ResourceMutation = tslib_1.__decorate([
|
|
129
|
+
exports.ResourceMutation = ResourceMutation = tslib_1.__decorate([
|
|
129
130
|
(0, type_graphql_1.Resolver)(resource_1.Resource)
|
|
130
131
|
], ResourceMutation);
|
|
131
|
-
exports.ResourceMutation = ResourceMutation;
|
|
132
132
|
//# sourceMappingURL=resource-mutation.js.map
|