ConsoleController.java 18 KB

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