package com.smartor.controller;
|
|
import java.util.List;
|
import javax.servlet.http.HttpServletResponse;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.smartor.domain.PatMedInhosp;
|
import com.smartor.service.IPatMedInhospService;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
/**
|
* 患者住院记录Controller
|
*
|
* @author smartor
|
* @date 2023-03-04
|
*/
|
@RestController
|
@RequestMapping("/smartor/patinhosp")
|
public class PatMedInhospController extends BaseController
|
{
|
@Autowired
|
private IPatMedInhospService patMedInhospService;
|
|
/**
|
* 查询患者住院记录列表
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(PatMedInhosp patMedInhosp)
|
{
|
startPage();
|
List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出患者住院记录列表
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')")
|
@Log(title = "患者住院记录", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
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, "患者住院记录数据");
|
}
|
|
/**
|
* 获取患者住院记录详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')")
|
@GetMapping(value = "/{inhospid}")
|
public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid)
|
{
|
return success(patMedInhospService.selectPatMedInhospByInhospid(inhospid));
|
}
|
|
/**
|
* 新增患者住院记录
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')")
|
@Log(title = "患者住院记录", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp)
|
{
|
return toAjax(patMedInhospService.insertPatMedInhosp(patMedInhosp));
|
}
|
|
/**
|
* 修改患者住院记录
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')")
|
@Log(title = "患者住院记录", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp)
|
{
|
return toAjax(patMedInhospService.updatePatMedInhosp(patMedInhosp));
|
}
|
|
/**
|
* 删除患者住院记录
|
*/
|
@PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')")
|
@Log(title = "患者住院记录", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{inhospids}")
|
public AjaxResult remove(@PathVariable Long[] inhospids)
|
{
|
return toAjax(patMedInhospService.deletePatMedInhospByInhospids(inhospids));
|
}
|
}
|