From 8beb7f3d3d2bcd9b2f65f7c5eec48a0459fd8d85 Mon Sep 17 00:00:00 2001 From: qk123 <18211963828@163.com> Date: Tue, 23 Dec 2025 17:01:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B8=B8=E7=94=A8=E8=AF=AD?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91,=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/IDoctorPhraseAppService.java | 2 +- .../impl/DoctorPhraesAppServiceImpl.java | 24 +- .../controller/DoctorPhraseController.java | 6 +- .../openhis/template/domain/DoctorPhrase.java | 5 +- .../views/doctorstation/doctorphrase/api.js | 54 ++ .../doctorstation/doctorphrase/index.vue | 483 +++++++++++++++++- 6 files changed, 540 insertions(+), 34 deletions(-) create mode 100644 openhis-ui-vue3/src/views/doctorstation/doctorphrase/api.js diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorPhraseAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorPhraseAppService.java index e92d932a..c9e47334 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorPhraseAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorPhraseAppService.java @@ -6,7 +6,7 @@ import com.openhis.template.domain.DoctorPhrase; public interface IDoctorPhraseAppService { R getDoctorPhraseList(); - R searchDoctorPhraseList(String phraseName ,String phraseType); + R searchDoctorPhraseList(String phraseName ,Integer phraseType); R addDoctorPhrase(DoctorPhrase doctorPhrase); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java index 5a81c4ae..0f7e7dd6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java @@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.appservice.impl; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.core.common.core.domain.R; import com.openhis.template.domain.DoctorPhrase; import com.openhis.template.service.IDoctorPhraseService; @@ -24,14 +25,15 @@ public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService { } @Override - public R searchDoctorPhraseList(String phraseName,String phraseType) { - //1.数据校验 - if (phraseType == null || phraseType.equals("")) { - return R.fail("模板类型不能为空"); + public R searchDoctorPhraseList(String phraseName,Integer phraseType) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (phraseName !=null && ObjectUtil.isNotEmpty(phraseName)) { + wrapper.like(DoctorPhrase::getPhraseName, phraseName); + } + if (phraseType !=null && ObjectUtil.isNotEmpty(phraseType)) { + wrapper.eq(DoctorPhrase::getPhraseType, phraseType); } //2.查询 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(DoctorPhrase::getPhraseName, phraseName).eq(DoctorPhrase::getPhraseType, phraseType); List list = doctorPhraseService.list(wrapper); return R.ok(list); } @@ -42,8 +44,16 @@ public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService { if(ObjectUtil.isEmpty(doctorPhrase)){ return R.fail("医生常用语不能为空"); } - //2.新增 + //2.名称唯一性校验 + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.eq(DoctorPhrase::getPhraseName, doctorPhrase.getPhraseName()); + DoctorPhrase one = doctorPhraseService.getOne(wrapper); + if(ObjectUtil.isNotEmpty(one)){ + return R.fail("该名称已经存在"); + } + //3.新增 boolean save = doctorPhraseService.save(doctorPhrase); + System.out.println(save); return R.ok(save); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorPhraseController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorPhraseController.java index 5133ab70..0e4b05a2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorPhraseController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorPhraseController.java @@ -34,7 +34,7 @@ public class DoctorPhraseController { */ @GetMapping("/search") public R searchDoctorPhraseList( - @RequestParam(required = false) String phraseType, + @RequestParam(required = false) Integer phraseType, @RequestParam(required = false) String phraseName ){ return R.ok(doctorPhraseAppService.searchDoctorPhraseList(phraseName,phraseType)); @@ -57,7 +57,7 @@ public class DoctorPhraseController { * @param doctorPhrase 医生常用语 * @return 结果 */ - @PostMapping("/update") + @PutMapping("/update") public R updateDoctorPhrase(@RequestBody DoctorPhrase doctorPhrase){ return R.ok(doctorPhraseAppService.updateDoctorPhrase(doctorPhrase)); } @@ -68,7 +68,7 @@ public class DoctorPhraseController { * @param DoctorPhraseId 医生常用语ID * @return 结果 */ - @PostMapping("/delete/{DoctorPhraseId}") + @DeleteMapping("/delete/{DoctorPhraseId}") public R deleteDoctorPhrase(@PathVariable Integer DoctorPhraseId){ return R.ok(doctorPhraseAppService.deleteDoctorPhrase(DoctorPhraseId)); } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java index 8a5dae76..df260baa 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java @@ -1,5 +1,7 @@ package com.openhis.template.domain; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,10 +11,11 @@ import java.time.LocalDateTime; @Data @Accessors(chain = true) -@TableName("adm_doctor_phrase") +@TableName("adm_doctor_phrases") @EqualsAndHashCode(callSuper = false) public class DoctorPhrase { /** id */ + @TableId(value = "id", type = IdType.AUTO) private Integer id; /** 短语编码 */ diff --git a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/api.js b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/api.js new file mode 100644 index 00000000..40dd150c --- /dev/null +++ b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/api.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +/** + * 获取医生常用语列表 + */ +export function getDoctorPhraseList() { + return request({ + url: '/Doctor-phrase/list', + method: 'get' + }) +} + +/** + * 搜索医生常用语 + */ +export function searchDoctorPhraseList(phraseName, phraseType, phraseCategory) { + return request({ + url: '/Doctor-phrase/search', + method: 'get', + params: { phraseName, phraseType, phraseCategory } + }) +} + +/** + * 新增医生常用语 + */ +export function addDoctorPhrase(data) { + return request({ + url: '/Doctor-phrase/add', + method: 'post', + data + }) +} + +/** + * 更新医生常用语 + */ +export function updateDoctorPhrase(data) { + return request({ + url: '/Doctor-phrase/update', + method: 'put', + data + }) +} + +/** + * 删除医生常用语 + */ +export function deleteDoctorPhrase(DoctorPhraseId) { + return request({ + url: `/Doctor-phrase/delete/${DoctorPhraseId}`, + method: 'delete' + }) +} diff --git a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue index bf5272aa..225dfc15 100644 --- a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue @@ -3,30 +3,130 @@ - - - - - + + + + + + + + + + + + + + + @@ -43,38 +143,377 @@ :total="total" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +