陈昶聿
5 天以前 861b8c51cf42864fde663391eeb73e4fc61d3848
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -1,10 +1,12 @@
package com.ruoyi.web.controller.smartor;
import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.AddOrgId;
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;
@@ -12,10 +14,13 @@
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedInhospVO;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatServiceCount;
import com.smartor.service.IPatMedInhospService;
import com.smartor.service.IPatMedOuthospService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -35,14 +40,20 @@
    @Autowired
    private IPatMedInhospService patMedInhospService;
    @Autowired
    private IPatMedOuthospService iPatMedOuthospService;
    /**
     * 查询患者住院记录列表
     */
    @ApiOperation("查询患者住院记录列表")
    //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/selectPatMedInhospList")
    public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp) {
        PageUtils.startPageByPost(patMedInhosp.getPageNum(), patMedInhosp.getPageSize());
        SysUser user = getLoginUser().getUser();
        patMedInhosp.setOrgid(user.getOrgid());
        List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
        long count = PageUtils.count(new ISelect() {
            @Override
@@ -54,8 +65,20 @@
    }
    /**
     * 出院、门诊人数和随访量统计(周,月,年)
     */
    @ApiOperation("出院、门诊人数和随访量统计(周,月,年)")
    //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
    @PostMapping("/queryPersonCount")
    public TableDataInfo queryPersonCount(@RequestBody PatServiceCount patServiceCount) {
        return null;
    }
    /**
     * 查询当前登陆人自己(病区、部门)的患者住院记录列表
     */
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @ApiOperation("查询当前登陆人自己(病区、部门)的患者住院记录列表")
    @PostMapping("/selectPatMedInhospListByCondition")
    public TableDataInfo selectPatMedInhospListByCondition(@RequestBody PatMedInhospVO patMedInhospVO) {
@@ -81,9 +104,15 @@
        return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp));
    }
    /**
     * 查询出、入院看病人次和人数(人数分为首次服务、再次服务、专病服务)
     */
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/selectPatMedInhospListCount")
    @ApiOperation("查询出、入院看病人次和人数")
    public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) {
    public AjaxResult selectPatMedInhospListCount(@RequestBody PatMedReq patMedReq) {
        SysUser user = getLoginUser().getUser();
        patMedReq.setOrgid(user.getOrgid());
        return success(patMedInhospService.selectPatMedInhospListCount(patMedReq));
    }
@@ -116,6 +145,7 @@
    @ApiOperation("新增患者住院记录")
    //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')")
    @Log(title = "患者住院记录", businessType = BusinessType.INSERT)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp) {
        SysUser user = getLoginUser().getUser();
@@ -129,6 +159,7 @@
    @ApiOperation("修改患者住院记录")
    //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')")
    @Log(title = "患者住院记录", businessType = BusinessType.UPDATE)
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp) {
        return toAjax(patMedInhospService.updatePatMedInhosp(patMedInhosp));
@@ -177,6 +208,11 @@
//    @GetMapping("/test")
//    public void test() {
//        patMedInhospService.dealOutHospInfo();
//
//        //门诊表
//        if (visitHosp != 1) {
//            iPatMedOuthospService.dealOutpatientInfo();
//        }
//    }
}