Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

gpslocationmanager.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let Crm;
  15. (function (Crm) {
  16. let Employees;
  17. (function (Employees) {
  18. let Managers;
  19. (function (Managers) {
  20. class GpsLocationmanager extends Unibase.Platform.Core.BaseManager {
  21. getLocations(url) {
  22. return __awaiter(this, void 0, void 0, function* () {
  23. return yield this.dataHelper().getAsync(url).then(function (response) {
  24. if (response.result !== null)
  25. response.result = JSON.parse(response.result);
  26. return response;
  27. });
  28. });
  29. }
  30. GetGPSTrackingCount(fromdate) {
  31. return __awaiter(this, void 0, void 0, function* () {
  32. const url = 'apis/v4/bizgaze/crm/employees/getgpsusertrackingcount/fromdate/' + fromdate;
  33. return yield this.dataHelper().getAsync(url).then(function (response) {
  34. if (response.result !== null)
  35. response.result = JSON.parse(response.result);
  36. return response;
  37. });
  38. });
  39. }
  40. SaveGpsUser(postdata) {
  41. return __awaiter(this, void 0, void 0, function* () {
  42. const url = 'apis/v4/GPS/savegpsuser';
  43. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  44. if (response.result !== null)
  45. response.result = JSON.parse(response.result);
  46. return response;
  47. });
  48. });
  49. }
  50. GetGpsUser(id) {
  51. return __awaiter(this, void 0, void 0, function* () {
  52. const url = 'apis/v4/GPS/getgpsuser/employeeid/' + id;
  53. return yield this.dataHelper().getAsync(url).then(function (response) {
  54. if (response.result !== null)
  55. response.result = JSON.parse(response.result);
  56. return response;
  57. });
  58. });
  59. }
  60. GetEmployees(branchid) {
  61. return __awaiter(this, void 0, void 0, function* () {
  62. const url = 'apis/v4/bizgaze/crm/employees/getemployeelist/branchid/' + branchid;
  63. return yield this.dataHelper().getAsync(url).then(function (response) {
  64. if (response.result !== null)
  65. response.result = JSON.parse(response.result);
  66. return response;
  67. });
  68. });
  69. }
  70. GetGPSUSerDetails(detailstype, serverdate) {
  71. return __awaiter(this, void 0, void 0, function* () {
  72. const url = 'apis/v4/GPS/getgpsuserdetails/detailstype/' + detailstype + '/fromdate/' + serverdate;
  73. return yield this.dataHelper().getAsync(url).then(function (response) {
  74. if (response.result !== null)
  75. response.result = JSON.parse(response.result);
  76. return response;
  77. });
  78. });
  79. }
  80. GetCustomerDetailsByRouteId(RouteId) {
  81. return __awaiter(this, void 0, void 0, function* () {
  82. const url = 'apis/v4/bizgaze/crm/contacts/getcustomerdetailsbyrouteid/routeid/' + RouteId;
  83. return yield this.dataHelper().getAsync(url).then(function (response) {
  84. if (response.result !== null)
  85. response.result = JSON.parse(response.result);
  86. return response;
  87. });
  88. });
  89. }
  90. SaveTrip(postdata) {
  91. return __awaiter(this, void 0, void 0, function* () {
  92. const url = 'apis/v4/GPS/savetrip';
  93. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  94. if (response.result !== null)
  95. return response;
  96. });
  97. });
  98. }
  99. SaveTripTrack(postdata) {
  100. return __awaiter(this, void 0, void 0, function* () {
  101. const url = 'apis/v4/GPS/savetriptrack';
  102. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  103. if (response.result !== null)
  104. return response;
  105. });
  106. });
  107. }
  108. GetRouteById(RouteId) {
  109. return __awaiter(this, void 0, void 0, function* () {
  110. const url = 'apis/v4/GPS/getroutebyid/routeid/' + RouteId;
  111. return yield this.dataHelper().getAsync(url).then(function (response) {
  112. return response;
  113. });
  114. });
  115. }
  116. GetMyMeterReading() {
  117. return __awaiter(this, void 0, void 0, function* () {
  118. const url = 'apis/v4/GPS/getmymeterreading';
  119. return yield this.dataHelper().getAsync(url).then(function (response) {
  120. return response;
  121. });
  122. });
  123. }
  124. GetMeterReading(meterReadingId) {
  125. return __awaiter(this, void 0, void 0, function* () {
  126. const url = 'apis/v4/GPS/MeterReading/meterid/' + meterReadingId;
  127. return yield this.dataHelper().getAsync(url).then(function (response) {
  128. return response;
  129. });
  130. });
  131. }
  132. saveTripMeterReading(postdata) {
  133. return __awaiter(this, void 0, void 0, function* () {
  134. const url = 'apis/v4/GPS/savetripmeterreading';
  135. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  136. if (response.result !== null)
  137. return response;
  138. });
  139. });
  140. }
  141. GetCustomerLocationsByTripGroupId(TripGroupId) {
  142. return __awaiter(this, void 0, void 0, function* () {
  143. debugger;
  144. const url = 'apis/v4/bizgaze/crm/contacts/getcustomerlocationsbytripgroupid/tripgroupid/' + TripGroupId;
  145. return yield this.dataHelper().getAsync(url).then(function (response) {
  146. if (response.result !== null)
  147. response.result = JSON.parse(response.result);
  148. return response;
  149. });
  150. });
  151. }
  152. getuserlocationsbyuseridanddatetime(userid, tracktime) {
  153. return __awaiter(this, void 0, void 0, function* () {
  154. debugger;
  155. const url = 'apis/v4/bizgaze/crm/gpslocation/getuserlocationsbyuseridanddatetime/userid/' + userid + '/tracktime/' + tracktime;
  156. return yield this.dataHelper().getAsync(url).then(function (response) {
  157. if (response.result !== null)
  158. response.result = JSON.parse(response.result);
  159. return response;
  160. });
  161. });
  162. }
  163. static Instance() {
  164. if (this._instance === undefined)
  165. this._instance = new GpsLocationmanager();
  166. return this._instance;
  167. }
  168. }
  169. Managers.GpsLocationmanager = GpsLocationmanager;
  170. })(Managers = Employees.Managers || (Employees.Managers = {}));
  171. })(Employees = Crm.Employees || (Crm.Employees = {}));
  172. })(Crm = Apps.Crm || (Apps.Crm = {}));
  173. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  174. })(Bizgaze || (Bizgaze = {}));