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lB,OAASC,IAAyBmB,EAAoBpB,OAAM,IACxF,EACDjD,KAAU,IAAMlC,KAAKmC,yBAAyBkE,EAA2BjE,GAAIiE,EAA2BhE,QAASgE,EAA2B/D,WAAY+D,EAA2BnG,QAAK,EACxLO,KAAQ,IAAM4F,GAElB,CAEOG,gCAAgCC,EAAmBC,EAAmBC,GAC3E,OAAO3G,KAAKF,WACT4B,KAAK,GAAG1B,KAAKD,qBAAqBQ,sEAAsEkG,eAAuBC,aAAqBC,IAAW,MAC/JnG,QAAKC,KAASC,GAAqBA,GACxC,WAjOWf,0CAA8BiH,MAAAC,MAAAD,MAAAE,KAAA,4BAA9BnH,EAA8BoH,QAA9BpH,EAA8BqH,YAA9BrH,CAA8B,gMCVpC,IAAMsH,EAAyB,UAAAC,EAAhC,MAAOD,qDAAyB,yBAAzBA,iCAHA,CAACE,IAAyB,CAACC,QAASC,IAAsBC,SAAU3H,KAAiC4H,KAA8BC,QAAA,CADpIC,IAA4BC,IAAyBC,MAAkCC,OAItFX,CAAyB,WAFrBY,IAAwC,kBAAAf,IAAA","names":["getColoredYarnSetPaths","productionSchedulePathsOfColoredYarnSets","reedDensityInDentsPerMeter","map","productionSchedulePathsOfColoredYarnSet","coloredYarnSet","productionScheduleColoredYarnSet","result","toJSON","technicalWidthInDents","commercialWidthInMM","convertCommercialUnit","from","unit","Unit","METER","value","convertDentsToWidthInMeter","to","MILLIMETER","HttpProductionSchedulesService","_HttpProductionSchedulesService","constructor","httpClient","backendConfiguration","this","isIdentifierAvailable","name","params","HttpParams","set","get","getAggregatorEndpoint","pipe","rxjsMap","response","productionScheduleNameAvailable","createProductionSchedule","machineSummary","machineQuality","practicalPickDensityInPicksPerMM","coloredYarnSets","creel","runId","mappingForCurrentPositionOnMachine","productConfiguration","isSample","canAddJute","hmiVersion","addToPlanboard","preselectionId","post","getProductionScheduleEndpoint","machine","productionScheduleJSON","ProductionSchedule","fromJSON","decreateProductionOrder","decreatedProductionOrder","switchMap","saveDesignsAndOrderLines","id","designs","orderLines","delete","getAll","of","getById","save","productionSchedule","update","updateWithMachineQualityChanged","isMachineQualityChanged","query","put","getConflicts","conflictsJSON","conflictJSON","Conflict","setProductionSchedulePlan","productionScheduleId","patch","coloredYarnSetPaths","productionSchedulePlanJSON","verifyProductionSchedule","manualSave","productionSchedulePhase","cancelTemporarySavedChanges","getProductionOrderEndpoint","checkVerifyProductionSchedule","type","startDent","coloredYarnSetPathNr","completeAndPlan","completeAndQueue","process","designIds","drawing","orderLineIds","orderLine","getEndpoint","savePreselectionList","orderLinesIds","gridModel","configurationIds","filter","updatePreselectionList","getDesignsAndOrderLines","status","ProductionScheduleStatus","designJSON","isEqual","DrawingType","drawingType","BMP","BmpDrawing","EP","EpDrawing","orderLineJSON","ProductionScheduleOrderLine","getPreselectionListById","orderlinesIds","checkPossibleConflictsWithOrderLines","getDuplicatedProductionOrder","productionscheduleJSON","duplicateProductionOrder","productionOrderToDuplicate","tap","productionOrderJSON","getGeneratedProductionOrderName","machineId","qualityId","creelId","i0","i1","i2","factory","ɵfac","TuftProductionOrderModule","_TuftProductionOrderModule","HttpTuftProductsService","provide","PRODUCTION_SCHEDULES","useClass","UnsavedChangesNotifierService","imports","tuftProductionOrderRouting","TextileDataSharedModule","CanShowErrorForFormControlModule","SharedModule","TuftProductionOrderOverviewPageComponent"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./apps/texconnect/src/app/infrastructure/http/helper/get-colored-yarn-sets-path.ts","./apps/texconnect/src/app/infrastructure/http/production-schedule/http-production-schedules.service.ts","./apps/texconnect/src/app/presentation/pages/texfab/tuft-production-order/tuft-production-order.module.ts"],"sourcesContent":["import {ProductionSchedulePathsOfColoredYarnSet} from '@domain/production-schedule/production-schedule-paths-of-colored-yarn-set';\nimport {OverviewListColoredYarnSetWithStartDent} from '@domain/textile-data/creel/overview-list-colored-yarn-set-with-start-dent';\nimport {convertCommercialUnit, convertDentsToWidthInMeter, Unit} from '@vdw/angular-component-library';\nimport {map} from 'lodash-es';\n\nexport function getColoredYarnSetPaths(productionSchedulePathsOfColoredYarnSets: ProductionSchedulePathsOfColoredYarnSet[], reedDensityInDentsPerMeter: number): any {\n return map(productionSchedulePathsOfColoredYarnSets, (productionSchedulePathsOfColoredYarnSet: ProductionSchedulePathsOfColoredYarnSet) => {\n const coloredYarnSet: OverviewListColoredYarnSetWithStartDent = productionSchedulePathsOfColoredYarnSet.productionScheduleColoredYarnSet;\n const result: any = productionSchedulePathsOfColoredYarnSet.toJSON();\n\n result.technicalWidthInDents = coloredYarnSet.technicalWidthInDents;\n result.commercialWidthInMM = convertCommercialUnit({\n from: {unit: Unit.METER, value: convertDentsToWidthInMeter(coloredYarnSet.technicalWidthInDents, reedDensityInDentsPerMeter)},\n to: Unit.MILLIMETER\n });\n\n return result;\n });\n}\n","import {HttpClient, HttpParams} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {BackendConfiguration} from '@application/configuration/backend-configuration';\nimport {BmpDrawing} from '@domain/production-schedule/bmp-drawing';\nimport {CreelForProductionSchedule} from '@domain/production-schedule/creel-for-production-schedule';\nimport {Drawing} from '@domain/production-schedule/drawing';\nimport {DrawingType} from '@domain/production-schedule/drawing-type.enum';\nimport {EpDrawing} from '@domain/production-schedule/ep-drawing';\nimport {MachineQualityForProductionSchedule} from '@domain/production-schedule/machine-quality-for-production-schedule';\nimport {MachineSummary} from '@domain/production-schedule/machine-summary';\nimport {ProductionSchedule} from '@domain/production-schedule/production-schedule';\nimport {ProductionScheduleOrderLine} from '@domain/production-schedule/production-schedule-order-line';\nimport {ProductionSchedulePathsOfColoredYarnSet} from '@domain/production-schedule/production-schedule-paths-of-colored-yarn-set';\nimport {ProductionSchedulePhase} from '@domain/production-schedule/production-schedule-phase.enum';\nimport {ProductionScheduleProductConfiguration} from '@domain/production-schedule/production-schedule-product-configuration';\nimport {ProductionScheduleStatus} from '@domain/production-schedule/production-schedule-status.enum';\nimport {CreelMap} from '@domain/textile-data/creel/creel-map';\nimport {OverviewListColoredYarnSetWithStartDent} from '@domain/textile-data/creel/overview-list-colored-yarn-set-with-start-dent';\nimport {ZoneType} from '@domain/zone-type.enum';\nimport {ProductionSchedules} from '@infrastructure/http/production-schedule/production-schedules';\nimport {ParametersForPreselection} from '@presentation/pages/texfab/production-schedule/add/plan/parameters-for-preselection';\nimport {ConflictedOrderLine} from '@presentation/pages/texfab/production-schedule/confirm/conflicted-order-line';\nimport {Conflict, GridModel} from '@vdw/angular-component-library';\nimport {isEqual, map} from 'lodash-es';\nimport {Observable, of} from 'rxjs';\nimport {map as rxjsMap, switchMap, tap} from 'rxjs/operators';\nimport {getColoredYarnSetPaths} from '../helper/get-colored-yarn-sets-path';\n\n@Injectable()\nexport class HttpProductionSchedulesService implements ProductionSchedules {\n private httpClient: HttpClient;\n private backendConfiguration: BackendConfiguration;\n\n public constructor(httpClient: HttpClient, backendConfiguration: BackendConfiguration) {\n this.httpClient = httpClient;\n this.backendConfiguration = backendConfiguration;\n }\n\n public isIdentifierAvailable(name: string): Observable {\n const params = new HttpParams().set('name', name);\n\n return this.httpClient.get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/check-name`, {params}).pipe(\n rxjsMap((response: {productionScheduleNameAvailable: boolean}) => {\n return response.productionScheduleNameAvailable;\n })\n );\n }\n\n public createProductionSchedule(\n machineSummary: MachineSummary,\n machineQuality: MachineQualityForProductionSchedule,\n practicalPickDensityInPicksPerMM: number,\n coloredYarnSets: OverviewListColoredYarnSetWithStartDent[],\n creel: CreelForProductionSchedule,\n runId: number,\n mappingForCurrentPositionOnMachine: CreelMap[],\n productConfiguration: ProductionScheduleProductConfiguration,\n isSample: boolean,\n canAddJute: boolean,\n hmiVersion: string,\n addToPlanboard: boolean,\n preselectionId: number\n ): Observable {\n return this.httpClient\n .post(`${this.backendConfiguration.getProductionScheduleEndpoint(2)}productionschedules/initial-create`, {\n machine: machineSummary.toJSON(),\n machineQuality: machineQuality.toJSON(),\n practicalPickDensityInPicksPerMM,\n coloredYarnSets: map(coloredYarnSets, (productionScheduleColoredYarnSet: OverviewListColoredYarnSetWithStartDent) => productionScheduleColoredYarnSet.toJSON()),\n creel: creel.toJSON(),\n runId,\n mappingForCurrentPositionOnMachine,\n productConfiguration: productConfiguration?.toJSON(),\n isSample,\n canAddJute,\n hmiVersion,\n addToPlanboard,\n preselectionId\n })\n .pipe(rxjsMap((productionScheduleJSON: any) => ProductionSchedule.fromJSON(productionScheduleJSON)));\n }\n\n public decreateProductionOrder(decreatedProductionOrder: ProductionSchedule): Observable {\n return this.httpClient\n .post(`${this.backendConfiguration.getProductionScheduleEndpoint(2)}productionschedules/initial-create`, decreatedProductionOrder.toJSON(true))\n .pipe(switchMap(() => this.saveDesignsAndOrderLines(decreatedProductionOrder.id, decreatedProductionOrder.designs, decreatedProductionOrder.orderLines, decreatedProductionOrder.name)));\n }\n\n public delete(id: number | string): Observable {\n return this.httpClient.delete(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}`);\n }\n\n public getAll(): Observable {\n return of([]);\n }\n\n public getById(id: number | string): Observable {\n return this.httpClient\n .get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}`)\n .pipe(rxjsMap((productionScheduleJSON: any) => ProductionSchedule.fromJSON(productionScheduleJSON)));\n }\n\n public save(productionSchedule: ProductionSchedule): Observable {\n return of();\n }\n\n public update(productionSchedule: ProductionSchedule): Observable {\n return of();\n }\n\n public updateWithMachineQualityChanged(productionSchedule: ProductionSchedule, isMachineQualityChanged: boolean = false): Observable {\n const query = isMachineQualityChanged ? '?updatePaths=true' : '';\n\n return this.httpClient.put(\n `${this.backendConfiguration.getProductionScheduleEndpoint()}productionschedules/${productionSchedule.id}${query}`,\n productionSchedule.toJSON(false, isMachineQualityChanged)\n );\n }\n\n public getConflicts(id: number): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}/conflicts`).pipe(\n rxjsMap((conflictsJSON: any) => {\n return map(conflictsJSON, (conflictJSON: any) => {\n return Conflict.fromJSON(conflictJSON);\n });\n })\n );\n }\n\n public setProductionSchedulePlan(\n productionScheduleId: string,\n productionSchedulePathsOfColoredYarnSets: ProductionSchedulePathsOfColoredYarnSet[],\n reedDensityInDentsPerMeter: number\n ): Observable {\n return this.httpClient\n .patch(`${this.backendConfiguration.getProductionScheduleEndpoint()}productionschedules/${productionScheduleId}`, {\n coloredYarnSetPaths: getColoredYarnSetPaths(productionSchedulePathsOfColoredYarnSets, reedDensityInDentsPerMeter)\n })\n .pipe(rxjsMap((productionSchedulePlanJSON: any) => ProductionSchedule.fromJSON(productionSchedulePlanJSON)));\n }\n\n public verifyProductionSchedule(id: string, manualSave: boolean = false, productionSchedulePhase: ProductionSchedulePhase = null): Observable {\n const query = manualSave ? `?manualSave=true&step=${productionSchedulePhase}` : `?manualSave=false&step=${productionSchedulePhase}`;\n\n return this.httpClient\n .get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}/verify${query}`)\n .pipe(rxjsMap((productionSchedulePlanJSON: any) => ProductionSchedule.fromJSON(productionSchedulePlanJSON)));\n }\n\n public cancelTemporarySavedChanges(id: string): Observable {\n return this.httpClient.delete(`${this.backendConfiguration.getProductionOrderEndpoint()}productionschedules/${id}`);\n }\n\n public checkVerifyProductionSchedule(productionScheduleId: string, type: ZoneType, startDent: number, value: number, coloredYarnSetPathNr: number): Observable {\n return this.httpClient\n .post(`${this.backendConfiguration.getProductionScheduleEndpoint()}productionschedules/${productionScheduleId}/verify/check`, {\n type,\n startDent,\n value,\n coloredYarnSetPathNr\n })\n .pipe(rxjsMap((productionSchedulePlanJSON: any) => ProductionSchedule.fromJSON(productionSchedulePlanJSON)));\n }\n\n public completeAndPlan(productionSchedule: ProductionSchedule): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${productionSchedule.id}/complete-and-plan`, productionSchedule.toJSON(true));\n }\n\n public completeAndQueue(productionSchedule: ProductionSchedule): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${productionSchedule.id}/complete-and-queue`, productionSchedule.toJSON(true));\n }\n\n public process(productionSchedule: ProductionSchedule): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${productionSchedule.id}/complete`, productionSchedule.toJSON(true));\n }\n\n public saveDesignsAndOrderLines(id: number | string, designs: Drawing[], orderLines: ProductionScheduleOrderLine[], name: string): Observable {\n const designIds: number[] = designs.map((drawing: Drawing) => drawing.id);\n const orderLineIds: number[] = orderLines.map((orderLine: ProductionScheduleOrderLine) => orderLine.id);\n\n return this.httpClient.post(`${this.backendConfiguration.getEndpoint()}productionschedules/${id}/designs-and-order-lines`, {designIds, orderLineIds, name});\n }\n\n public savePreselectionList(id: number | string, designIds: number[], orderLinesIds: number[], gridModel: GridModel, configurationIds: number[] = []): Observable {\n return this.httpClient\n .post(`${this.backendConfiguration.getProductionOrderEndpoint()}preselections`, {id, designIds, orderLinesIds, configurationIds, filter: gridModel})\n .pipe(rxjsMap((response: any) => response));\n }\n\n public updatePreselectionList(id: number | string, designIds: number[], orderLinesIds: number[], gridModel: GridModel, configurationIds: number[] = []): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getProductionOrderEndpoint()}preselections`, {id, designIds, orderLinesIds, configurationIds, filter: gridModel});\n }\n\n public getDesignsAndOrderLines(id: number | string, status: ProductionScheduleStatus): Observable<{designs: Drawing[]; orderLines: ProductionScheduleOrderLine[]}> {\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}productionschedules/${id}/designs-and-order-lines?status=${ProductionScheduleStatus[status]}`).pipe(\n rxjsMap((response: any) => {\n return {\n designs: map(response.designs, (designJSON: any) => {\n let result: Drawing;\n\n if (isEqual(DrawingType[designJSON.drawingType], DrawingType.BMP)) {\n result = BmpDrawing.fromJSON(designJSON);\n } else if (isEqual(DrawingType[designJSON.drawingType], DrawingType.EP)) {\n result = EpDrawing.fromJSON(designJSON);\n }\n\n return result;\n }),\n orderLines: map(response.orderLines, (orderLineJSON: any) => ProductionScheduleOrderLine.fromJSON(orderLineJSON))\n };\n })\n );\n }\n\n public getPreselectionListById(id: number | string): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getProductionOrderEndpoint()}preselections/${id}`).pipe(\n rxjsMap((response: any) => {\n return {\n designIds: response.designIds,\n configurationIds: response.configurationIds,\n orderlinesIds: response.orderlinesIds,\n gridModel: response.filter\n } as ParametersForPreselection;\n })\n );\n }\n\n public checkPossibleConflictsWithOrderLines(id: string): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}/order-lines/amount-check`);\n }\n\n public getDuplicatedProductionOrder(id: number | string): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/${id}/duplicate`).pipe(\n rxjsMap((productionscheduleJSON: any) => {\n return ProductionSchedule.fromJSON(productionscheduleJSON);\n })\n );\n }\n\n public duplicateProductionOrder(productionOrderToDuplicate: ProductionSchedule): Observable {\n return this.httpClient.post(`${this.backendConfiguration.getProductionScheduleEndpoint(2)}productionschedules/initial-create`, productionOrderToDuplicate.toJSON(true)).pipe(\n tap((productionOrderJSON: any) => {\n productionOrderToDuplicate.id = productionOrderJSON.id;\n productionOrderToDuplicate.status = ProductionScheduleStatus[productionOrderJSON.status];\n }),\n switchMap(() => this.saveDesignsAndOrderLines(productionOrderToDuplicate.id, productionOrderToDuplicate.designs, productionOrderToDuplicate.orderLines, productionOrderToDuplicate.name)),\n rxjsMap(() => productionOrderToDuplicate)\n );\n }\n\n public getGeneratedProductionOrderName(machineId: number, qualityId: number, creelId: number): Observable {\n return this.httpClient\n .post(`${this.backendConfiguration.getAggregatorEndpoint()}productionschedules/generate-name?machineId=${machineId}&qualityId=${qualityId}&creelId=${creelId}`, null)\n .pipe(rxjsMap((response: string) => response));\n }\n}\n","import {NgModule} from '@angular/core';\nimport {UnsavedChangesNotifierService} from '@application/helper/unsaved-changes-notifier/unsaved-changes-notifier.service';\nimport {HttpProductionSchedulesService} from '@infrastructure/http/production-schedule/http-production-schedules.service';\nimport {PRODUCTION_SCHEDULES} from '@infrastructure/http/production-schedule/production-schedules';\nimport {HttpTuftProductsService} from '@infrastructure/http/tuft-product/http-tuft-products.service';\nimport {TextileDataSharedModule} from '@presentation/pages/textile-data/textile-data-shared.module';\nimport {SharedModule} from '@shared/shared.module';\nimport {CanShowErrorForFormControlModule} from '@vdw/angular-component-library';\nimport {AddTuftProductionOrderPageComponent} from './add/add-tuft-production-order-page.component';\nimport {SelectTuftProductComponent} from './add/select-tuft-product/select-tuft-product.component';\nimport {TuftProductionOrderOverviewPageComponent} from './overview/tuft-production-order-overview-page.component';\nimport {TuftProductionOrderSettingsComponent} from './settings/tuft-production-order-settings.component';\nimport {tuftProductionOrderRouting} from './tuft-production-order.routing';\n\n@NgModule({\n imports: [tuftProductionOrderRouting, TextileDataSharedModule, CanShowErrorForFormControlModule, SharedModule],\n providers: [HttpTuftProductsService, {provide: PRODUCTION_SCHEDULES, useClass: HttpProductionSchedulesService}, UnsavedChangesNotifierService],\n declarations: [TuftProductionOrderOverviewPageComponent, AddTuftProductionOrderPageComponent, SelectTuftProductComponent, TuftProductionOrderSettingsComponent]\n})\nexport class TuftProductionOrderModule {}\n"],"x_google_ignoreList":[]}