From 723d38375c45d24737bfef6f33a9686254abf99b Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 17 十月 2024 13:42:27 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java | 103 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 79 insertions(+), 24 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
index 5e64552..7b15428 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -1,21 +1,31 @@
-package com.smartor.controller;
+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;
+import com.ruoyi.common.core.domain.entity.SysUser;
+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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.PatMedInhosp;
+import com.smartor.domain.PatMedInhospVO;
+import com.smartor.domain.PatMedReq;
import com.smartor.service.IPatMedInhospService;
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.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
/**
* 鎮h�呬綇闄㈣褰旵ontroller
@@ -26,8 +36,7 @@
@Api(description = "鎮h�呬綇闄㈣褰�")
@RestController
@RequestMapping("/smartor/patinhosp")
-public class PatMedInhospController extends BaseController
-{
+public class PatMedInhospController extends BaseController {
@Autowired
private IPatMedInhospService patMedInhospService;
@@ -35,24 +44,62 @@
* 鏌ヨ鎮h�呬綇闄㈣褰曞垪琛�
*/
@ApiOperation("鏌ヨ鎮h�呬綇闄㈣褰曞垪琛�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
@PostMapping("/selectPatMedInhospList")
- public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp)
- {
- startPage();
+ public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp) {
+ PageUtils.startPageByPost(patMedInhosp.getPageNum(), patMedInhosp.getPageSize());
List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
- return getDataTable(list);
+ long count = PageUtils.count(new ISelect() {
+ @Override
+ public void doSelect() {
+ patMedInhospService.selectPatMedInhospList(patMedInhosp);
+ }
+ });
+ return getDataTable2(count, list);
+ }
+
+ /**
+ * 鏌ヨ褰撳墠鐧婚檰浜鸿嚜宸憋紙鐥呭尯銆侀儴闂級鐨勬偅鑰呬綇闄㈣褰曞垪琛�
+ */
+ @ApiOperation("鏌ヨ褰撳墠鐧婚檰浜鸿嚜宸憋紙鐥呭尯銆侀儴闂級鐨勬偅鑰呬綇闄㈣褰曞垪琛�")
+ @PostMapping("/selectPatMedInhospListByCondition")
+ public TableDataInfo selectPatMedInhospListByCondition(@RequestBody PatMedInhospVO patMedInhospVO) {
+ PageUtils.startPageByPost(patMedInhospVO.getPageNum(), patMedInhospVO.getPageSize());
+ List<PatMedInhosp> list = null;
+ if (!CollectionUtils.isEmpty(patMedInhospVO.getLeavehospitaldistrictcodes())) {
+ list = patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO);
+ } else if (!CollectionUtils.isEmpty(patMedInhospVO.getLeaveldeptcodes())) {
+ list = patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO);
+ }
+ long count = PageUtils.count(new ISelect() {
+ @Override
+ public void doSelect() {
+ patMedInhospService.selectPatMedInhospListByCondition(patMedInhospVO);
+ }
+ });
+ return getDataTable2(count, list);
+ }
+
+ @PostMapping("/getDeptCodeByPatId")
+ @ApiOperation("鏌ヨ浣忋�佸嚭闄㈤儴闂ㄧ紪鐮侀�氳繃patId")
+ public AjaxResult getDeptCodeByPatId(@RequestBody PatMedInhosp patMedInhosp) {
+ return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp));
+ }
+
+ @PostMapping("/selectPatMedInhospListCount")
+ @ApiOperation("鏌ヨ鍑恒�佸叆闄㈢湅鐥呬汉娆″拰浜烘暟")
+ public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) {
+ return success(patMedInhospService.selectPatMedInhospListCount(patMedReq));
}
/**
* 瀵煎嚭鎮h�呬綇闄㈣褰曞垪琛�
*/
@ApiOperation("瀵煎嚭鎮h�呬綇闄㈣褰曞垪琛�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')")
@Log(title = "鎮h�呬綇闄㈣褰�", businessType = BusinessType.EXPORT)
@PostMapping("/export")
- public void export(HttpServletResponse response, PatMedInhosp patMedInhosp)
- {
+ public void export(HttpServletResponse response, PatMedInhosp patMedInhosp) {
List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
ExcelUtil<PatMedInhosp> util = new ExcelUtil<PatMedInhosp>(PatMedInhosp.class);
util.exportExcel(response, list, "鎮h�呬綇闄㈣褰曟暟鎹�");
@@ -62,10 +109,9 @@
* 鑾峰彇鎮h�呬綇闄㈣褰曡缁嗕俊鎭�
*/
@ApiOperation("鑾峰彇鎮h�呬綇闄㈣褰曡缁嗕俊鎭�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')")
@GetMapping(value = "/{inhospid}")
- public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid)
- {
+ public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid) {
return success(patMedInhospService.selectPatMedInhospByInhospid(inhospid));
}
@@ -73,11 +119,10 @@
* 鏂板鎮h�呬綇闄㈣褰�
*/
@ApiOperation("鏂板鎮h�呬綇闄㈣褰�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')")
@Log(title = "鎮h�呬綇闄㈣褰�", businessType = BusinessType.INSERT)
@PostMapping("/add")
- public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp)
- {
+ public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp) {
return toAjax(patMedInhospService.insertPatMedInhosp(patMedInhosp));
}
@@ -85,11 +130,10 @@
* 淇敼鎮h�呬綇闄㈣褰�
*/
@ApiOperation("淇敼鎮h�呬綇闄㈣褰�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')")
@Log(title = "鎮h�呬綇闄㈣褰�", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
- public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp)
- {
+ public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp) {
return toAjax(patMedInhospService.updatePatMedInhosp(patMedInhosp));
}
@@ -97,11 +141,22 @@
* 鍒犻櫎鎮h�呬綇闄㈣褰�
*/
@ApiOperation("鍒犻櫎鎮h�呬綇闄㈣褰�")
- @PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')")
+ //@PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')")
@Log(title = "鎮h�呬綇闄㈣褰�", businessType = BusinessType.DELETE)
- @GetMapping("/remove/{inhospids}")
- public AjaxResult remove(@PathVariable Long[] inhospids)
- {
+ @GetMapping("/remove/{inhospids}")
+ public AjaxResult remove(@PathVariable Long[] inhospids) {
return toAjax(patMedInhospService.deletePatMedInhospByInhospids(inhospids));
}
+
+ /**
+ * 鍚勭瀹ゆ湇鍔′汉娆�
+ *
+ * @return
+ */
+ @ApiOperation("鍚勭瀹ゆ湇鍔′汉娆�")
+ @PostMapping("/getDeptRanking")
+ public TableDataInfo getDeptRanking(@RequestBody PatMedReq patMedReq) {
+ return getDataTable(patMedInhospService.getDeptRanking(patMedReq));
+ }
+
}
--
Gitblit v1.9.3