liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java
@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.smartor;
import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -7,11 +8,9 @@
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;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.PatArchive;
import com.smartor.domain.PatArchiveReq;
import com.smartor.domain.PatImportInfoVO;
import com.smartor.domain.PatUpInfoVO;
import com.smartor.domain.*;
import com.smartor.service.IPatArchiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -25,6 +24,8 @@
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
 * 患者档案Controller
@@ -43,9 +44,9 @@
     * 查询患者档案列表
     */
    @ApiOperation("查询患者档案列表")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:list')")
    @GetMapping("/list")
    public TableDataInfo list(PatArchive patArchive) {
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody PatArchive patArchive) {
        startPage();
        List<PatArchive> list = patArchiveService.selectPatArchiveList(patArchive);
        return getDataTable(list);
@@ -55,8 +56,8 @@
     * 导出患者档案列表
     */
    @ApiOperation("导出患者档案列表")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:export')")
    @Log(title = "患者档案", businessType = BusinessType.EXPORT)
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:export')")
    @Log(title = "患者档案" , businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, PatArchive patArchive) {
        List<PatArchive> list = patArchiveService.selectPatArchiveList(patArchive);
@@ -68,43 +69,54 @@
     * 获取患者档案详细信息
     */
    @ApiOperation("获取患者档案详细信息")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:query')")
    @GetMapping(value = "/{patid}")
    @ApiImplicitParam(name = "patid", value = "患者id")
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:query')")
    @GetMapping(value = "/getInfo/{patid}")
    @ApiImplicitParam(name = "patid" , value = "患者id")
    public AjaxResult getInfo(@PathVariable(name = "patid") Long patid) {
        return success(patArchiveService.selectPatArchiveByPatid(patid));
    }
//    /**
//     * 新增患者档案
//     */
//    @ApiOperation("新增患者档案")
//    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:add')")
//    @Log(title = "患者档案", businessType = BusinessType.INSERT)
//    @PostMapping("/add")
//    public AjaxResult add(@RequestBody PatArchive patArchive) {
//        return toAjax(patArchiveService.insertPatArchive(patArchive));
//    }
    /**
     * 新增患者档案
     */
    @ApiOperation("新增患者档案")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:add')")
    @Log(title = "患者档案", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PatArchive patArchive) {
        return toAjax(patArchiveService.insertPatArchive(patArchive));
    @ApiOperation("修改患者档案")
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:update')")
    @Log(title = "患者档案" , businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    public AjaxResult update(@RequestBody PatArchive patArchive) {
        return toAjax(patArchiveService.update(patArchive));
    }
    /**
     * 修改患者档案
     * 新增或修改患者档信息
     */
    @ApiOperation("修改患者档案")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:edit')")
    @Log(title = "患者档案", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PatArchive patArchive) {
        return toAjax(patArchiveService.updatePatArchive(patArchive));
    @ApiOperation("新增或修改患者档信息")
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:edit')")
    @Log(title = "患者档案" , businessType = BusinessType.UPDATE)
    @PostMapping("/saveOrUpdatePatInfo")
    public AjaxResult saveOrUpdatePatInfo(@RequestBody PatArchiveVO patArchiveVO) {
        return toAjax(patArchiveService.saveOrUpdatePatInfo(patArchiveVO));
    }
    /**
     * 删除患者档案
     */
    @ApiOperation("删除患者档案")
    @PreAuthorize("@ss.hasPermi('smartor:patarchive:remove')")
    @Log(title = "患者档案", businessType = BusinessType.DELETE)
    @DeleteMapping("/{patids}")
    @ApiImplicitParam(name = "patids", value = "患者id集合", dataType = "long", dataTypeClass = Long.class)
    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:remove')")
    @Log(title = "患者档案" , businessType = BusinessType.DELETE)
    @GetMapping("/remove/{patids}")
    @ApiImplicitParam(name = "patids" , value = "患者id集合" , dataType = "long" , dataTypeClass = Long.class)
    public AjaxResult remove(@PathVariable Long[] patids) {
        return toAjax(patArchiveService.deletePatArchiveByPatids(patids));
    }
@@ -117,8 +129,9 @@
     */
    @ApiOperation("导入患者文件处理")
    @PostMapping("/importFilehandle")
    @ApiImplicitParams({@ApiImplicitParam(name = "tags", value = "标签"), @ApiImplicitParam(name = "multipartFile", value = "上传文件")})
    @ApiImplicitParams({@ApiImplicitParam(name = "tags" , value = "标签"), @ApiImplicitParam(name = "multipartFile" , value = "上传文件")})
    public AjaxResult importFilehandle(@RequestParam("tags") String tags, @RequestParam("multipartFile") MultipartFile multipartFile) {
        Executor executor = Executors.newFixedThreadPool(3);
        //获取当前登陆人
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
@@ -134,7 +147,8 @@
    @ApiOperation("患者信息导入模板")
    @PostMapping("/patImportTemplate")
    public void patImportTemplate(HttpServletResponse response) {
        ExcelUtil<PatImportInfoVO> util = new ExcelUtil<PatImportInfoVO>(PatImportInfoVO.class);
//        ExcelUtil<PatImportInfoVO> util = new ExcelUtil<PatImportInfoVO>(PatImportInfoVO.class);
        ExcelUtil<PatArchive> util = new ExcelUtil<PatArchive>(PatArchive.class);
        util.importTemplateExcel(response, "患者信息导入");
    }
@@ -157,20 +171,16 @@
    @ApiOperation("查询患者列表")
    @PostMapping("/patInfoByContion")
    public TableDataInfo patInfoByCondition(@RequestBody PatArchiveReq patArchive) {
        startPage();
        return getDataTable(patArchiveService.patInfoByContion(patArchive));
        PageUtils.startPageByPost(patArchive.getPageNum(), patArchive.getPageSize());
        List<PatArchive> patArchives = patArchiveService.patInfoByContion(patArchive);
        long count = PageUtils.count(new ISelect() {
            @Override
            public void doSelect() {
                patArchiveService.patInfoByContion(patArchive);
            }
        });
        return getDataTable2(count, patArchives);
    }
//    /**
//     * 患者标签管理
//     */
//    @ApiOperation("患者标签管理")
//    @PostMapping("/patTagByContion")
//    public TableDataInfo patTagByContion(@RequestBody List<Long> tagids) {
//        startPage();
//        return getDataTable(patArchiveService.patTagByContion(tagids));
//    }
    /**
@@ -190,4 +200,22 @@
        util.exportExcel(response, patArchives, "患者档案数据");
    }
    /**
     * 获取患者信息
     */
    @ApiOperation("获取患者信息")
    @PostMapping("/getPatientInfo")
    public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) {
        PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize());
        List<PatArchiveOthreInfo> patientInfo = patArchiveService.getPatientInfo(patArchiveReq);
        long count = PageUtils.count(new ISelect() {
            @Override
            public void doSelect() {
                patArchiveService.getPatientInfo(patArchiveReq);
            }
        });
        return getDataTable2(count, patientInfo);
    }
}