main.service.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. import { Injectable } from "@angular/core";
  2. import { HttpClient, HttpHeaders } from "@angular/common/http";
  3. import host from "../../assets/js/http";
  4. import { resolve } from "q";
  5. import { Observable } from "rxjs";
  6. @Injectable({
  7. providedIn: "root",
  8. })
  9. export class MainService {
  10. constructor(private http: HttpClient) {}
  11. headers = new HttpHeaders({
  12. "Content-Type": "application/json",
  13. "Cache-Control": "no-cache",
  14. });
  15. exportHeader = new HttpHeaders().set("Accept", "*/*"); //导出excel表使用
  16. // 单点登录
  17. singleSignOnLogin(data): any {
  18. return this.http.post(host.host + "/auth/portalLogin", data, {
  19. headers: this.headers,
  20. });
  21. }
  22. // 登录
  23. login(name: string, pwd: string): any {
  24. const data = {
  25. username: name,
  26. password: pwd,
  27. type: "PC",
  28. };
  29. return this.http.post(host.host + "/auth/login", data, {
  30. headers: this.headers,
  31. });
  32. }
  33. // 登出
  34. logOut(): any {
  35. return this.http.delete(host.host + "/auth/logout2", {
  36. headers: this.headers,
  37. });
  38. }
  39. // 修改密码
  40. upPwd(data): any {
  41. return this.http.post(host.host + "/auth/uppwd", data, {
  42. headers: this.headers,
  43. });
  44. }
  45. // 字典表
  46. cachedDictionary = {}; //缓存到内存的字典
  47. getDictionary(type, key, flag = false): any {
  48. const data = {
  49. type: type,
  50. key: key,
  51. };
  52. console.log(this.cachedDictionary, "------------db");
  53. if (flag) {
  54. //特殊情况下处理,flag是true
  55. return this.http.post(host.host + "/common/common/getDictionary", data, {
  56. headers: this.headers,
  57. });
  58. } else if (this.cachedDictionary[key]) {
  59. return new Observable((observer) => {
  60. observer.next(this.cachedDictionary[key]);
  61. });
  62. } else {
  63. return new Observable((observer) => {
  64. this.http
  65. .post(host.host + "/common/common/getDictionary", data, {
  66. headers: this.headers,
  67. })
  68. .subscribe((result) => {
  69. this.cachedDictionary[key] = result;
  70. observer.next(result);
  71. });
  72. });
  73. }
  74. }
  75. //清除字典表缓存
  76. clearDictionary() {
  77. this.cachedDictionary = {};
  78. console.log(this.cachedDictionary, "------clearDb");
  79. }
  80. // 列表搜索(通用)
  81. getFetchDataList(type, target, data): any {
  82. return this.http.post(
  83. host.host + "/" + type + "/fetchDataList/" + target,
  84. data,
  85. { headers: this.headers }
  86. );
  87. }
  88. // 调度台 获取支助人员信息
  89. getSerInfo(type, data): any {
  90. return this.http.post(host.host + "/ser/" + type, data, {
  91. headers: this.headers,
  92. });
  93. }
  94. // 通用操作data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  95. coopData(coop, type, data): any {
  96. return this.http.post(host.host + "/data/" + coop + "/" + type, data, {
  97. headers: this.headers,
  98. });
  99. }
  100. // 清空药品
  101. coopDataM(coop, data): any {
  102. return this.http.post(host.host + "/" + coop, data, {
  103. headers: this.headers,
  104. });
  105. }
  106. // 通用操作user data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  107. coopUserData(coop, type, data): any {
  108. return this.http.post(host.host + "/user/data/" + coop + "/" + type, data, {
  109. headers: this.headers,
  110. });
  111. }
  112. // 获取院区user信息
  113. getHosUser(type, id): any {
  114. return this.http.get(host.host + "/user/data/" + type + "/" + id, {});
  115. }
  116. // 通用操作configuration信息 有操作类型(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  117. coopTypeConfig(coop, type, data): any {
  118. return this.http.post(
  119. host.host + "/configuration/" + coop + "/" + type,
  120. data,
  121. { headers: this.headers }
  122. );
  123. }
  124. // 通用操作configuration信息(新增/更新/删除)
  125. coopConfig(type, data): any {
  126. return this.http.post(host.host + "/configuration/" + type, data, {
  127. headers: this.headers,
  128. });
  129. }
  130. // 权限相关
  131. getPermission(type): any {
  132. return this.http.get(host.host + "/permission/roleMenu/" + type, {
  133. headers: this.headers,
  134. });
  135. }
  136. // fetchData查看详情
  137. getFetchData(type, info, id): any {
  138. return this.http.get(
  139. host.host + "/" + type + "/fetchData/" + info + "/" + id,
  140. { headers: this.headers }
  141. );
  142. }
  143. // 自定义请求 post
  144. postCustom(type, info, data): any {
  145. return this.http.post(host.host + "/" + type + "/" + info, data, {
  146. headers: this.headers,
  147. });
  148. }
  149. // 科室二维码打印flag=1
  150. postCustomCode(type, info, data): any {
  151. return this.http.post(host.host + "/" + type + "/" + info + "/1", data, {
  152. headers: this.headers,
  153. });
  154. }
  155. // 自定义请求 get
  156. getCustom(type, info): any {
  157. return this.http.get(host.host + "/" + type + "/" + info, {
  158. headers: this.headers,
  159. });
  160. }
  161. // 调度台-分派工单
  162. assignWorker(data, type): any {
  163. return this.http.post(host.host + "/workerOrder/" + type, data, {
  164. headers: this.headers,
  165. });
  166. }
  167. // 调度台-删除工单
  168. delOrder(id): any {
  169. return this.http.get(host.host + "/workerOrder/delWorkOrder/" + id, {
  170. headers: this.headers,
  171. });
  172. }
  173. // 工单列表-删除工单
  174. delOrders(ids): any {
  175. return this.http.post(
  176. host.host + "/workerOrder/delWorkOrders",
  177. { ids },
  178. { headers: this.headers }
  179. );
  180. }
  181. // 调度台工单相关
  182. coopWorkerOrder(type, data): any {
  183. return this.http.post(host.host + "/workerOrder/" + type, data, {
  184. headers: this.headers,
  185. });
  186. }
  187. // 调度台-工单历史记录
  188. getWorkOrderLog(id): any {
  189. return this.http.get(host.host + "/ser/fetchWorkOrderLog/" + id, {
  190. headers: this.headers,
  191. });
  192. }
  193. // 综合报表
  194. postReportCount(type, data): any {
  195. return this.http.post(host.host + "/report/orderCount/" + type, data, {
  196. headers: this.headers,
  197. });
  198. }
  199. // 报表导出
  200. exportReport(type, data): any {
  201. return this.http.post(host.host + "/report/export/" + type, data, {
  202. headers: this.exportHeader,
  203. responseType: "arraybuffer",
  204. });
  205. }
  206. dataExport(type, data): any {
  207. return this.http.post(host.host + "/data/export/" + type, data, {
  208. headers: this.exportHeader,
  209. responseType: "arraybuffer",
  210. });
  211. }
  212. //新增/编辑轮巡计划
  213. addRoundRobin(type: string, data: any): any {
  214. return this.http.post(host.host + "/orderPlan/" + type, data, {
  215. headers: this.headers,
  216. });
  217. }
  218. //删除轮巡计划
  219. delRoundRobin(id): any {
  220. return this.http.get(host.host + "/orderPlan/deletePlan/" + id, {
  221. headers: this.headers,
  222. });
  223. }
  224. //启用/停用轮巡计划
  225. switchRoundRobin(isSwitch, id): any {
  226. return this.http.get(
  227. `${host.host}/orderPlan/activePlan/${isSwitch}/${id}`,
  228. { headers: this.headers }
  229. );
  230. }
  231. //新增/编辑快捷建单
  232. addShortcutBuildOrders(type: string, data: any): any {
  233. return this.http.post(host.host + "/api/" + type + "/quickOrder", data, {
  234. headers: this.headers,
  235. });
  236. }
  237. //删除快捷建单
  238. delShortcutBuildOrders(id): any {
  239. return this.http.post(host.host + "/api/rmvData/quickOrder", [id], {
  240. headers: this.headers,
  241. });
  242. }
  243. // 快捷建单二维码批量打印
  244. printShortcutBuildOrders(idArr): any {
  245. return this.http.post(host.host + "/api/orderCodes", idArr, {
  246. headers: this.headers,
  247. });
  248. }
  249. //护士端返回二维码信息,flag=0,动态二维码
  250. getDeptCode(idArr) {
  251. return this.http.post(host.host + "/dept/deptCodes/0", idArr, {
  252. headers: this.headers,
  253. });
  254. }
  255. //药房端打印二维码的接口
  256. printRequisition(idArr) {
  257. return this.http.post(host.host + "/drugsBag/printRequisition", idArr, {
  258. headers: this.headers,
  259. });
  260. }
  261. //药房端待打印变为待配药接口
  262. changeToDispensing(idArr, name) {
  263. return this.http.post(
  264. host.host + "/drugsBag/changeToDispensing/" + name,
  265. idArr,
  266. { headers: this.headers }
  267. );
  268. }
  269. //新建工单->获取新建类型
  270. getAutoWorkTypes(hosId) {
  271. return this.http.get(host.host + "/ser/getAutoWorkTypes/" + hosId, {
  272. headers: this.headers,
  273. });
  274. }
  275. //服务台新建工单—调度台建单获取起点科室或者终点科室列表
  276. getdeptList(taskTypeId) {
  277. return this.http.post(
  278. host.host + "/ser/getdeptList",
  279. { taskTypeId },
  280. { headers: this.headers }
  281. );
  282. }
  283. //服务台新建工单—调度台建单获取患者
  284. getPatientList(data) {
  285. return this.http.post(host.host + "/ser/getPatientInfo", data, {
  286. headers: this.headers,
  287. });
  288. }
  289. //服务台新建工单—调度台建单获取起点科室或者终点科室列表
  290. buildOrder(data) {
  291. return this.http.post(host.host + "/ser/buildOrder", data, {
  292. headers: this.headers,
  293. });
  294. }
  295. //获取当前用户信息
  296. getCurrentUser1() {
  297. return this.http.get(host.host + "/user/data/getCurrentUser", {
  298. headers: this.headers,
  299. });
  300. }
  301. //获取通话记录音频地址
  302. getCallLogPath(data) {
  303. return this.http.post(host.host + "/callLog/getRecordByPath", data, {
  304. headers: this.headers,
  305. });
  306. }
  307. //根据工作分配和人员id获取科室信息
  308. getDeptByUser(data) {
  309. return this.http.post(host.host + "/api/getDeptByUser", data, {
  310. headers: this.headers,
  311. });
  312. }
  313. //根据工作分配和分组id获取科室信息
  314. getDeptByGroup(data) {
  315. return this.http.post(host.host + "/api/getDeptByGroup", data, {
  316. headers: this.headers,
  317. });
  318. }
  319. //微信配置修改
  320. changeWechatConfig(data) {
  321. return this.http.post(
  322. host.host + "/simple/data/addData/wechatConfig",
  323. data,
  324. { headers: this.headers }
  325. );
  326. }
  327. //系统配置修改
  328. changeSysConfig(data) {
  329. return this.http.post(
  330. host.host + "/simple/data/addListData/systemConfiguration",
  331. data,
  332. { headers: this.headers }
  333. );
  334. }
  335. //数据字典楼栋保存接口
  336. saveBuildingList(data) {
  337. return this.http.post(
  338. host.host + "/simple/data/addListData/building",
  339. data,
  340. { headers: this.headers }
  341. );
  342. }
  343. //数据字典楼栋删除接口
  344. delBuildingList(data) {
  345. return this.http.post(host.host + "/simple/data/rmvData/building", data, {
  346. headers: this.headers,
  347. });
  348. }
  349. //数据字典楼层保存接口
  350. saveFloorList(data) {
  351. return this.http.post(host.host + "/simple/data/addListData/floor", data, {
  352. headers: this.headers,
  353. });
  354. }
  355. //数据字典楼层保存接口
  356. delFloorList(data) {
  357. return this.http.post(host.host + "/simple/data/rmvData/floor", data, {
  358. headers: this.headers,
  359. });
  360. }
  361. //simple增删改查,addData新增,addListData批量新增
  362. simplePost(coop, type, data): any {
  363. return this.http.post(
  364. host.host + "/simple/data/" + coop + "/" + type,
  365. data,
  366. { headers: this.headers }
  367. );
  368. }
  369. //api增删改查
  370. apiPost(coop, type, data): any {
  371. return this.http.post(
  372. host.host + "/api/" + coop + "/" + type,
  373. data,
  374. { headers: this.headers }
  375. );
  376. }
  377. //获取工单详情里的历史记录
  378. getWorkOrderRecord(data): any {
  379. return this.http.post(host.host + "/workerOrder/getWorkOrderRecord", data, {
  380. headers: this.headers,
  381. });
  382. }
  383. //刷新字典缓存
  384. refreshDic(): any {
  385. return this.http.post(
  386. host.host + "/common/common/refreshCache",
  387. {},
  388. { headers: this.headers }
  389. );
  390. }
  391. //调度台建单获取可搜索的任务类型列表
  392. getTaskTypeBySearchKey(data): any {
  393. return this.http.post(host.host + "/ser/getTaskTypeBySearchKey", data, {
  394. headers: this.headers,
  395. });
  396. }
  397. //切换院区
  398. changeHospital(data): any {
  399. return this.http.post(host.host + "/auth/changeHospital", data, {
  400. headers: this.headers,
  401. });
  402. }
  403. //刷新缓存
  404. refreshTaskType(): any {
  405. return this.http.get(host.host + "/ser/refreshTaskType", {
  406. headers: this.headers,
  407. });
  408. }
  409. //楼栋配置保存接口
  410. saveBuildings(data) {
  411. return this.http.post(
  412. host.host + "/simple/data/addListData/workOrderGradeBuilding",
  413. data,
  414. { headers: this.headers }
  415. );
  416. }
  417. //删除接口
  418. delBuildings(data) {
  419. return this.http.post(
  420. host.host + "/simple/data/rmvData/workOrderGradeBuilding",
  421. data,
  422. { headers: this.headers }
  423. );
  424. }
  425. //检查信息,患者信息
  426. listMsgByMain(type, data) {
  427. return this.http.post(host.host + "/nurse/" + type, data, {
  428. headers: this.headers,
  429. });
  430. }
  431. //院区系统配置修改
  432. changeHospitalSysConfig(data) {
  433. return this.http.post(
  434. host.host + "/simple/data/addListData/hospitalConfig",
  435. data,
  436. { headers: this.headers }
  437. );
  438. }
  439. //删除用户(包含企业微信用户)
  440. rmvDataAndWeChatNum(data, flag) {
  441. return this.http.post(
  442. host.host + "/user/data/rmvDataAndWeChatNum/" + flag,
  443. data,
  444. {
  445. headers: this.headers,
  446. }
  447. );
  448. }
  449. //数据核对
  450. infoSearch(type, id) {
  451. return this.http.get(host.host + "/testData/view/" + type + "/" + id, {
  452. headers: this.headers,
  453. });
  454. }
  455. // 更新,新增,删除检查类型设置
  456. upDictionary(data) {
  457. return this.http.post(host.host + "/common/common/upDictionary", data, {
  458. headers: this.headers,
  459. });
  460. }
  461. // 护士端定时预约工单立即执行
  462. executeNow(id) {
  463. return this.http.get(host.host + "/api/directStartOrder/" + id, {
  464. headers: this.headers,
  465. });
  466. }
  467. //定时下班列表立即执行
  468. executeNowClassesJob(data) {
  469. return this.http.post(host.host + "/configuration/directOffDuty", data, {
  470. headers: this.headers,
  471. });
  472. }
  473. //轮巡计划列表立即执行
  474. executeNowOrderPlan(id) {
  475. return this.http.get(host.host + "/orderPlan/directOrderPlan/" + id, {
  476. headers: this.headers,
  477. });
  478. }
  479. //查报修列表
  480. listWxIncident(data) {
  481. return this.http.post(host.host + "/itsm/listWxIncident", data, {
  482. headers: this.headers,
  483. });
  484. }
  485. //获取附件图片
  486. wechatRequesterIncident(id) {
  487. return this.http.get(host.host + "/itsm/common/listAttachment/wechatRequesterIncident/" + id, {
  488. headers: this.headers,
  489. });
  490. }
  491. //查报修流程时间
  492. getProcessTime(data,processInstanceId) {
  493. return this.http.post(host.host + "/itsm/bpm/flowTracing/"+processInstanceId, data, {
  494. headers: this.headers,
  495. });
  496. }
  497. //查列表
  498. fetchListBx(type, data) {
  499. return this.http.post(host.host + "/itsm/fetchDataList/" + type, data, {
  500. headers: this.headers,
  501. });
  502. }
  503. //查单个
  504. fetchDataBx(target, id) {
  505. return this.http.post(host.host + "/itsm/fetchData/" + target + "/" + id,{}, {
  506. headers: this.headers,
  507. });
  508. }
  509. //提交报修
  510. addWxIncident(data) {
  511. return this.http.post(host.host + "/itsm/addWxIncident", data, {
  512. headers: this.headers,
  513. });
  514. }
  515. //获取微信报修ID
  516. wxbx(data) {
  517. return this.http.post(host.host + "/itsm/restful/wxbx", data, {
  518. headers: this.headers,
  519. });
  520. }
  521. //获取ITSM字典
  522. getDictionaryByITSM(data) {
  523. return this.http.post(host.host + "/itsm/common/getDictionary", data, {
  524. headers: this.headers,
  525. });
  526. }
  527. //报修评价
  528. degree(data) {
  529. return this.http.post(host.host + "/itsm/bpm/degree", data, {
  530. headers: this.headers,
  531. });
  532. }
  533. //复制院区
  534. copyHosTaskType(data) {
  535. return this.http.post(host.host + "/api/copyHosTaskType", data, {
  536. headers: this.headers,
  537. });
  538. }
  539. //药房端2统计数据
  540. getDrugsBagStateCount(data) {
  541. return this.http.post(host.host + "/ser/getDrugsBagStateCount", data, {
  542. headers: this.headers,
  543. });
  544. }
  545. // 标本视图查询列表接口
  546. specimenView2(data): any {
  547. return this.http.post(
  548. host.host + "/nurse/specimenView2",
  549. data,
  550. { headers: this.headers }
  551. );
  552. }
  553. //问卷发布
  554. managerQuestionnaire(data) {
  555. return this.http.post(
  556. host.host + "/user/data/managerQuestionnaire",
  557. data,
  558. {
  559. headers: this.headers,
  560. }
  561. );
  562. }
  563. //问卷预览
  564. managerQuestionnairePreview(data,token) {
  565. return this.http.post(
  566. host.host + "/api/survey/" + token,
  567. data,
  568. {
  569. headers: this.headers,
  570. }
  571. );
  572. }
  573. //问卷提交答案
  574. surveyCommit(data) {
  575. return this.http.post(
  576. host.host + "/api/survey/commit",
  577. data,
  578. {
  579. headers: this.headers,
  580. }
  581. );
  582. }
  583. //查询回收数据
  584. listQuestionnaire(data) {
  585. return this.http.post(
  586. host.host + "/user/data/listQuestionnaire",
  587. data,
  588. {
  589. headers: this.headers,
  590. }
  591. );
  592. }
  593. //查询楼栋核酸
  594. getNucleicAcidBuildingSummary(data) {
  595. return this.http.post(
  596. host.host + "/workerOrder/nucleicAcidBuildingSummary",
  597. data,
  598. {
  599. headers: this.headers,
  600. }
  601. );
  602. }
  603. //打印楼栋核酸
  604. printNucleicAcid(data) {
  605. return this.http.post(
  606. host.host + "/api/printNucleicAcid",
  607. data,
  608. {
  609. headers: this.headers,
  610. }
  611. );
  612. }
  613. //获取核酸图片
  614. getPreviewImage(type, id) {
  615. return this.http.get(host.host + "/common/common/listAttachment/"+ type +"/" + id, {
  616. headers: this.headers,
  617. });
  618. }
  619. //补充打印楼栋核酸
  620. supplementPrintNucleicAcid(data) {
  621. return this.http.post(
  622. host.host + "/api/supplementPrintNucleicAcid",
  623. data,
  624. {
  625. headers: this.headers,
  626. }
  627. );
  628. }
  629. }