@seniorsistemas/yms-integration 1.18.3 → 1.19.0

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.
Files changed (24) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +25 -25
  2. package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
  5. package/esm2015/src/devices/balancas/balancas.service.js +4 -1
  6. package/esm2015/src/devices/balancas/visualiar-balanca/visualizar-balanca.component.js +8 -25
  7. package/esm2015/src/devices/balancas/weightScale.js +1 -1
  8. package/esm2015/src/sam-senior/components/visitor-edit/visitor-edit-form/visitante-form/visitor-edit-form.component.js +2 -2
  9. package/esm2015/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.js +11 -1
  10. package/esm5/src/devices/balancas/balancas.service.js +4 -1
  11. package/esm5/src/devices/balancas/visualiar-balanca/visualizar-balanca.component.js +8 -25
  12. package/esm5/src/devices/balancas/weightScale.js +1 -1
  13. package/esm5/src/sam-senior/components/visitor-edit/visitor-edit-form/visitante-form/visitor-edit-form.component.js +2 -2
  14. package/esm5/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.js +12 -1
  15. package/fesm2015/seniorsistemas-yms-integration.js +22 -23
  16. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  17. package/fesm5/seniorsistemas-yms-integration.js +23 -23
  18. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  19. package/package.json +1 -1
  20. package/seniorsistemas-yms-integration.metadata.json +1 -1
  21. package/src/devices/balancas/balancas.service.d.ts +1 -0
  22. package/src/devices/balancas/visualiar-balanca/visualizar-balanca.component.d.ts +2 -11
  23. package/src/devices/balancas/weightScale.d.ts +2 -2
  24. package/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.d.ts +1 -0
@@ -12,9 +12,9 @@ import { MessageService, DynamicDialogRef, DynamicDialogConfig, DialogService, C
12
12
  import { ControleCircuito, ControleOperacao, IntegrationDispatcher, CircuitoFinalizado, ControleUnificado, ChegadaVeiculo, IntegrationEventsCallback, IntegrationModule, ChegadaVeiculoOverride, Agendamento } from '@seniorsistemas/yms-routines';
13
13
  import { trigger, state, style, transition, animate } from '@angular/animations';
14
14
  import { PermissionsModule } from '@seniorsistemas/platform-components';
15
- import { StompService, StompConfig } from '@stomp/ng2-stompjs';
16
- import { CookieService } from 'ngx-cookie-service';
15
+ import { StompConfig, StompService } from '@stomp/ng2-stompjs';
17
16
  import * as SockJS from 'sockjs-client';
17
+ import { CookieService } from 'ngx-cookie-service';
18
18
  import { DynamicDialogModule } from 'primeng/components/dynamicdialog/dynamicdialog';
19
19
  import { TooltipModule, SharedModule, CardModule, DialogModule, PanelModule, InputTextModule as InputTextModule$1, DropdownModule, ConfirmDialogModule, TabViewModule, CalendarModule } from 'primeng/primeng';
20
20
  import { SelectPlantService, SelectPlantModule } from '@seniorsistemas/yms-components';
@@ -375,6 +375,9 @@ var BalancasService = /** @class */ (function (_super) {
375
375
  BalancasService.prototype.fallbackCall = function (balanca, peso) {
376
376
  return this.http.post(this.urlBalanca + "actions/manualWeight", { code: balanca, weight: peso }).pipe(this.defaultCatch());
377
377
  };
378
+ BalancasService.prototype.getStabilizedWeight = function (code) {
379
+ return this.http.post(this.urlBalanca + "queries/getStabilizedWeight", { code: code }).pipe(this.defaultCatch());
380
+ };
378
381
  BalancasService.prototype.getWeightScaleByCode = function (code) {
379
382
  var params = {
380
383
  displayFields: ["description", "code"],
@@ -408,13 +411,10 @@ var VisualizarBalancaDescritor = /** @class */ (function () {
408
411
  }());
409
412
  var VisualizarBalancaComponent = /** @class */ (function (_super) {
410
413
  __extends(VisualizarBalancaComponent, _super);
411
- function VisualizarBalancaComponent(service, client, cookieService) {
414
+ function VisualizarBalancaComponent(service) {
412
415
  var _this = _super.call(this) || this;
413
416
  _this.service = service;
414
- _this.client = client;
415
- _this.cookieService = cookieService;
416
417
  _this.loading = false;
417
- _this.websocket = new IntegrationWebSocket(_this.client, _this.cookieService, 'integration');
418
418
  _this.unsubscribe$ = new Subject();
419
419
  _this.weightScales$ = new BehaviorSubject([]);
420
420
  _this.weightScaleValues = new Map();
@@ -432,19 +432,10 @@ var VisualizarBalancaComponent = /** @class */ (function (_super) {
432
432
  _this.weightScales$.next(contents);
433
433
  contents.forEach(function (value) {
434
434
  _this.weightScaleValues.set(value.id, 0);
435
- });
436
- });
437
- this.websocket.connect(function (url, client) {
438
- client.subscribe(url + "wsWeightScale")
439
- .pipe(map(function (message) { return message.body; }), map(function (body) { return JSON.parse(body).data; }), takeUntil(_this.unsubscribe$))
440
- .subscribe(function (payload) {
441
- if (!_this.weightScales$.value.length)
442
- return;
443
- var index = _this.weightScales$.value.findIndex(function (value) { return value.id === payload.weightScale.id; });
444
- if (index < 0)
445
- return;
446
- var find = _this.weightScales$.value[index];
447
- _this.weightScaleValues.set(find.id, payload.weight);
435
+ _this.service.getStabilizedWeight(value.code)
436
+ .subscribe(function (stabilized) {
437
+ _this.weightScaleValues.set(value.id, stabilized.weight);
438
+ });
448
439
  });
449
440
  });
450
441
  };
@@ -461,9 +452,7 @@ var VisualizarBalancaComponent = /** @class */ (function (_super) {
461
452
  selector: 'visualizar-balanca-component',
462
453
  template: "<div *sLoadingState=\"loading\">\n <p-table [value]=\"weightScales$ | async\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th>C\u00F3digo</th>\n <th>Descri\u00E7\u00E3o</th>\n <th>Peso</th>\n </tr>\n </ng-template>\n <ng-template let-rowData pTemplate=\"body\">\n <tr>\n <td>{{rowData.code}}</td>\n <td>{{rowData.description}}</td>\n <td>{{weightScaleValues.get(rowData.id)}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>"
463
454
  }),
464
- __metadata("design:paramtypes", [BalancasService,
465
- StompService,
466
- CookieService])
455
+ __metadata("design:paramtypes", [BalancasService])
467
456
  ], VisualizarBalancaComponent);
468
457
  return VisualizarBalancaComponent;
469
458
  }(VisualizarBalancaDescritor));
@@ -1808,7 +1797,7 @@ var VisitanteFormComponent = /** @class */ (function () {
1808
1797
  if (!this.formGroup.valid) {
1809
1798
  return this.validateAllFormFields(this.formGroup);
1810
1799
  }
1811
- var visitante = this.formGroup.value;
1800
+ var visitante = this.formGroup.getRawValue();
1812
1801
  visitante.id = this.id;
1813
1802
  this.close(visitante);
1814
1803
  };
@@ -1987,6 +1976,17 @@ var VisitanteComponent = /** @class */ (function () {
1987
1976
  .subscribe(function (visitante) { return _this.adicionaVisitanteParaSalvar(visitante); });
1988
1977
  };
1989
1978
  VisitanteComponent.prototype.adicionaVisitanteParaSalvar = function (visitante) {
1979
+ var _this = this;
1980
+ this.visitanteGridData.forEach(function (visitor) {
1981
+ if (visitor.document === visitante.document) {
1982
+ visitor.contact = visitante.contact;
1983
+ visitor.name = visitante.name;
1984
+ _this.visitorFound = true;
1985
+ }
1986
+ });
1987
+ if (this.visitorFound) {
1988
+ return;
1989
+ }
1990
1990
  this.visitanteGridLoading = true;
1991
1991
  visitante.documentType = this.getDocumentType();
1992
1992
  if (visitante.visitorSituation === undefined) {