package com.xinelu.manage.controller; import com.xinelu.common.annotation.Log; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.PatientInfo; import com.xinelu.manage.dto.PatientInfoDto; import com.xinelu.manage.service.IPatientInfoService; import io.swagger.annotations.Api; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 患者信息Controller * * @author haown * @date 2024-02-26 */ @RestController @RequestMapping("/manage/patientInfo") @Api(tags = "患者信息控制器") public class PatientInfoController extends BaseController { @Resource private IPatientInfoService patientInfoService; /** * 查询患者信息列表 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:list')") @GetMapping("/list") public TableDataInfo list(PatientInfoDto patientInfo) { startPage(); List list = patientInfoService.selectPatientInfoList(patientInfo); return getDataTable(list); } /** * 导出患者信息列表 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:export')") @Log(title = "患者信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, PatientInfoDto patientInfo) { List list = patientInfoService.selectPatientInfoList(patientInfo); ExcelUtil util = new ExcelUtil(PatientInfo. class); util.exportExcel(response, list, "患者信息数据"); } /** * 获取患者信息详细信息 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(patientInfoService.selectPatientInfoById(id)); } /** * 新增患者信息 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:add')") @Log(title = "患者信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody PatientInfo patientInfo) { return toAjax(patientInfoService.insertPatientInfo(patientInfo)); } /** * 修改患者信息 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')") @Log(title = "患者信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody PatientInfo patientInfo) { return toAjax(patientInfoService.updatePatientInfo(patientInfo)); } /** * 删除患者信息 */ @PreAuthorize("@ss.hasPermi('manage:patientInfo:remove')") @Log(title = "患者信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(patientInfoService.deletePatientInfoByIds(ids)); } }