From a2d12d52275c9fc34277d3e41c662a5ea9fb597f Mon Sep 17 00:00:00 2001 From: lige <bestlige@outlook.com> Date: 星期三, 24 一月 2024 10:11:44 +0800 Subject: [PATCH] 报告合并判断心电图和附件 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java | 47 +++++++++++++++++++++++++++++++---------------- 1 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java index dd209ac..2c078de 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java @@ -4,19 +4,18 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import cn.hutool.extra.pinyin.PinyinUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ltkj.common.core.domain.entity.SysDept; +import com.ltkj.framework.config.MatchUtils; +import com.ltkj.framework.web.domain.server.Sys; import com.ltkj.hosp.service.IDictOrgService; +import com.ltkj.system.service.ISysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; @@ -34,17 +33,29 @@ */ @RestController @RequestMapping("/hosp/hosp") -@Api(tags = "鍒嗛櫌绠$悊妯″潡鎺ュ彛") +@Api(tags = "PC绔� 鎵�灞炲尰闄㈢鐞嗘ā鍧楁帴鍙�") public class DictHospController extends BaseController { @Resource private IDictHospService dictHospService; @Resource private IDictOrgService orgService; + @Resource + private ISysDeptService deptService; + + @GetMapping("/getDeptListByDictHospId") + @ApiOperation(value = "璺熷尰闄㈡煡璇㈠搴旂殑閮ㄩ棬绉戝") + public AjaxResult getDeptListByDictHospId(@RequestParam String id ) { + List<SysDept> list = deptService.list(new LambdaQueryWrapper<SysDept>().eq(SysDept::getHospId,id)); + return AjaxResult.success(list); + } + + + /** * 鏌ヨ闄㈠尯淇℃伅鍒楄〃 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:list')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:list')") @GetMapping("/list") @ApiOperation(value = "鏌ヨ闄㈠尯淇℃伅鍒楄〃") public TableDataInfo list(DictHosp dictHosp) { @@ -56,7 +67,7 @@ /** * 瀵煎嚭闄㈠尯淇℃伅鍒楄〃 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:export')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:export')") @Log(title = "闄㈠尯淇℃伅", businessType = BusinessType.EXPORT) @PostMapping("/export") @ApiOperation(value = "瀵煎嚭闄㈠尯淇℃伅鍒楄〃") @@ -69,7 +80,7 @@ /** * 鑾峰彇闄㈠尯淇℃伅璇︾粏淇℃伅 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:query')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:query')") @GetMapping(value = "/{hospAreaId}") @ApiOperation(value = "鑾峰彇闄㈠尯淇℃伅璇︾粏淇℃伅") public AjaxResult getInfo(@PathVariable("hospAreaId") String hospAreaId) { @@ -79,19 +90,23 @@ /** * 鏂板闄㈠尯淇℃伅 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:add')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:add')") @Log(title = "闄㈠尯淇℃伅", businessType = BusinessType.INSERT) @PostMapping @ApiOperation(value = "鏂板闄㈠尯淇℃伅") public AjaxResult add(@RequestBody DictHosp dictHosp) { - dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); + if(null !=dictHosp.getHospid() ){ + dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); + } + dictHosp.setWbm(MatchUtils.toWubi(dictHosp.getHospAreaName())); + dictHosp.setSpell(PinyinUtil.getFirstLetter(dictHosp.getHospAreaName(),"")); return toAjax(dictHospService.save(dictHosp)); } /** * 淇敼闄㈠尯淇℃伅 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:edit')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:edit')") @Log(title = "闄㈠尯淇℃伅", businessType = BusinessType.UPDATE) @PutMapping @ApiOperation(value = "淇敼闄㈠尯淇℃伅") @@ -103,7 +118,7 @@ /** * 鍒犻櫎闄㈠尯淇℃伅 */ - @PreAuthorize("@ss.hasPermi('hosp:hosp:remove')") + //@PreAuthorize("@ss.hasPermi('hosp:hosp:remove')") @Log(title = "闄㈠尯淇℃伅", businessType = BusinessType.DELETE) @DeleteMapping("/{hospAreaIds}") @ApiOperation(value = "鍒犻櫎闄㈠尯淇℃伅") -- Gitblit v1.8.0