From 907641e56c2085aaa81f267946dc3e3e9fca73e7 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 18 九月 2024 09:39:02 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java | 121 ++++++++++++++++++++++++---------------- 1 files changed, 73 insertions(+), 48 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java index aef35aa..2ac7b55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java +++ b/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,27 +8,24 @@ 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; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; /** * 鎮h�呮。妗圕ontroller @@ -35,7 +33,7 @@ * @author smartor * @date 2023-03-04 */ -@Api("鎮h�呮。妗�") +@Api(description = "鎮h�呮。妗�") @RestController @RequestMapping("/smartor/patarchive") public class PatArchiveController extends BaseController { @@ -46,9 +44,9 @@ * 鏌ヨ鎮h�呮。妗堝垪琛� */ @ApiOperation("鏌ヨ鎮h�呮。妗堝垪琛�") - @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); @@ -58,8 +56,8 @@ * 瀵煎嚭鎮h�呮。妗堝垪琛� */ @ApiOperation("瀵煎嚭鎮h�呮。妗堝垪琛�") - @PreAuthorize("@ss.hasPermi('smartor:patarchive:export')") - @Log(title = "鎮h�呮。妗�", businessType = BusinessType.EXPORT) + //@PreAuthorize("@ss.hasPermi('smartor:patarchive:export')") + @Log(title = "鎮h�呮。妗�" , businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, PatArchive patArchive) { List<PatArchive> list = patArchiveService.selectPatArchiveList(patArchive); @@ -71,43 +69,54 @@ * 鑾峰彇鎮h�呮。妗堣缁嗕俊鎭� */ @ApiOperation("鑾峰彇鎮h�呮。妗堣缁嗕俊鎭�") - @PreAuthorize("@ss.hasPermi('smartor:patarchive:query')") - @GetMapping(value = "/{patid}") - @ApiImplicitParam(name = "patid", value = "鎮h�卛d") + //@PreAuthorize("@ss.hasPermi('smartor:patarchive:query')") + @GetMapping(value = "/getInfo/{patid}") + @ApiImplicitParam(name = "patid" , value = "鎮h�卛d") public AjaxResult getInfo(@PathVariable(name = "patid") Long patid) { return success(patArchiveService.selectPatArchiveByPatid(patid)); } +// /** +// * 鏂板鎮h�呮。妗� +// */ +// @ApiOperation("鏂板鎮h�呮。妗�") +// //@PreAuthorize("@ss.hasPermi('smartor:patarchive:add')") +// @Log(title = "鎮h�呮。妗�", businessType = BusinessType.INSERT) +// @PostMapping("/add") +// public AjaxResult add(@RequestBody PatArchive patArchive) { +// return toAjax(patArchiveService.insertPatArchive(patArchive)); +// } + /** * 鏂板鎮h�呮。妗� */ - @ApiOperation("鏂板鎮h�呮。妗�") - @PreAuthorize("@ss.hasPermi('smartor:patarchive:add')") - @Log(title = "鎮h�呮。妗�", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody PatArchive patArchive) { - return toAjax(patArchiveService.insertPatArchive(patArchive)); + @ApiOperation("淇敼鎮h�呮。妗�") + //@PreAuthorize("@ss.hasPermi('smartor:patarchive:update')") + @Log(title = "鎮h�呮。妗�" , businessType = BusinessType.UPDATE) + @PostMapping("/update") + public AjaxResult update(@RequestBody PatArchive patArchive) { + return toAjax(patArchiveService.update(patArchive)); } /** - * 淇敼鎮h�呮。妗� + * 鏂板鎴栦慨鏀规偅鑰呮。淇℃伅 */ - @ApiOperation("淇敼鎮h�呮。妗�") - @PreAuthorize("@ss.hasPermi('smartor:patarchive:edit')") - @Log(title = "鎮h�呮。妗�", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody PatArchive patArchive) { - return toAjax(patArchiveService.updatePatArchive(patArchive)); + @ApiOperation("鏂板鎴栦慨鏀规偅鑰呮。淇℃伅") + //@PreAuthorize("@ss.hasPermi('smartor:patarchive:edit')") + @Log(title = "鎮h�呮。妗�" , businessType = BusinessType.UPDATE) + @PostMapping("/saveOrUpdatePatInfo") + public AjaxResult saveOrUpdatePatInfo(@RequestBody PatArchiveVO patArchiveVO) { + return toAjax(patArchiveService.saveOrUpdatePatInfo(patArchiveVO)); } /** * 鍒犻櫎鎮h�呮。妗� */ @ApiOperation("鍒犻櫎鎮h�呮。妗�") - @PreAuthorize("@ss.hasPermi('smartor:patarchive:remove')") - @Log(title = "鎮h�呮。妗�", businessType = BusinessType.DELETE) - @DeleteMapping("/{patids}") - @ApiImplicitParam(name = "patids", value = "鎮h�卛d闆嗗悎", dataType = "long", dataTypeClass = Long.class) + //@PreAuthorize("@ss.hasPermi('smartor:patarchive:remove')") + @Log(title = "鎮h�呮。妗�" , businessType = BusinessType.DELETE) + @GetMapping("/remove/{patids}") + @ApiImplicitParam(name = "patids" , value = "鎮h�卛d闆嗗悎" , dataType = "long" , dataTypeClass = Long.class) public AjaxResult remove(@PathVariable Long[] patids) { return toAjax(patArchiveService.deletePatArchiveByPatids(patids)); } @@ -120,8 +129,9 @@ */ @ApiOperation("瀵煎叆鎮h�呮枃浠跺鐞�") @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(); @@ -137,7 +147,8 @@ @ApiOperation("鎮h�呬俊鎭鍏ユā鏉�") @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, "鎮h�呬俊鎭鍏�"); } @@ -160,20 +171,16 @@ @ApiOperation("鏌ヨ鎮h�呭垪琛�") @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); } - - -// /** -// * 鎮h�呮爣绛剧鐞� -// */ -// @ApiOperation("鎮h�呮爣绛剧鐞�") -// @PostMapping("/patTagByContion") -// public TableDataInfo patTagByContion(@RequestBody List<Long> tagids) { -// startPage(); -// return getDataTable(patArchiveService.patTagByContion(tagids)); -// } /** @@ -193,4 +200,22 @@ util.exportExcel(response, patArchives, "鎮h�呮。妗堟暟鎹�"); } + /** + * 鑾峰彇鎮h�呬俊鎭� + */ + @ApiOperation("鑾峰彇鎮h�呬俊鎭�") + @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); + } + + } -- Gitblit v1.9.3