@fluxhub/fluxhub-lib 1.0.235 → 1.0.236

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.
@@ -12082,61 +12082,109 @@ var win_log = /** @class */ (function () {
12082
12082
  * @fileoverview added by tsickle
12083
12083
  * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
12084
12084
  */
12085
+ var OfficeOperation = /** @class */ (function () {
12086
+ function OfficeOperation() {
12087
+ }
12088
+ return OfficeOperation;
12089
+ }());
12085
12090
  var OfficeAutomatorService = /** @class */ (function () {
12086
- /**
12087
- *
12088
- */
12089
- function OfficeAutomatorService(dataService, fileService, toastr, utility) {
12091
+ function OfficeAutomatorService(dataService, fileService, toastr) {
12090
12092
  this.dataService = dataService;
12091
12093
  this.fileService = fileService;
12092
12094
  this.toastr = toastr;
12093
- this.utility = utility;
12095
+ /**
12096
+ * @param commands
12097
+ * @param options
12098
+ * @export
12099
+ */
12100
+ this.eprog = 0;
12094
12101
  }
12095
12102
  /**
12096
- * @param commands
12097
- * @param options
12098
- * @export
12103
+ * @param {?} operazione
12104
+ * @param {?} v1
12105
+ * @param {?} v2
12106
+ * @param {?} ordine
12107
+ * @return {?}
12108
+ */
12109
+ OfficeAutomatorService.prototype.operation = /**
12110
+ * @param {?} operazione
12111
+ * @param {?} v1
12112
+ * @param {?} v2
12113
+ * @param {?} ordine
12114
+ * @return {?}
12115
+ */
12116
+ function (operazione, v1, v2, ordine) {
12117
+ /** @type {?} */
12118
+ var op = new OfficeOperation();
12119
+ op.op = operazione;
12120
+ op.v1 = v1;
12121
+ op.v2 = v2;
12122
+ op.ord = ordine;
12123
+ return op;
12124
+ };
12125
+ /**
12126
+ * @private
12127
+ * @param {?=} dialogRef_W
12128
+ * @return {?}
12129
+ */
12130
+ OfficeAutomatorService.prototype.progress_update = /**
12131
+ * @private
12132
+ * @param {?=} dialogRef_W
12133
+ * @return {?}
12099
12134
  */
12135
+ function (dialogRef_W) {
12136
+ var _this = this;
12137
+ if (dialogRef_W === void 0) { dialogRef_W = null; }
12138
+ if (dialogRef_W == null)
12139
+ return;
12140
+ if (dialogRef_W.componentInstance == null)
12141
+ return;
12142
+ if (this.eprog >= 100)
12143
+ return;
12144
+ this.eprog += 10;
12145
+ dialogRef_W.componentInstance.update_progess(this.eprog);
12146
+ setTimeout(function () {
12147
+ _this.progress_update(dialogRef_W);
12148
+ }, 2000);
12149
+ };
12100
12150
  /**
12101
- * @export
12151
+ * @param {?} uiid
12102
12152
  * @param {?} commands
12103
- * @param {?} options
12153
+ * @param {?} dialogRef_W
12104
12154
  * @return {?}
12105
12155
  */
12106
12156
  OfficeAutomatorService.prototype.runCommands = /**
12107
- * @export
12157
+ * @param {?} uiid
12108
12158
  * @param {?} commands
12109
- * @param {?} options
12159
+ * @param {?} dialogRef_W
12110
12160
  * @return {?}
12111
12161
  */
12112
- function (commands, options) {
12162
+ function (uiid, commands, dialogRef_W) {
12113
12163
  var _this = this;
12114
- /** @type {?} */
12115
- var uiid = this.utility.newGuid();
12116
- // TODO: check order
12117
- // TODO: check id
12118
- // create job in db
12119
- /** @type {?} */
12120
- var q = '';
12121
- for (var i = 0; i < commands.length; i++) {
12122
- if (q != "") {
12123
- q = q + ";;;";
12124
- }
12125
- q = q + (commands[i].id || uiid) + ";;;" + commands[i].op + ";;;" + (commands[i].v1 || ' ') + ";;;" + (commands[i].v2 || ' ') + ";;;" + (commands[i].ord);
12126
- }
12164
+ this.eprog = 0;
12127
12165
  /** @type {?} */
12128
12166
  var p = new QParam();
12129
- p.sql = "INSERT_CMD_STAMPA_MULTI";
12130
- p.types = ['string', 'string', 'string', 'string', 'int'];
12131
- p.values = [q];
12167
+ p.sql = "INSERT_OFFICE_OPERATION";
12168
+ p.types = ['string', 'string'];
12169
+ commands.sort(function (left, right) {
12170
+ if (left.ord < right.ord)
12171
+ return -1;
12172
+ if (left.ord > right.ord)
12173
+ return 1;
12174
+ });
12175
+ console.log('commands ', commands);
12176
+ p.values = [uiid, JSON.stringify(commands)];
12132
12177
  return this.dataService.doQuery(p).pipe(flatMap(function (data) {
12133
12178
  if (data != null) {
12134
12179
  if (data.result_msg == "OK") {
12135
- // create job file
12136
12180
  /** @type {?} */
12137
12181
  var p_1 = new FSInput();
12138
- p_1.command = "wg_create";
12139
- p_1.p1 = uiid;
12182
+ p_1.command = "exec_app";
12183
+ p_1.p1 = "print_manager";
12184
+ p_1.p2 = uiid;
12185
+ setTimeout(function () {
12186
+ _this.progress_update(dialogRef_W);
12187
+ }, 2000);
12140
12188
  return _this.fileService.doQuery(p_1).pipe(flatMap(function (data) {
12141
12189
  if (data != null && data.result_msg == "OK") {
12142
12190
  // check the job is done
@@ -12148,35 +12196,31 @@ var OfficeAutomatorService = /** @class */ (function () {
12148
12196
  /** @type {?} */
12149
12197
  var timeoutTimer = setTimeout(function () {
12150
12198
  isTimeout = true;
12151
- }, options.timeout || 3 * 60 * 1000);
12152
- // 3 min default timeout
12153
- /** @type {?} */
12154
- var logOffset = 0;
12155
- ck_files();
12199
+ }, 3 * 60 * 1000);
12200
+ ck_files(uiid);
12156
12201
  /**
12157
- *
12202
+ * @param {?} uiid
12158
12203
  * @return {?}
12159
12204
  */
12160
- function ck_files() {
12205
+ function ck_files(uiid) {
12161
12206
  /** @type {?} */
12162
- var p = new FSInput();
12163
- p.command = "wg_getlog";
12164
- p.p1 = uiid;
12165
- p.p2 = logOffset.toString();
12166
- self.fileService.doQuery(p).subscribe(function (data) {
12207
+ var p = new QParam();
12208
+ p.sql = "SELECT_OFFICE_OPERATION_FINISCHED";
12209
+ p.types = ['string'];
12210
+ p.values = [uiid];
12211
+ self.dataService.doQuery(p).subscribe(function (data) {
12167
12212
  if (data != null && data.result_msg == 'OK') {
12168
12213
  /** @type {?} */
12169
- var chunkInfo = data.result_data[0];
12170
- logOffset += chunkInfo.chunk.length;
12171
- subscriber.next(chunkInfo);
12172
- if (chunkInfo.done) {
12214
+ var chunkInfo = data.result_data;
12215
+ if (chunkInfo.length == 1) {
12216
+ subscriber.next({ message: chunkInfo[0].result_message, result: chunkInfo[0].result });
12173
12217
  subscriber.complete();
12174
12218
  }
12175
12219
  else {
12176
12220
  if (!isTimeout) {
12177
12221
  setTimeout(function () {
12178
- ck_files();
12179
- }, options.checkInterval || 3000); // 3 sec default check interval
12222
+ ck_files(uiid);
12223
+ }, 3000); // 3 sec default check interval
12180
12224
  }
12181
12225
  else {
12182
12226
  console.log('Timeout');
@@ -12186,9 +12230,11 @@ var OfficeAutomatorService = /** @class */ (function () {
12186
12230
  }
12187
12231
  }
12188
12232
  else {
12189
- console.error(data);
12190
- subscriber.error(data);
12191
- subscriber.complete();
12233
+ if (!isTimeout) {
12234
+ setTimeout(function () {
12235
+ ck_files(uiid);
12236
+ }, 3000); // 3 sec default check interval
12237
+ }
12192
12238
  }
12193
12239
  });
12194
12240
  }
@@ -12199,37 +12245,6 @@ var OfficeAutomatorService = /** @class */ (function () {
12199
12245
  }
12200
12246
  }));
12201
12247
  };
12202
- /**
12203
- * @param {?} fs_path
12204
- * @param {?} web_path
12205
- * @param {?=} error_msg
12206
- * @return {?}
12207
- */
12208
- OfficeAutomatorService.prototype.send_file_to_user = /**
12209
- * @param {?} fs_path
12210
- * @param {?} web_path
12211
- * @param {?=} error_msg
12212
- * @return {?}
12213
- */
12214
- function (fs_path, web_path, error_msg) {
12215
- var _this = this;
12216
- if (error_msg === void 0) { error_msg = 'errore nella creazione del file'; }
12217
- /** @type {?} */
12218
- var p = new FSInput();
12219
- p.p1 = fs_path;
12220
- p.command = "check_file";
12221
- this.fileService.doQuery(p).subscribe(function (data) {
12222
- if (data != null)
12223
- if (data.msg != "N") {
12224
- window.open(web_path);
12225
- }
12226
- else {
12227
- if (error_msg != null)
12228
- if (error_msg != '')
12229
- _this.toastr.error(error_msg);
12230
- }
12231
- });
12232
- };
12233
12248
  OfficeAutomatorService.decorators = [
12234
12249
  { type: Injectable, args: [{
12235
12250
  providedIn: 'root',
@@ -12239,10 +12254,9 @@ var OfficeAutomatorService = /** @class */ (function () {
12239
12254
  OfficeAutomatorService.ctorParameters = function () { return [
12240
12255
  { type: QueryService },
12241
12256
  { type: FileService },
12242
- { type: ToastrService },
12243
- { type: UtilityService }
12257
+ { type: ToastrService }
12244
12258
  ]; };
12245
- /** @nocollapse */ OfficeAutomatorService.ngInjectableDef = defineInjectable({ factory: function OfficeAutomatorService_Factory() { return new OfficeAutomatorService(inject(QueryService), inject(FileService), inject(ToastrService), inject(UtilityService)); }, token: OfficeAutomatorService, providedIn: "root" });
12259
+ /** @nocollapse */ OfficeAutomatorService.ngInjectableDef = defineInjectable({ factory: function OfficeAutomatorService_Factory() { return new OfficeAutomatorService(inject(QueryService), inject(FileService), inject(ToastrService)); }, token: OfficeAutomatorService, providedIn: "root" });
12246
12260
  return OfficeAutomatorService;
12247
12261
  }());
12248
12262