ConsoleController.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. package com.diagbot.web;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.diagbot.annotation.SysLogger;
  4. import com.diagbot.dto.AverageStatisticsDTO;
  5. import com.diagbot.dto.DeptNumDTO;
  6. import com.diagbot.dto.EntryNumDTO;
  7. import com.diagbot.dto.EntryStatisticsDTO;
  8. import com.diagbot.dto.HomePageNumDTO;
  9. import com.diagbot.dto.LevelStatisticsDTO;
  10. import com.diagbot.dto.LevelStatisticsTZDTO;
  11. import com.diagbot.dto.NumDTO;
  12. import com.diagbot.dto.QcResultShortDTO;
  13. import com.diagbot.dto.RespDTO;
  14. import com.diagbot.facade.ConsoleFacade;
  15. import com.diagbot.vo.EntryStatisticsVO;
  16. import com.diagbot.vo.FilterOrderVO;
  17. import com.diagbot.vo.FilterPageByAverageVO;
  18. import com.diagbot.vo.FilterPageVO;
  19. import com.diagbot.vo.FilterVO;
  20. import com.diagbot.vo.QcResultShortPageVO;
  21. import io.swagger.annotations.Api;
  22. import io.swagger.annotations.ApiOperation;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.web.bind.annotation.PostMapping;
  25. import org.springframework.web.bind.annotation.RequestBody;
  26. import org.springframework.web.bind.annotation.RequestMapping;
  27. import org.springframework.web.bind.annotation.RestController;
  28. import springfox.documentation.annotations.ApiIgnore;
  29. import javax.validation.Valid;
  30. import java.util.List;
  31. import java.util.Map;
  32. /**
  33. * @Description:
  34. * @Author:zhaops
  35. * @time: 2020/4/13 16:45
  36. */
  37. @RequestMapping("/console")
  38. @RestController
  39. @Api(value = "控制台统计相关API", tags = { "控制台统计相关API" })
  40. @SuppressWarnings("unchecked")
  41. public class ConsoleController {
  42. @Autowired
  43. private ConsoleFacade consoleFacade;
  44. //region-----------------------聚合接口开始-------------------------------
  45. @ApiOperation(value = "病历相关统计[by:zhaops]",
  46. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  47. @PostMapping("/mrStatistics")
  48. @SysLogger("mrStatistics")
  49. @ApiIgnore
  50. public RespDTO<Map<String, Object>> mrStatistics(@RequestBody @Valid FilterVO filterVO) {
  51. Map<String, Object> data = consoleFacade.mrStatistics(filterVO);
  52. return RespDTO.onSuc(data);
  53. }
  54. @ApiOperation(value = "缺陷相关统计[by:zhaops]",
  55. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  56. @PostMapping("/resultStatistics")
  57. @SysLogger("resultStatistics")
  58. @ApiIgnore
  59. public RespDTO<Map<String, Object>> resultStatistics(@RequestBody @Valid FilterVO filterVO) {
  60. Map<String, Object> data = consoleFacade.resultStatistics(filterVO);
  61. return RespDTO.onSuc(data);
  62. }
  63. @ApiOperation(value = "平均值相关统计[by:zhaops]",
  64. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  65. @PostMapping("/averageStatistics")
  66. @SysLogger("averageStatistics")
  67. @ApiIgnore
  68. public RespDTO<Map<String, Object>> averageStatistics(@RequestBody @Valid FilterVO filterVO) {
  69. Map<String, Object> data = consoleFacade.averageStatistics(filterVO);
  70. return RespDTO.onSuc(data);
  71. }
  72. //endregion-----------------------聚合接口结束-------------------------------
  73. //region-----------------------单独接口开始-------------------------------
  74. /**
  75. * 平均住院天数
  76. *
  77. * @param filterVO
  78. * @return
  79. */
  80. @ApiOperation(value = "平均住院天数[by:zhaops]",
  81. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  82. @PostMapping("/getAverageDayNum")
  83. @SysLogger("getAverageDayNum")
  84. public RespDTO<Map<String, Object>> getAverageDayNum(@RequestBody @Valid FilterVO filterVO) {
  85. return RespDTO.onSuc(consoleFacade.getAverageDayNum(filterVO));
  86. }
  87. /**
  88. * 平均住院费用
  89. *
  90. * @param filterVO
  91. * @return
  92. */
  93. @ApiOperation(value = "平均住院费用[by:zhaops]",
  94. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  95. @PostMapping("/getAverageFee")
  96. @SysLogger("getAverageFee")
  97. public RespDTO<Map<String, Object>> getAverageFee(@RequestBody @Valid FilterVO filterVO) {
  98. return RespDTO.onSuc(consoleFacade.getAverageFee(filterVO));
  99. }
  100. /**
  101. * 质控平均分按科室统计
  102. *
  103. * @param filterVO
  104. * @return
  105. */
  106. @ApiOperation(value = "质控平均分按科室统计[by:zhaops]",
  107. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  108. @PostMapping("/getAverageScore")
  109. @SysLogger("getAverageScore")
  110. public RespDTO<Map<String, Object>> getAverageScore(@RequestBody @Valid FilterVO filterVO) {
  111. return RespDTO.onSuc(consoleFacade.getAverageScore(filterVO));
  112. }
  113. /**
  114. * 各科室质控平均分(首页)-根据内外科系统统计
  115. *
  116. * @param filterVO
  117. * @return
  118. */
  119. @ApiOperation(value = "各科室质控平均分(首页)-根据内外科系统统计[by:zhaops]",
  120. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  121. "deptClass: 科室分类:内科/外科,全部不传 <br>")
  122. @PostMapping("/getAverageScoreByDeptClass")
  123. @SysLogger("getAverageScoreByDeptClass")
  124. public RespDTO<Map<String, Object>> getAverageScoreByDeptClass(@RequestBody @Valid FilterVO filterVO) {
  125. return RespDTO.onSuc(consoleFacade.getAverageScoreByDeptClass(filterVO));
  126. }
  127. /**
  128. * 各科室甲级病历占比
  129. *
  130. * @param filterVO
  131. * @return
  132. */
  133. @ApiOperation(value = "各科室甲级病历占比[by:zhaops]",
  134. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  135. @PostMapping("/getLevelResultDept")
  136. @SysLogger("getLevelResultDept")
  137. public RespDTO<Map<String, Object>> getLevelResultDept(@RequestBody @Valid FilterVO filterVO) {
  138. return RespDTO.onSuc(consoleFacade.getLevelResultDept(filterVO));
  139. }
  140. /**
  141. * 出院人数统计
  142. *
  143. * @param filterVO
  144. * @return
  145. */
  146. @ApiOperation(value = "出院人数统计[by:zhaops]",
  147. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  148. @PostMapping("/leaveHosCount")
  149. @SysLogger("leaveHosCount")
  150. public RespDTO<Map<String, Object>> leaveHosCount(@RequestBody @Valid FilterVO filterVO) {
  151. return RespDTO.onSuc(consoleFacade.leaveHosCount(filterVO));
  152. }
  153. /**
  154. * 质控病历统计
  155. *
  156. * @param filterVO
  157. * @return
  158. */
  159. @ApiOperation(value = "质控病历统计[by:zhaops]",
  160. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  161. @PostMapping("/mrCount")
  162. @SysLogger("mrCount")
  163. public RespDTO<Map<String, Object>> mrCount(@RequestBody @Valid FilterVO filterVO) {
  164. return RespDTO.onSuc(consoleFacade.mrCount(filterVO));
  165. }
  166. /**
  167. * 各模块缺陷占比排行
  168. *
  169. * @param filterVO
  170. * @return
  171. */
  172. @ApiOperation(value = "各模块缺陷占比排行(首页)[by:zhaops]",
  173. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  174. @PostMapping("/entryCountGroupByCase")
  175. @SysLogger("entryCountGroupByCase")
  176. public RespDTO<Map<String, Object>> entryCountGroupByCase(@RequestBody @Valid FilterVO filterVO) {
  177. return RespDTO.onSuc(consoleFacade.entryCountGroupByCase(filterVO));
  178. }
  179. /**
  180. * 条目缺陷占比
  181. *
  182. * @param filterVO
  183. * @return
  184. */
  185. @ApiOperation(value = "条目缺陷占比(首页)[by:zhaops]",
  186. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  187. "isReject: 单项否决 1-否决,0-非<br>" +
  188. "casesName: 模块名称<br>")
  189. @PostMapping("/entryCountGroupByEntry")
  190. @SysLogger("entryCountGroupByEntry")
  191. public RespDTO<Map<String, Object>> entryCountGroupByEntry(@RequestBody @Valid FilterVO filterVO) {
  192. return RespDTO.onSuc(consoleFacade.entryCountGroupByEntry(filterVO));
  193. }
  194. /**
  195. * 单项否决缺陷占比
  196. *
  197. * @param filterVO
  198. * @return
  199. */
  200. @ApiOperation(value = "单项否决缺陷占比(首页)[by:zhaops]",
  201. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  202. @PostMapping("/entryRejectPercent")
  203. @SysLogger("entryRejectPercent")
  204. public RespDTO<List<EntryNumDTO>> entryRejectPercent(@RequestBody @Valid FilterVO filterVO) {
  205. return RespDTO.onSuc(consoleFacade.entryRejectPercent(filterVO));
  206. }
  207. /**
  208. * 单项否决缺陷占比
  209. *
  210. * @param filterVO
  211. * @return
  212. */
  213. @ApiOperation(value = "各科室甲/乙/丙级病历占比(首页)[by:zhaops]",
  214. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  215. "level: 病历等级 甲、乙、丙(必填)<br>")
  216. @PostMapping("/qcResultLevelPercent")
  217. @SysLogger("qcResultLevelPercent")
  218. public RespDTO<List<DeptNumDTO>> qcResultLevelPercent(@RequestBody @Valid FilterVO filterVO) {
  219. return RespDTO.onSuc(consoleFacade.qcResultLevelPercent(filterVO));
  220. }
  221. /**
  222. * 各科室缺陷占比
  223. *
  224. * @param filterVO
  225. * @return
  226. */
  227. @ApiOperation(value = "各科室缺陷占比[by:zhaops]",
  228. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  229. @PostMapping("/entryByDept")
  230. @SysLogger("entryByDept")
  231. public RespDTO<Map<String, Object>> entryByDept(@RequestBody @Valid FilterVO filterVO) {
  232. return RespDTO.onSuc(consoleFacade.entryByDept(filterVO));
  233. }
  234. //endregion-----------------------单独接口结束-------------------------------
  235. //region-----------------------分页接口开始-------------------------------
  236. /**
  237. * 各模块缺陷占比(分页)
  238. *
  239. * @param filterPageVO
  240. * @return
  241. */
  242. @ApiOperation(value = "各模块缺陷占比(分页)[by:zhaops]",
  243. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  244. @PostMapping("/entryCountGroupByCasePage")
  245. @SysLogger("entryCountGroupByCasePage")
  246. public RespDTO<IPage<NumDTO>> entryCountGroupByCasePage(@RequestBody @Valid FilterPageVO filterPageVO) {
  247. return RespDTO.onSuc(consoleFacade.entryCountGroupByCasePage(filterPageVO));
  248. }
  249. /**
  250. * 条目缺陷占比(分页)
  251. *
  252. * @param filterPageVO
  253. * @return
  254. */
  255. @ApiOperation(value = "缺陷详情(分页)[by:zhaops]",
  256. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  257. "deptName: 科室名称 <br>" +
  258. "casesId: 模块id:243=病案首页 <br>" +
  259. "casesName: 模块名称 <br>" +
  260. "isReject: 单项否决 1-否决,0-非<br>" +
  261. "ruleType: 规则类型 0:无,1:空项,2:错误<br>")
  262. @PostMapping("/entryCountGroupByEntryPage")
  263. @SysLogger("entryCountGroupByEntryPage")
  264. public RespDTO<IPage<EntryNumDTO>> entryCountGroupByEntryPage(@RequestBody @Valid FilterPageVO filterPageVO) {
  265. return RespDTO.onSuc(consoleFacade.entryCountGroupByEntryPage(filterPageVO));
  266. }
  267. /**
  268. * 按科室统计平均住院天数(分页)
  269. *
  270. * @param filterPageByAverageVO
  271. * @return
  272. */
  273. @ApiOperation(value = "按科室统计平均住院天数(分页)[by:zhaops]",
  274. notes = "type: 统计维度 1-本月,2-本年<br>" +
  275. "dateType: 时间类型 1-本月/本年,2-上月/去年,3-去年本月/去年<br>")
  276. @PostMapping("/getAverageDayNumPage")
  277. @SysLogger("getAverageDayNumPage")
  278. public RespDTO<IPage<AverageStatisticsDTO>> getAverageDayNumPage(@RequestBody @Valid FilterPageByAverageVO filterPageByAverageVO) {
  279. return RespDTO.onSuc(consoleFacade.getAverageDayNumPage(filterPageByAverageVO));
  280. }
  281. /**
  282. * 按科室统计平均住院费用(分页)
  283. *
  284. * @param filterPageByAverageVO
  285. * @return
  286. */
  287. @ApiOperation(value = "按科室统计平均住院费用(分页)[by:zhaops]",
  288. notes = "type: 统计维度 1-本月,2-本年<br>" +
  289. "dateType: 时间类型 1-本月/本年,2-上月/去年,3-去年本月/去年<br>")
  290. @PostMapping("/getAverageFeePage")
  291. @SysLogger("getAverageFeePage")
  292. public RespDTO<IPage<AverageStatisticsDTO>> getAverageFeePage(@RequestBody @Valid FilterPageByAverageVO filterPageByAverageVO) {
  293. return RespDTO.onSuc(consoleFacade.getAverageFeePage(filterPageByAverageVO));
  294. }
  295. /**
  296. * 各科室质控平均分(分页)
  297. *
  298. * @param filterPageVO
  299. * @return
  300. */
  301. @ApiOperation(value = "各科室质控平均分(分页)[by:zhaops]",
  302. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  303. @PostMapping("/getAverageScoreByDeptPage")
  304. @SysLogger("getAverageScoreByDeptPage")
  305. public RespDTO<IPage<AverageStatisticsDTO>> getAverageScoreByDeptPage(@RequestBody @Valid FilterPageVO filterPageVO) {
  306. return RespDTO.onSuc(consoleFacade.getAverageScoreByDeptPage(filterPageVO));
  307. }
  308. /**
  309. * 各科室缺陷占比排行(分页)
  310. *
  311. * @param filterPageVO
  312. * @return
  313. */
  314. @ApiOperation(value = "各科室缺陷占比排行(分页)[by:zhaops]",
  315. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  316. @PostMapping("/resultStatisticsByDeptPage")
  317. @SysLogger("resultStatisticsByDeptPage")
  318. public RespDTO<IPage<NumDTO>> resultStatisticsByDeptPage(@RequestBody @Valid FilterPageVO filterPageVO) {
  319. return RespDTO.onSuc(consoleFacade.resultStatisticsByDeptPage(filterPageVO));
  320. }
  321. /**
  322. * 各科室甲级病历占比排行(分页)
  323. *
  324. * @param filterPageVO
  325. * @return
  326. */
  327. @ApiOperation(value = "各科室甲级病历占比排行(分页)[by:zhaops]",
  328. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  329. @PostMapping("/levelPercentGroupByDeptPage")
  330. @SysLogger("levelPercentGroupByDeptPage")
  331. public RespDTO<IPage<NumDTO>> levelPercentGroupByDeptPage(@RequestBody @Valid FilterPageVO filterPageVO) {
  332. return RespDTO.onSuc(consoleFacade.levelPercentGroupByDeptPage(filterPageVO));
  333. }
  334. /**
  335. * 条目缺陷占比(内页)
  336. *
  337. * @param filterPageVO
  338. * @return
  339. */
  340. @ApiOperation(value = "条目缺陷占比(分页)[by:zhaops]",
  341. notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
  342. @PostMapping("/entryGroupByEntryInnerPage")
  343. @SysLogger("entryGroupByEntryInnerPage")
  344. public RespDTO<IPage<EntryNumDTO>> entryGroupByEntryInnerPage(@RequestBody @Valid FilterPageVO filterPageVO) {
  345. return RespDTO.onSuc(consoleFacade.entryGroupByEntryInnerPage(filterPageVO));
  346. }
  347. //endregion-----------------------分页接口结束-------------------------------
  348. /**
  349. * 各科室缺陷占比(组合)
  350. *
  351. * @param filterOrderVO
  352. * @return
  353. */
  354. @ApiOperation(value = "各科室缺陷占比(组合)[by:zhaops]",
  355. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  356. "level: 病历等级 <br>" +
  357. "name: 科室名称 <br>" +
  358. "asc: 排序(升序) <br>" +
  359. "desc: 排序(降序) <br>")
  360. @PostMapping("/levelStatistics")
  361. @SysLogger("levelStatistics")
  362. public RespDTO<List<LevelStatisticsDTO>> levelStatistics(@RequestBody @Valid FilterOrderVO filterOrderVO) {
  363. return RespDTO.onSuc(consoleFacade.levelStatistics(filterOrderVO));
  364. }
  365. /**
  366. * 各科室缺陷占比(组合)-全院-根据内外科系统统计
  367. *
  368. * @param filterOrderVO
  369. * @return
  370. */
  371. @ApiOperation(value = "各科室缺陷占比(组合)-全院-根据内外科系统统计[by:zhaops]",
  372. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  373. "level: 病历等级 <br>" +
  374. "name: 科室名称 <br>" +
  375. "deptClass: 科室分类:内科/外科,全部不传 <br>" +
  376. "asc: 排序(升序) <br>" +
  377. "desc: 排序(降序) <br>")
  378. @PostMapping("/levelStatisticsByDeptClass")
  379. @SysLogger("levelStatisticsByDeptClass")
  380. public RespDTO<List<LevelStatisticsTZDTO>> levelStatisticsByDeptClass(@RequestBody @Valid FilterOrderVO filterOrderVO) {
  381. return RespDTO.onSuc(consoleFacade.levelStatisticsByDeptClass_TZ(filterOrderVO));
  382. }
  383. /**
  384. * 病案首页合格率占比
  385. *
  386. * @param filterOrderVO
  387. * @return
  388. */
  389. @ApiOperation(value = "病案首页合格率占比[by:zhaops]",
  390. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  391. "level: 病历等级 <br>" +
  392. "name: 科室名称 <br>" +
  393. "asc: 排序(升序) <br>" +
  394. "desc: 排序(降序) <br>")
  395. @PostMapping("/homePageLevelStatistics")
  396. @SysLogger("homePageLevelStatistics")
  397. public RespDTO<List<HomePageNumDTO>> homePageLevelStatistics(@RequestBody @Valid FilterOrderVO filterOrderVO) {
  398. return RespDTO.onSuc(consoleFacade.homePageLevelStatistics(filterOrderVO));
  399. }
  400. /**
  401. * 病案首页合格率占比(首页)
  402. *
  403. * @param filterOrderVO
  404. * @return
  405. */
  406. @ApiOperation(value = "病案首页合格率占比(首页)[by:zhaops]",
  407. notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
  408. "level: 病历等级 <br>" +
  409. "name: 科室名称 <br>" +
  410. "asc: 排序(升序) <br>" +
  411. "desc: 排序(降序) <br>")
  412. @PostMapping("/homePageLevelLimit")
  413. @SysLogger("homePageLevelLimit")
  414. public RespDTO<List<HomePageNumDTO>> homePageLevelLimit(@RequestBody @Valid FilterOrderVO filterOrderVO) {
  415. return RespDTO.onSuc(consoleFacade.homePageLevelLimit(filterOrderVO));
  416. }
  417. /**
  418. * 条目缺陷质控评分页(内页)
  419. *
  420. * @param qcResultShortPageVO
  421. * @return
  422. */
  423. @ApiOperation(value = "条目缺陷质控评分页(内页)[by:zhaops]",
  424. notes = "behospitalCode: 病历号<br>" +
  425. "patName: 病人姓名 <br>" +
  426. "casesEntryName: 条目名称 <br>" +
  427. "casesEntryId: 条目id <br>" +
  428. "behDeptName:科室名称 <br>" +
  429. "level: 病历等级 <br>" +
  430. "isReject: 单项否决 1-否决,0-非<br>" +
  431. "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
  432. "startDate: 起始时间 <br>" +
  433. "endDate: 截止时间 <br>")
  434. @PostMapping("/qcResultShortPage")
  435. @SysLogger("qcResultShortPage")
  436. public RespDTO<IPage<QcResultShortDTO>> qcResultShortPage(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
  437. return RespDTO.onSuc(consoleFacade.qcResultShortPage(qcResultShortPageVO));
  438. }
  439. /**
  440. * 关键条目缺陷占比统计
  441. *
  442. * @param entryStatisticsVO
  443. * @return
  444. */
  445. @ApiOperation(value = "关键条目缺陷占比统计[by:zhaops]",
  446. notes = "deptName:科室名称 <br>" +
  447. "asc: 排序(升序) <br>" +
  448. "desc:排序(降序) <br>" +
  449. "startDate: 起始时间 <br>" +
  450. "endDate: 截止时间 <br>")
  451. @PostMapping("/entryStatistics")
  452. @SysLogger("entryStatistics")
  453. public RespDTO<List<EntryStatisticsDTO>> entryStatistics(@RequestBody @Valid EntryStatisticsVO entryStatisticsVO) {
  454. return RespDTO.onSuc(consoleFacade.entryStatistics(entryStatisticsVO));
  455. }
  456. }