main.service.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. import { Injectable } from "@angular/core";
  2. import { HttpClient, HttpHeaders } from "@angular/common/http";
  3. import host from "../../assets/js/http";
  4. @Injectable({
  5. providedIn: "root",
  6. })
  7. export class MainService {
  8. constructor(private http: HttpClient) {}
  9. headers = new HttpHeaders({
  10. "Content-Type": "application/json",
  11. "Cache-Control": "no-cache",
  12. });
  13. exportHeader = new HttpHeaders().set("Accept", "*/*"); //导出excel表使用
  14. // 单点登录
  15. singleSignOnLogin(data): any {
  16. return this.http.post(host.host + "/auth/portalLogin", data, {
  17. headers: this.headers,
  18. });
  19. }
  20. // 登录
  21. login(name: string, pwd: string): any {
  22. const data = {
  23. username: name,
  24. password: pwd,
  25. type: "PC",
  26. };
  27. return this.http.post(host.host + "/auth/login", data, {
  28. headers: this.headers,
  29. });
  30. }
  31. // 登出
  32. logOut(): any {
  33. return this.http.delete(host.host + "/auth/logout2", {
  34. headers: this.headers,
  35. });
  36. }
  37. // 修改密码
  38. upPwd(data): any {
  39. return this.http.post(host.host + "/auth/uppwd", data, {
  40. headers: this.headers,
  41. });
  42. }
  43. // 字典表
  44. getDictionary(type, key): any {
  45. const data = {
  46. type: type,
  47. key: key,
  48. };
  49. return this.http.post(host.host + "/common/common/getDictionary", data, {
  50. headers: this.headers,
  51. });
  52. }
  53. // 列表搜索(get data)
  54. getDataFetchData(type, id): any {
  55. return this.http.get(host.host + "/data/fetchData/" + type + "/" + id, {
  56. headers: this.headers,
  57. });
  58. }
  59. // api 详情 -工单详情
  60. getApiFetchData(type, id): any {
  61. return this.http.get(host.host + "/api/fetchData/" + type + "/" + id, {
  62. headers: this.headers,
  63. });
  64. }
  65. // 列表搜索(通用)
  66. getFetchDataList(type, target, data): any {
  67. return this.http.post(
  68. host.host + "/" + type + "/fetchDataList/" + target,
  69. data,
  70. { headers: this.headers }
  71. );
  72. }
  73. // 调度台 获取支助人员信息
  74. getSerInfo(type, data): any {
  75. return this.http.post(host.host + "/ser/" + type, data, {
  76. headers: this.headers,
  77. });
  78. }
  79. // 通用操作data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  80. coopData(coop, type, data): any {
  81. return this.http.post(host.host + "/data/" + coop + "/" + type, data, {
  82. headers: this.headers,
  83. });
  84. }
  85. // 通用操作user data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  86. coopUserData(coop, type, data): any {
  87. return this.http.post(host.host + "/user/data/" + coop + "/" + type, data, {
  88. headers: this.headers,
  89. });
  90. }
  91. // 获取院区user信息
  92. getHosUser(type, id): any {
  93. return this.http.get(host.host + "/user/data/" + type + "/" + id, {});
  94. }
  95. // 通用操作configuration信息 有操作类型(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
  96. coopTypeConfig(coop, type, data): any {
  97. return this.http.post(
  98. host.host + "/configuration/" + coop + "/" + type,
  99. data,
  100. { headers: this.headers }
  101. );
  102. }
  103. // 通用操作configuration信息(新增/更新/删除)
  104. coopConfig(type, data): any {
  105. return this.http.post(host.host + "/configuration/" + type, data, {
  106. headers: this.headers,
  107. });
  108. }
  109. // 查询所有数据
  110. findAllDataList(type): any {
  111. return this.http.post(
  112. host.host + "/data/findAll/" + type,
  113. {},
  114. { headers: this.headers }
  115. );
  116. }
  117. // 权限相关
  118. getPermission(type): any {
  119. return this.http.get(host.host + "/permission/roleMenu/" + type, {
  120. headers: this.headers,
  121. });
  122. }
  123. //科室详情
  124. getOfficeDetail(id): any {
  125. return this.http.get(host.host + "/data/fetchData/department/" + id, {
  126. headers: this.headers,
  127. });
  128. }
  129. // fetchData查看详情
  130. getFetchData(type, info, id?): any {
  131. let url = id
  132. ? host.host + "/" + type + "/fetchData/" + info + "/" + id
  133. : host.host + "/" + type + "/fetchData/" + info;
  134. return this.http.get(url, { headers: this.headers });
  135. }
  136. // 获取楼栋信息/楼层信息
  137. getBuildingOrFloor(type, data): any {
  138. return this.http.post(
  139. host.host + "/data/getBuildingOrFloor/" + type,
  140. data,
  141. { headers: this.headers }
  142. );
  143. }
  144. // 自定义请求 post
  145. postCustom(type, info, data): any {
  146. return this.http.post(host.host + "/" + type + "/" + info, data, {
  147. headers: this.headers,
  148. });
  149. }
  150. // 科室二维码打印flag=1
  151. postCustomCode(type, info, data): any {
  152. return this.http.post(host.host + "/" + type + "/" + info + "/1", data, {
  153. headers: this.headers,
  154. });
  155. }
  156. // 自定义请求 get
  157. getCustom(type, info): any {
  158. return this.http.get(host.host + "/" + type + "/" + info, {
  159. headers: this.headers,
  160. });
  161. }
  162. // 调度台-分派工单
  163. assignWorker(data, type): any {
  164. return this.http.post(host.host + "/workerOrder/" + type, data, {
  165. headers: this.headers,
  166. });
  167. }
  168. // 调度台-删除工单
  169. delOrder(id): any {
  170. return this.http.get(host.host + "/workerOrder/delWorkOrder/" + id, {
  171. headers: this.headers,
  172. });
  173. }
  174. // 工单列表-删除工单
  175. delOrders(ids): any {
  176. return this.http.post(
  177. host.host + "/workerOrder/delWorkOrders",
  178. { ids },
  179. { headers: this.headers }
  180. );
  181. }
  182. // 调度台工单相关
  183. coopWorkerOrder(type, data): any {
  184. return this.http.post(host.host + "/workerOrder/" + type, data, {
  185. headers: this.headers,
  186. });
  187. }
  188. // 调度台-工单历史记录
  189. getWorkOrderLog(id): any {
  190. return this.http.get(host.host + "/ser/fetchWorkOrderLog/" + id, {
  191. headers: this.headers,
  192. });
  193. }
  194. // 综合报表
  195. postReportCount(type, data): any {
  196. return this.http.post(host.host + "/report/orderCount/" + type, data, {
  197. headers: this.headers,
  198. });
  199. }
  200. // 报表导出
  201. exportReport(type, data): any {
  202. return this.http.post(host.host + "/report/export/" + type, data, {
  203. headers: this.exportHeader,
  204. responseType: "arraybuffer",
  205. });
  206. }
  207. dataExport(type, data): any {
  208. return this.http.post(host.host + "/data/export/" + type, data, {
  209. headers: this.exportHeader,
  210. responseType: "arraybuffer",
  211. });
  212. }
  213. //新增/编辑轮巡计划
  214. addRoundRobin(type: string, data: any): any {
  215. return this.http.post(host.host + "/orderPlan/" + type, data, {
  216. headers: this.headers,
  217. });
  218. }
  219. //删除轮巡计划
  220. delRoundRobin(id): any {
  221. return this.http.get(host.host + "/orderPlan/deletePlan/" + id, {
  222. headers: this.headers,
  223. });
  224. }
  225. //启用/停用轮巡计划
  226. switchRoundRobin(isSwitch, id): any {
  227. return this.http.get(
  228. `${host.host}/orderPlan/activePlan/${isSwitch}/${id}`,
  229. { headers: this.headers }
  230. );
  231. }
  232. //新增/编辑快捷建单
  233. addShortcutBuildOrders(type: string, data: any): any {
  234. return this.http.post(host.host + "/api/" + type + "/quickOrder", data, {
  235. headers: this.headers,
  236. });
  237. }
  238. //删除快捷建单
  239. delShortcutBuildOrders(id): any {
  240. return this.http.post(host.host + "/api/rmvData/quickOrder", [id], {
  241. headers: this.headers,
  242. });
  243. }
  244. // 快捷建单二维码批量打印
  245. printShortcutBuildOrders(idArr): any {
  246. return this.http.post(host.host + "/api/orderCodes", idArr, {
  247. headers: this.headers,
  248. });
  249. }
  250. //护士端返回二维码信息,flag=0,动态二维码
  251. getDeptCode(idArr) {
  252. return this.http.post(host.host + "/dept/deptCodes/0", idArr, {
  253. headers: this.headers,
  254. });
  255. }
  256. //药房端药房列表查询、搜索接口
  257. getPharmacyList(idx, type, searchKey, launch) {
  258. return this.http.post(
  259. host.host + "/api/fetchDataList/drugsBag",
  260. {
  261. idx: idx,
  262. sum: 10,
  263. drugsBag: { searchType: type, searchKey: searchKey, launch: launch },
  264. },
  265. { headers: this.headers }
  266. );
  267. }
  268. //药房端打印二维码的接口
  269. printRequisition(idArr) {
  270. return this.http.post(host.host + "/drugsBag/printRequisition", idArr, {
  271. headers: this.headers,
  272. });
  273. }
  274. //药房端待打印变为待配药接口
  275. changeToDispensing(idArr, name) {
  276. return this.http.post(
  277. host.host + "/drugsBag/changeToDispensing/" + name,
  278. idArr,
  279. { headers: this.headers }
  280. );
  281. }
  282. //新建工单->获取新建类型
  283. getAutoWorkTypes(hosId) {
  284. return this.http.get(host.host + "/ser/getAutoWorkTypes/" + hosId, {
  285. headers: this.headers,
  286. });
  287. }
  288. //服务台新建工单—调度台建单获取起点科室或者终点科室列表
  289. getdeptList(taskTypeId) {
  290. return this.http.post(
  291. host.host + "/ser/getdeptList",
  292. { taskTypeId },
  293. { headers: this.headers }
  294. );
  295. }
  296. //服务台新建工单—调度台建单获取患者
  297. getPatientList(data) {
  298. return this.http.post(host.host + "/ser/getPatientInfo", data, {
  299. headers: this.headers,
  300. });
  301. }
  302. //服务台新建工单—调度台建单获取起点科室或者终点科室列表
  303. buildOrder(data) {
  304. return this.http.post(host.host + "/ser/buildOrder", data, {
  305. headers: this.headers,
  306. });
  307. }
  308. //获取当前用户信息
  309. getCurrentUser1() {
  310. return this.http.get(host.host + "/user/data/getCurrentUser", {
  311. headers: this.headers,
  312. });
  313. }
  314. //获取通话记录音频地址
  315. getCallLogPath(data) {
  316. return this.http.post(host.host + "/callLog/getRecordByPath", data, {
  317. headers: this.headers,
  318. });
  319. }
  320. //根据工作分配和人员id获取科室信息
  321. getDeptByUser(data) {
  322. return this.http.post(host.host + "/api/getDeptByUser", data, {
  323. headers: this.headers,
  324. });
  325. }
  326. //根据工作分配和分组id获取科室信息
  327. getDeptByGroup(data) {
  328. return this.http.post(host.host + "/api/getDeptByGroup", data, {
  329. headers: this.headers,
  330. });
  331. }
  332. //微信配置修改
  333. changeWechatConfig(data) {
  334. return this.http.post(
  335. host.host + "/simple/data/addData/wechatConfig",
  336. data,
  337. { headers: this.headers }
  338. );
  339. }
  340. //系统配置修改
  341. changeSysConfig(data) {
  342. return this.http.post(
  343. host.host + "/simple/data/addListData/systemConfiguration",
  344. data,
  345. { headers: this.headers }
  346. );
  347. }
  348. //护士端关注接口
  349. changeFollow(data) {
  350. return this.http.post(host.host + "/nurse/updData/patient", data, {
  351. headers: this.headers,
  352. });
  353. }
  354. //数据字典楼栋保存接口
  355. saveBuildingList(data) {
  356. return this.http.post(
  357. host.host + "/simple/data/addListData/building",
  358. data,
  359. { headers: this.headers }
  360. );
  361. }
  362. //数据字典楼栋删除接口
  363. delBuildingList(data) {
  364. return this.http.post(host.host + "/simple/data/rmvData/building", data, {
  365. headers: this.headers,
  366. });
  367. }
  368. //数据字典楼层保存接口
  369. saveFloorList(data) {
  370. return this.http.post(host.host + "/simple/data/addListData/floor", data, {
  371. headers: this.headers,
  372. });
  373. }
  374. //数据字典楼层保存接口
  375. delFloorList(data) {
  376. return this.http.post(host.host + "/simple/data/rmvData/floor", data, {
  377. headers: this.headers,
  378. });
  379. }
  380. //获取患者最近一条检查信息
  381. getRecentInfo(data) {
  382. return this.http.post(
  383. host.host + "/nurse/workOrder/findInspectRecently",
  384. data,
  385. { headers: this.headers }
  386. );
  387. }
  388. //simple增删改查,addData新增,addListData批量新增
  389. simplePost(coop, type, data): any {
  390. return this.http.post(
  391. host.host + "/simple/data/" + coop + "/" + type,
  392. data,
  393. { headers: this.headers }
  394. );
  395. }
  396. //任务类型列表排序
  397. sortTaskType(data): any {
  398. return this.http.post(host.host + "/configuration/setOrders", data, {
  399. headers: this.headers,
  400. });
  401. }
  402. //获取工单详情里的历史记录
  403. getWorkOrderRecord(data): any {
  404. return this.http.post(host.host + "/workerOrder/getWorkOrderRecord", data, {
  405. headers: this.headers,
  406. });
  407. }
  408. //刷新字典缓存
  409. refreshDic(): any {
  410. return this.http.post(
  411. host.host + "/common/common/refreshCache",
  412. {},
  413. { headers: this.headers }
  414. );
  415. }
  416. //调度台建单获取可搜索的任务类型列表
  417. getTaskTypeBySearchKey(data): any {
  418. return this.http.post(host.host + "/ser/getTaskTypeBySearchKey", data, {
  419. headers: this.headers,
  420. });
  421. }
  422. //切换院区
  423. changeHospital(data): any {
  424. return this.http.post(host.host + "/auth/changeHospital", data, {
  425. headers: this.headers,
  426. });
  427. }
  428. //刷新缓存
  429. refreshTaskType(): any {
  430. return this.http.get(host.host + "/ser/refreshTaskType", {
  431. headers: this.headers,
  432. });
  433. }
  434. //楼栋配置保存接口
  435. saveBuildings(data) {
  436. return this.http.post(
  437. host.host + "/simple/data/addListData/workOrderGradeBuilding",
  438. data,
  439. { headers: this.headers }
  440. );
  441. }
  442. //删除接口
  443. delBuildings(data) {
  444. return this.http.post(
  445. host.host + "/simple/data/rmvData/workOrderGradeBuilding",
  446. data,
  447. { headers: this.headers }
  448. );
  449. }
  450. //获取配置文件的接口
  451. systemConfiguration(data) {
  452. return this.http.post(
  453. host.host + "/simple/data/fetchDataList/systemConfiguration",
  454. data,
  455. { headers: this.headers }
  456. );
  457. }
  458. //检查信息,患者信息
  459. listMsgByMain(type, data) {
  460. return this.http.post(host.host + "/nurse/" + type, data, {
  461. headers: this.headers,
  462. });
  463. }
  464. //院区系统配置修改
  465. changeHospitalSysConfig(data) {
  466. return this.http.post(
  467. host.host + "/simple/data/addListData/hospitalConfig",
  468. data,
  469. { headers: this.headers }
  470. );
  471. }
  472. //护士端获取综合日志
  473. listDeptOrderRecord(data) {
  474. return this.http.post(host.host + "/nurse/listDeptOrderRecord", data, {
  475. headers: this.headers,
  476. });
  477. }
  478. //自动同步国家法定节假日
  479. syncWorkDay(data) {
  480. return this.http.post(host.host + "/configuration/syncWorkDay", data, {
  481. headers: this.headers,
  482. });
  483. }
  484. //删除用户(包含企业微信用户)
  485. rmvDataAndWeChatNum(data, flag) {
  486. return this.http.post(
  487. host.host + "/user/data/rmvDataAndWeChatNum/" + flag,
  488. data,
  489. {
  490. headers: this.headers,
  491. }
  492. );
  493. }
  494. }