package com.ruoyi.web.controller.smartor;
|
|
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.page.TableDataInfo;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.smartor.domain.PatMedInspection;
|
import com.smartor.service.IPatMedInspectionService;
|
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.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* 患者检查检验记录Controller
|
*
|
* @author ruoyi
|
* @date 2023-06-16
|
*/
|
@Api(description = "患者检查检验记录")
|
@RestController
|
@RequestMapping("/smartor/inspection")
|
public class PatMedInspectionController extends BaseController {
|
@Autowired
|
private IPatMedInspectionService patMedInspectionService;
|
|
/**
|
* 查询患者检查检验记录列表
|
*/
|
@ApiOperation("查询患者检查检验记录列表")
|
//@PreAuthorize("@ss.hasPermi('system:inspection:list')")
|
@PostMapping("/list")
|
public TableDataInfo list(@RequestBody PatMedInspection patMedInspection) {
|
startPage();
|
List<PatMedInspection> list = patMedInspectionService.selectPatMedInspectionList(patMedInspection);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出患者检查检验记录列表
|
*/
|
@ApiOperation("导出患者检查检验记录列表")
|
//@PreAuthorize("@ss.hasPermi('system:inspection:export')")
|
@Log(title = "患者检查检验记录", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, PatMedInspection patMedInspection) {
|
List<PatMedInspection> list = patMedInspectionService.selectPatMedInspectionList(patMedInspection);
|
ExcelUtil<PatMedInspection> util = new ExcelUtil<PatMedInspection>(PatMedInspection.class);
|
util.exportExcel(response, list, "患者检查检验记录数据");
|
}
|
|
/**
|
* 获取患者检查检验记录详细信息
|
*/
|
@ApiOperation("获取患者检查检验记录详细信息")
|
//@PreAuthorize("@ss.hasPermi('system:inspection:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
return success(patMedInspectionService.selectPatMedInspectionById(id));
|
}
|
|
/**
|
* 新增患者检查检验记录
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:inspection:add')")
|
@Log(title = "新增患者检查检验记录", businessType = BusinessType.INSERT)
|
@ApiOperation("新增患者检查检验记录")
|
@PostMapping("/add")
|
public AjaxResult add(@RequestBody PatMedInspection patMedInspection) {
|
SysUser user = getLoginUser().getUser();
|
patMedInspection.setOrgid(user.getOrgid());
|
return toAjax(patMedInspectionService.insertPatMedInspection(patMedInspection));
|
}
|
|
/**
|
* 修改患者检查检验记录
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:inspection:edit')")
|
@Log(title = "修改患者检查检验记录", businessType = BusinessType.UPDATE)
|
@ApiOperation("修改患者检查检验记录")
|
@PostMapping("/edit")
|
public AjaxResult edit(@RequestBody PatMedInspection patMedInspection) {
|
return toAjax(patMedInspectionService.updatePatMedInspection(patMedInspection));
|
}
|
|
/**
|
* 删除患者检查检验记录
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:inspection:remove')")
|
@Log(title = "患者检查检验记录", businessType = BusinessType.DELETE)
|
@ApiOperation("患者检查检验记录")
|
@GetMapping("/remove/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
return toAjax(patMedInspectionService.deletePatMedInspectionByIds(ids));
|
}
|
}
|