2024-02-27 14:04:33 +08:00
|
|
|
package com.xinelu.manage.controller;
|
|
|
|
|
|
2024-02-29 11:40:18 +08:00
|
|
|
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;
|
2024-02-27 14:04:33 +08:00
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import java.util.List;
|
2024-02-29 11:40:18 +08:00
|
|
|
import javax.annotation.Resource;
|
2024-02-27 14:04:33 +08:00
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
2024-02-29 11:40:18 +08:00
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
2024-02-27 14:04:33 +08:00
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2024-02-29 11:40:18 +08:00
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
2024-02-27 14:04:33 +08:00
|
|
|
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")
|
2024-02-29 11:40:18 +08:00
|
|
|
public TableDataInfo list(PatientInfoDto patientInfo) {
|
2024-02-27 14:04:33 +08:00
|
|
|
startPage();
|
|
|
|
|
List<PatientInfo> list = patientInfoService.selectPatientInfoList(patientInfo);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出患者信息列表
|
|
|
|
|
*/
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('manage:patientInfo:export')")
|
|
|
|
|
@Log(title = "患者信息", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
2024-02-29 11:40:18 +08:00
|
|
|
public void export(HttpServletResponse response, PatientInfoDto patientInfo) {
|
2024-02-27 14:04:33 +08:00
|
|
|
List<PatientInfo> list = patientInfoService.selectPatientInfoList(patientInfo);
|
|
|
|
|
ExcelUtil<PatientInfo> util = new ExcelUtil<PatientInfo>(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));
|
|
|
|
|
}
|
|
|
|
|
}
|