Built files from Bizgaze WebServer
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

contactmanager.js 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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 Contacts;
  17. (function (Contacts) {
  18. let Managers;
  19. (function (Managers) {
  20. class ContactManager extends Unibase.Platform.Core.BaseManager {
  21. changedefaultemail(contactId, contactEmailId) {
  22. return __awaiter(this, void 0, void 0, function* () {
  23. const url = 'apis/v4/bizgaze/crm/contacts/changedefaultemail/contactid/' + contactId + '/contactemailid/' + contactEmailId;
  24. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  25. if (response.result !== null)
  26. response.result = JSON.parse(response.result);
  27. return response;
  28. });
  29. });
  30. }
  31. changedefaultbranch(ContactId, DefaultBranchId) {
  32. return __awaiter(this, void 0, void 0, function* () {
  33. const url = 'apis/v4/bizgaze/crm/contacts/changedefaultbranch/contactid/' + ContactId + '/defaultbranchid/' + DefaultBranchId;
  34. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  35. if (response.result !== null)
  36. response.result = JSON.parse(response.result);
  37. return response;
  38. });
  39. });
  40. }
  41. deletedefaultbranch(UserBranchId) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/bizgaze/crm/contacts/deletedefaultbranch/userbranchid/' + UserBranchId;
  44. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  45. if (response.result !== null)
  46. response.result = JSON.parse(response.result);
  47. return response;
  48. });
  49. });
  50. }
  51. getleadbyleadid(contactId) {
  52. return __awaiter(this, void 0, void 0, function* () {
  53. const url = 'apis/v4/bizgaze/crm/leads/getleadbyleadid/leadid/' + contactId;
  54. return yield this.dataHelper().getAsync(url).then(function (response) {
  55. if (response.result !== null)
  56. response.result = JSON.parse(response.result);
  57. return response;
  58. });
  59. });
  60. }
  61. getleadtagsbyleadid(contactId, formid) {
  62. return __awaiter(this, void 0, void 0, function* () {
  63. const url = 'apis/v4/unibase/platform/forms/bindtagcontroldata/refid/' + contactId + '/formid/' + formid;
  64. return yield this.dataHelper().getAsync(url).then(function (response) {
  65. if (response.result !== null)
  66. response.result = response.result;
  67. return response;
  68. });
  69. });
  70. }
  71. changedefaulturl(contactId, contactUrlId) {
  72. return __awaiter(this, void 0, void 0, function* () {
  73. const url = 'apis/v4/bizgaze/crm/contacts/changedefaulturl/contactid/' + contactId + '/contacturlid/' + contactUrlId;
  74. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  75. if (response.result !== null)
  76. response.result = JSON.parse(response.result);
  77. return response;
  78. });
  79. });
  80. }
  81. changedefaultloginemail(contactId, contactEmailId, userName) {
  82. return __awaiter(this, void 0, void 0, function* () {
  83. const url = 'apis/v4/bizgaze/crm/contacts/changedefaultloginemail/contactid/' + contactId + '/contactemailid/' + contactEmailId + '/username/' + userName;
  84. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  85. if (response.result !== null)
  86. response.result = JSON.parse(response.result);
  87. return response;
  88. });
  89. });
  90. }
  91. changedefaultphone(contactId, contactPhoneId) {
  92. return __awaiter(this, void 0, void 0, function* () {
  93. const url = 'apis/v4/bizgaze/crm/contacts/changedefaultphone/contactid/' + contactId + '/contactnumberid/' + contactPhoneId;
  94. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  95. if (response.result !== null)
  96. response.result = JSON.parse(response.result);
  97. return response;
  98. });
  99. });
  100. }
  101. changedefaultloginphone(contactId, contactPhoneId, userName) {
  102. return __awaiter(this, void 0, void 0, function* () {
  103. const url = 'apis/v4/bizgaze/crm/contacts/changedefaultloginphonenumber/contactid/' + contactId + '/contactnumberid/' + contactPhoneId + '/username/' + userName;
  104. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  105. if (response.result !== null)
  106. response.result = JSON.parse(response.result);
  107. return response;
  108. });
  109. });
  110. }
  111. deleteMappingContact(MappingContactId) {
  112. return __awaiter(this, void 0, void 0, function* () {
  113. const url = 'apis/v4/bizgaze/crm/organization/deletemappingcontact/mappingcontactid/' + MappingContactId;
  114. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  115. if (response.result !== null)
  116. response.result = JSON.parse(response.result);
  117. return response;
  118. });
  119. });
  120. }
  121. getManagerDetails(LobId, AddressId) {
  122. return __awaiter(this, void 0, void 0, function* () {
  123. const url = 'apis/v4/bizgaze/crm/contacts/getmanagerdetails/lobid/' + LobId + '/addressid/' + AddressId;
  124. return yield this.dataHelper().getAsync(url).then(function (response) {
  125. if (response.result !== null)
  126. response.result = JSON.parse(response.result);
  127. return response;
  128. });
  129. });
  130. }
  131. getContactByUserId(UserId) {
  132. return __awaiter(this, void 0, void 0, function* () {
  133. const url = 'apis/v4/bizgaze/crm/contacts/getcontactbyuserid/userid/' + UserId;
  134. return yield this.dataHelper().getAsync(url).then(function (response) {
  135. if (response.result !== null && response.result != "")
  136. response.result = JSON.parse(response.result);
  137. return response;
  138. });
  139. });
  140. }
  141. getContactnumuberdetails(phonenumner) {
  142. return __awaiter(this, void 0, void 0, function* () {
  143. const url = 'apis/v4/bizgaze/crm/contacts/getcontactnumberbynumber/' + phonenumner;
  144. return yield this.dataHelper().getAsync(url).then(function (response) {
  145. if (response.result !== null && response.result != "")
  146. response.result = JSON.parse(response.result);
  147. return response;
  148. });
  149. });
  150. }
  151. getContactDetails(email, phone) {
  152. return __awaiter(this, void 0, void 0, function* () {
  153. const url = 'apis/v4/bizgaze/crm/contacts/getcontactdetailsemailphone/email/' + email + '/phone/' + phone;
  154. return yield this.dataHelper().getAsync(url).then(function (response) {
  155. if (response.result !== null) {
  156. response.result = JSON.parse(response.result);
  157. }
  158. return response;
  159. });
  160. });
  161. }
  162. getAddressByContactId(ContactId) {
  163. return __awaiter(this, void 0, void 0, function* () {
  164. const url = 'apis/v4/bizgaze/crm/address/getdefaultaddressbycontactid/contactid/' + ContactId;
  165. return yield this.dataHelper().getAsync(url).then(function (response) {
  166. if (response.result !== null && response.result != "")
  167. response.result = JSON.parse(response.result);
  168. return response;
  169. });
  170. });
  171. }
  172. ChangeDefaultAddress(postdata) {
  173. return __awaiter(this, void 0, void 0, function* () {
  174. const url = 'apis/v4/bizgaze/crm/address/changedefaultaddress';
  175. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  176. if (response.result !== null)
  177. response.result = JSON.parse(response.result);
  178. return response;
  179. });
  180. });
  181. }
  182. getContactDetailsBycontactid(ContactId) {
  183. return __awaiter(this, void 0, void 0, function* () {
  184. debugger;
  185. const url = 'apis/v4/bizgaze/crm/organization/getorganizationdetails/organizationid/' + ContactId;
  186. return yield this.dataHelper().getAsync(url).then(function (response) {
  187. if (response.result !== null && response.result != "")
  188. response.result = JSON.parse(response.result);
  189. return response;
  190. });
  191. });
  192. }
  193. ChangeAddressStatus(postdata) {
  194. return __awaiter(this, void 0, void 0, function* () {
  195. const url = 'apis/v4/bizgaze/crm/address/changeaddressstatus';
  196. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  197. if (response.result !== null)
  198. response.result = JSON.parse(response.result);
  199. return response;
  200. });
  201. });
  202. }
  203. saveAddressCoordinates(postdata) {
  204. return __awaiter(this, void 0, void 0, function* () {
  205. const url = 'apis/v4/bizgaze/crm/address/saveaddresscoordinates';
  206. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  207. if (response.result !== null)
  208. response.result = JSON.parse(response.result);
  209. return response;
  210. });
  211. });
  212. }
  213. getOrgContact(OrgContactId) {
  214. return __awaiter(this, void 0, void 0, function* () {
  215. const url = 'apis/v4/bizgaze/crm/orgcontacts/getorgcontact/orgcontactid/' + OrgContactId;
  216. return yield this.dataHelper().getAsync(url).then(function (response) {
  217. if (response.result !== null && response.result != "")
  218. response.result = JSON.parse(response.result);
  219. return response;
  220. });
  221. });
  222. }
  223. getsprlOrgContact(OrgContactId) {
  224. return __awaiter(this, void 0, void 0, function* () {
  225. const url = 'apis/v4/bizgaze/sprl/contacts/getorgcontacts/orgcontactid/' + OrgContactId;
  226. return yield this.dataHelper().getAsync(url).then(function (response) {
  227. debugger;
  228. if (response.result !== null && response.result != "")
  229. response.result = JSON.parse(response.result);
  230. return response;
  231. });
  232. });
  233. }
  234. getLatLongByAddress(address) {
  235. return __awaiter(this, void 0, void 0, function* () {
  236. const url = 'apis/v4/bizgaze/crm/orgcontacts/getlatlongbyaddress/address/' + address;
  237. return yield this.dataHelper().getAsync(url).then(function (response) {
  238. if (response.result !== null)
  239. response.result = JSON.parse(response.result);
  240. return response;
  241. });
  242. });
  243. }
  244. getAddressById(ContactAddressId) {
  245. return __awaiter(this, void 0, void 0, function* () {
  246. const url = 'apis/v4/bizgaze/crm/address/getaddressbycontactaddressid/contactaddressid/' + ContactAddressId;
  247. return yield this.dataHelper().getAsync(url).then(function (response) {
  248. if (response.result !== null && response.result != "")
  249. response.result = JSON.parse(response.result);
  250. return response;
  251. });
  252. });
  253. }
  254. getGridForManagers(LobId, ContactId, empId, page, rows) {
  255. return __awaiter(this, void 0, void 0, function* () {
  256. const url = 'apis/v4/bizgaze/crm/contacts/getmanagersbylobandemp/lobid/' + LobId + '/contactid/' + ContactId + '/empid/' + empId + '/page/' + page + '/rows/' + rows;
  257. return yield this.dataHelper().getAsync(url).then(function (response) {
  258. if (response.result !== null)
  259. response.result = JSON.parse(response.result);
  260. return response;
  261. });
  262. });
  263. }
  264. saveManager(postdata) {
  265. return __awaiter(this, void 0, void 0, function* () {
  266. const url = 'apis/v4/bizgaze/crm/organization/changeorganizationmanager';
  267. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  268. if (response.result !== null)
  269. response.result = JSON.parse(response.result);
  270. return response;
  271. });
  272. });
  273. }
  274. getOrganizationDetails(OrganizationId) {
  275. return __awaiter(this, void 0, void 0, function* () {
  276. const url = 'apis/v4/bizgaze/crm/organization/getorganization/organizationid/' + OrganizationId + '';
  277. return yield this.dataHelper().getAsync(url).then(function (response) {
  278. if (response.result !== null)
  279. response.result = JSON.parse(response.result);
  280. return response;
  281. }).fail(function () {
  282. });
  283. });
  284. }
  285. getOrganizationById(OrganizationId) {
  286. return __awaiter(this, void 0, void 0, function* () {
  287. const url = 'apis/v4/bizgaze/crm/organization/getorganizationbyorgid/organizationid/' + OrganizationId + '';
  288. return yield this.dataHelper().getAsync(url).then(function (response) {
  289. if (response.result !== null)
  290. response.result = JSON.parse(response.result);
  291. return response;
  292. }).fail(function () {
  293. });
  294. });
  295. }
  296. getEmployeeManager(employeeid) {
  297. return __awaiter(this, void 0, void 0, function* () {
  298. debugger;
  299. const url = 'apis/v4/bizgaze/crm/contacts/getemployeemanager/employeeid/' + employeeid;
  300. return yield this.dataHelper().getAsync(url).then(function (response) {
  301. if (response.result !== null)
  302. response.result = JSON.parse(response.result);
  303. return response;
  304. });
  305. });
  306. }
  307. getEmployeesByManagerId(employeeId, managerId) {
  308. return __awaiter(this, void 0, void 0, function* () {
  309. debugger;
  310. const url = 'apis/v4/bizgaze/crm/contacts/getemployeesbymanagerid/employeeid/' + employeeId + '/managerid/' + managerId;
  311. return yield this.dataHelper().getAsync(url).then(function (response) {
  312. if (response.result !== null)
  313. response.result = JSON.parse(response.result);
  314. return response;
  315. });
  316. });
  317. }
  318. deletetcscontactcompanies(tcscontactcompanyid) {
  319. return __awaiter(this, void 0, void 0, function* () {
  320. const url = "apis/v4/bizgaze/crm/contacts/deletetcscontactcompanies/id/" + tcscontactcompanyid + "";
  321. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  322. if (response.result !== null)
  323. response.result = JSON.parse(response.result);
  324. return response;
  325. });
  326. });
  327. }
  328. getOrganizationByLeadId(LeadId) {
  329. return __awaiter(this, void 0, void 0, function* () {
  330. const url = 'apis/v4/bizgaze/crm/organization/getorganizationbylead/leadid/' + LeadId + '';
  331. return yield this.dataHelper().getAsync(url).then(function (response) {
  332. if (response.result !== null)
  333. response.result = JSON.parse(response.result);
  334. return response;
  335. }).fail(function () {
  336. });
  337. });
  338. }
  339. GetTenants(tenantid) {
  340. return __awaiter(this, void 0, void 0, function* () {
  341. const url = 'apis/v4/bizgaze/crm/contacts/gettenant/tenantid/' + tenantid;
  342. return yield this.dataHelper().getAsync(url).then(function (response) {
  343. if (response.result !== null) {
  344. response.result = JSON.parse(response.result);
  345. }
  346. return response;
  347. });
  348. });
  349. }
  350. saveSelfDeclaration(obj) {
  351. return __awaiter(this, void 0, void 0, function* () {
  352. const url = 'apis/v4/bizgaze/crm/contacts/saveselfdeclaration';
  353. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  354. if (response.result !== null) {
  355. response.result = JSON.parse(response.result);
  356. }
  357. return response;
  358. });
  359. });
  360. }
  361. getSelfDeclarationByDate(declarationdate, month) {
  362. return __awaiter(this, void 0, void 0, function* () {
  363. const url = 'apis/v4/bizgaze/crm/contacts/getselfdeclarationbydate/declarationdate/' + declarationdate + '/month/' + month;
  364. return yield this.dataHelper().getAsync(url).then(function (response) {
  365. return response;
  366. });
  367. });
  368. }
  369. getOrganizationDetailsByspocid(orgContactId) {
  370. return __awaiter(this, void 0, void 0, function* () {
  371. const url = 'apis/v4/bizgaze/crm/organization/getorganizationbyspocid/orgcontactid/' + orgContactId;
  372. return yield this.dataHelper().getAsync(url).then(function (response) {
  373. if (response.result !== null && response.result != "")
  374. response.result = JSON.parse(response.result);
  375. return response;
  376. });
  377. });
  378. }
  379. getCustomerLocations() {
  380. return __awaiter(this, void 0, void 0, function* () {
  381. const url = 'apis/v4/bizgaze/crm/contacts/getcustomerlocations';
  382. return yield this.dataHelper().getAsync(url).then(function (response) {
  383. if (response.result !== null && response.result != "")
  384. response.result = JSON.parse(response.result);
  385. return response;
  386. });
  387. });
  388. }
  389. changeManager(obj) {
  390. return __awaiter(this, void 0, void 0, function* () {
  391. const url = 'apis/v4/bizgaze/crm/changemanagers/updatemanagerdetails';
  392. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  393. return response;
  394. });
  395. });
  396. }
  397. GetCustomersubtypeDetails(Customertypeid) {
  398. return __awaiter(this, void 0, void 0, function* () {
  399. const url = 'apis/v4/bizgaze/crm/leads/getcustomersubtypes/customertypeid/' + Customertypeid;
  400. return yield this.dataHelper().getAsync(url).then(function (response) {
  401. if (response.result !== null)
  402. response.result = JSON.parse(response.result);
  403. return response;
  404. });
  405. });
  406. }
  407. GetCustomerQualificationDetails(Customerqualificationid) {
  408. return __awaiter(this, void 0, void 0, function* () {
  409. const url = 'apis/v4/bizgaze/crm/leads/getcustomerqualificationdetails/customerqualificationmatrixid/' + Customerqualificationid;
  410. return yield this.dataHelper().getAsync(url).then(function (response) {
  411. if (response.result !== null)
  412. response.result = JSON.parse(response.result);
  413. return response;
  414. });
  415. });
  416. }
  417. GetCustomerSubType(customersubtypeid) {
  418. return __awaiter(this, void 0, void 0, function* () {
  419. const url = 'apis/v4/bizgaze/crm/leads/getcustomersubtypebyid/customersubtypeid/' + customersubtypeid;
  420. return yield this.dataHelper().getAsync(url).then(function (response) {
  421. if (response.result !== null)
  422. response.result = JSON.parse(response.result);
  423. return response;
  424. });
  425. });
  426. }
  427. getEmployeeBrekUp(tagids, fromdate, todate, ownerid, employeeid) {
  428. return __awaiter(this, void 0, void 0, function* () {
  429. const url = 'apis/v4/bizgaze/crm/employees/breakupbyemployeecount/tagids/' + tagids + '/fromdate/' + fromdate + '/todate/' + todate + '/ownerid/' + ownerid + '/employeeid/' + employeeid;
  430. return yield this.dataHelper().getAsync(url).then(function (response) {
  431. if (response.result !== null) {
  432. response.result = JSON.parse(response.result);
  433. }
  434. return response;
  435. });
  436. });
  437. }
  438. getEmployeeBrekUpDesignation(tagids, fromdate, todate, ownerid, employeeid) {
  439. return __awaiter(this, void 0, void 0, function* () {
  440. const url = 'apis/v4/bizgaze/crm/employees/breakupemployeecountbydesignation/tagids/' + tagids + '/fromdate/' + fromdate + '/todate/' + todate + '/ownerid/' + ownerid + '/employeeid/' + employeeid;
  441. return yield this.dataHelper().getAsync(url).then(function (response) {
  442. if (response.result !== null) {
  443. response.result = JSON.parse(response.result);
  444. }
  445. return response;
  446. });
  447. });
  448. }
  449. getEmployee(employeeid) {
  450. return __awaiter(this, void 0, void 0, function* () {
  451. const url = 'apis/v4/bizgaze/crm/employees/getemployeebyid/employeeid/' + employeeid;
  452. return yield this.dataHelper().getAsync(url).then(function (response) {
  453. if (response.result !== null)
  454. response.result = JSON.parse(response.result);
  455. return response;
  456. });
  457. });
  458. }
  459. updateCheckList(workflowchecklistid, leadid, checkliststatus) {
  460. return __awaiter(this, void 0, void 0, function* () {
  461. const url = 'apis/v4/bizgaze/crm/leads/updatechecklist/workflowchecklistid/' + workflowchecklistid + '/leadid/' + leadid + '/checkliststatus/' + checkliststatus;
  462. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  463. if (response.result !== null)
  464. response.result = JSON.parse(response.result);
  465. return response;
  466. });
  467. });
  468. }
  469. getChecklist(Leadid) {
  470. return __awaiter(this, void 0, void 0, function* () {
  471. const url = 'apis/v4/bizgaze/crm/leads/getleadchecklists/leadid/' + Leadid;
  472. return yield this.dataHelper().getAsync(url).then(function (response) {
  473. if (response.result !== null)
  474. response.result = JSON.parse(response.result);
  475. return response;
  476. });
  477. });
  478. }
  479. getalldistributornames() {
  480. return __awaiter(this, void 0, void 0, function* () {
  481. debugger;
  482. const url = 'apis/v4/bizgaze/crm/employees/getalldistributornames';
  483. return yield this.dataHelper().getAsync(url).then(function (response) {
  484. if (response.result !== null)
  485. response.result = JSON.parse(response.result);
  486. return response;
  487. });
  488. });
  489. }
  490. static Instance() {
  491. if (this._instance === undefined)
  492. this._instance = new ContactManager();
  493. return this._instance;
  494. }
  495. }
  496. Managers.ContactManager = ContactManager;
  497. })(Managers = Contacts.Managers || (Contacts.Managers = {}));
  498. })(Contacts = Crm.Contacts || (Crm.Contacts = {}));
  499. })(Crm = Apps.Crm || (Apps.Crm = {}));
  500. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  501. })(Bizgaze || (Bizgaze = {}));