| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.domain.PatMedInhospVO; |
| | | import com.smartor.domain.PatMedReq; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 患者住院记录Controller |
| | |
| | | @Api(description = "患者住院记录") |
| | | @RestController |
| | | @RequestMapping("/smartor/patinhosp") |
| | | public class PatMedInhospController extends BaseController |
| | | { |
| | | public class PatMedInhospController extends BaseController { |
| | | @Autowired |
| | | private IPatMedInhospService patMedInhospService; |
| | | |
| | |
| | | * 查询患者住院记录列表 |
| | | */ |
| | | @ApiOperation("查询患者住院记录列表") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')") |
| | | @PostMapping("/selectPatMedInhospList") |
| | | public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp) |
| | | { |
| | | startPage(); |
| | | public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp) { |
| | | PageUtils.startPageByPost(patMedInhosp.getPageNum(), patMedInhosp.getPageSize()); |
| | | List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp); |
| | | return getDataTable(list); |
| | | long count = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | patMedInhospService.selectPatMedInhospList(patMedInhosp); |
| | | } |
| | | }); |
| | | return getDataTable2(count, list); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前登陆人自己(病区、部门)的患者住院记录列表 |
| | | */ |
| | | @ApiOperation("查询当前登陆人自己(病区、部门)的患者住院记录列表") |
| | | @PostMapping("/selectPatMedInhospListByCondition") |
| | | public TableDataInfo selectPatMedInhospListByCondition(@RequestBody PatMedInhospVO patMedInhospVO) { |
| | | PageUtils.startPageByPost(patMedInhospVO.getPageNum(), patMedInhospVO.getPageSize()); |
| | | List<PatMedInhosp> list = null; |
| | | if (!CollectionUtils.isEmpty(patMedInhospVO.getLeavehospitaldistrictcodes())) { |
| | | list = patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO); |
| | | } else if (!CollectionUtils.isEmpty(patMedInhospVO.getLeaveldeptcodes())) { |
| | | list = patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO); |
| | | } |
| | | long count = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO); |
| | | } |
| | | }); |
| | | return getDataTable2(count, list); |
| | | } |
| | | |
| | | @PostMapping("/getDeptCodeByPatId") |
| | | @ApiOperation("查询住、出院部门编码通过patId") |
| | | public AjaxResult getDeptCodeByPatId(@RequestBody PatMedInhosp patMedInhosp) { |
| | | return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp)); |
| | | } |
| | | |
| | | @PostMapping("/selectPatMedInhospListCount") |
| | | @ApiOperation("查询出、入院看病人次和人数") |
| | | public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) { |
| | | return success(patMedInhospService.selectPatMedInhospListCount(patMedReq)); |
| | | } |
| | | |
| | | /** |
| | | * 导出患者住院记录列表 |
| | | */ |
| | | @ApiOperation("导出患者住院记录列表") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')") |
| | | @Log(title = "患者住院记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, PatMedInhosp patMedInhosp) |
| | | { |
| | | public void export(HttpServletResponse response, PatMedInhosp patMedInhosp) { |
| | | List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp); |
| | | ExcelUtil<PatMedInhosp> util = new ExcelUtil<PatMedInhosp>(PatMedInhosp.class); |
| | | util.exportExcel(response, list, "患者住院记录数据"); |
| | |
| | | * 获取患者住院记录详细信息 |
| | | */ |
| | | @ApiOperation("获取患者住院记录详细信息") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')") |
| | | @GetMapping(value = "/{inhospid}") |
| | | public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid) { |
| | | return success(patMedInhospService.selectPatMedInhospByInhospid(inhospid)); |
| | | } |
| | | |
| | |
| | | * 新增患者住院记录 |
| | | */ |
| | | @ApiOperation("新增患者住院记录") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')") |
| | | @Log(title = "患者住院记录", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp) |
| | | { |
| | | public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp) { |
| | | return toAjax(patMedInhospService.insertPatMedInhosp(patMedInhosp)); |
| | | } |
| | | |
| | |
| | | * 修改患者住院记录 |
| | | */ |
| | | @ApiOperation("修改患者住院记录") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')") |
| | | @Log(title = "患者住院记录", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp) |
| | | { |
| | | public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp) { |
| | | return toAjax(patMedInhospService.updatePatMedInhosp(patMedInhosp)); |
| | | } |
| | | |
| | |
| | | * 删除患者住院记录 |
| | | */ |
| | | @ApiOperation("删除患者住院记录") |
| | | @PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')") |
| | | @Log(title = "患者住院记录", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{inhospids}") |
| | | public AjaxResult remove(@PathVariable Long[] inhospids) |
| | | { |
| | | @GetMapping("/remove/{inhospids}") |
| | | public AjaxResult remove(@PathVariable Long[] inhospids) { |
| | | return toAjax(patMedInhospService.deletePatMedInhospByInhospids(inhospids)); |
| | | } |
| | | |
| | | /** |
| | | * 各科室服务人次 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("各科室服务人次") |
| | | @PostMapping("/getDeptRanking") |
| | | public TableDataInfo getDeptRanking(@RequestBody PatMedReq patMedReq) { |
| | | return getDataTable(patMedInhospService.getDeptRanking(patMedReq)); |
| | | } |
| | | |
| | | } |