医生常用语模板维护->后端接口开发、数据库建表。

This commit is contained in:
2025-12-22 16:45:40 +08:00
parent 91d673de77
commit 25b3c26ec2
14 changed files with 277 additions and 1 deletions

View File

@@ -24,6 +24,10 @@
<artifactId>core-common</artifactId> <artifactId>core-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>

View File

@@ -22,6 +22,11 @@
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- Spring 配置 --> <!-- Spring 配置 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@@ -0,0 +1,16 @@
package com.openhis.web.doctorstation.appservice;
import com.core.common.core.domain.R;
import com.openhis.template.domain.DoctorPhrase;
public interface IDoctorPhraseAppService {
R<?> getDoctorPhraseList();
R<?> searchDoctorPhraseList(String phraseType);
R<?> addDoctorPhrase(DoctorPhrase doctorPhrase);
R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase);
R<?> deleteDoctorPhrase(Integer doctorPhraseId);
}

View File

@@ -0,0 +1,73 @@
package com.openhis.web.doctorstation.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.domain.R;
import com.openhis.template.domain.DoctorPhrase;
import com.openhis.template.service.IDoctorPhraseService;
import com.openhis.web.doctorstation.appservice.IDoctorPhraseAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService {
@Resource
private IDoctorPhraseService doctorPhraseService;
@Override
public R<?> getDoctorPhraseList() {
List<DoctorPhrase> list = doctorPhraseService.list();
return R.ok(list);
}
@Override
public R<?> searchDoctorPhraseList(String phraseType) {
//1.数据校验
if (phraseType == null || phraseType.equals("")) {
return R.fail("模板类型不能为空");
}
//2.查询
LambdaQueryWrapper<DoctorPhrase> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DoctorPhrase::getPhraseType, phraseType);
List<DoctorPhrase> list = doctorPhraseService.list(wrapper);
return R.ok(list);
}
@Override
public R<?> addDoctorPhrase(DoctorPhrase doctorPhrase) {
//1.数据校验
if(ObjectUtil.isEmpty(doctorPhrase)){
return R.fail("医生常用语不能为空");
}
//2.新增
boolean save = doctorPhraseService.save(doctorPhrase);
return R.ok(save);
}
@Override
public R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase) {
//1.数据校验
if(ObjectUtil.isEmpty(doctorPhrase)){
return R.fail("医生常用语不能为空");
}
//2.更新
boolean updateById = doctorPhraseService.updateById(doctorPhrase);
return R.ok(updateById);
}
@Override
public R<?> deleteDoctorPhrase(Integer doctorPhraseId) {
//1.数据校验
if(doctorPhraseId == null){
return R.fail("ID不能为空");
}
//2.删除
boolean removeById = doctorPhraseService.removeById(doctorPhraseId);
return R.ok(removeById);
}
}

View File

@@ -0,0 +1,75 @@
package com.openhis.web.doctorstation.controller;
import com.core.common.core.domain.R;
import com.openhis.template.domain.DoctorPhrase;
import com.openhis.web.doctorstation.appservice.IDoctorPhraseAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping("/Doctor-phrase")
public class DoctorPhraseController {
@Resource
private IDoctorPhraseAppService doctorPhraseAppService;
/**
* 获取医生常用语List
*
* @return 结果
*/
@GetMapping("/list")
public R<?> getDoctorPhraseList(){
return R.ok(doctorPhraseAppService.getDoctorPhraseList());
}
/**
* 查询医生常用语
*
* @param phraseType 模板级别
* @return 结果
*/
@GetMapping("/search")
public R<?> searchDoctorPhraseList(
@RequestParam(required = false) String phraseType
){
return R.ok(doctorPhraseAppService.searchDoctorPhraseList(phraseType));
}
/**
* 新增医生常用语
*
* @param doctorPhrase 医生常用语
* @return 结果
*/
@PostMapping("/add")
public R<?> addDoctorPhrase(@RequestBody DoctorPhrase doctorPhrase){
return R.ok(doctorPhraseAppService.addDoctorPhrase(doctorPhrase));
}
/**
* 更新医生常用语
*
* @param doctorPhrase 医生常用语
* @return 结果
*/
@PostMapping("/update")
public R<?> updateDoctorPhrase(@RequestBody DoctorPhrase doctorPhrase){
return R.ok(doctorPhraseAppService.updateDoctorPhrase(doctorPhrase));
}
/**
* 删除医生常用语
*
* @param DoctorPhraseId 医生常用语ID
* @return 结果
*/
@PostMapping("/delete/{DoctorPhraseId}")
public R<?> deleteDoctorPhrase(@PathVariable Integer DoctorPhraseId){
return R.ok(doctorPhraseAppService.deleteDoctorPhrase(DoctorPhraseId));
}
}

View File

@@ -0,0 +1,7 @@
package com.openhis.web.doctorstation.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface DoctorPhraseAppMapper {
}

View File

@@ -21,6 +21,11 @@
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- CORE--> <!-- CORE-->
<dependency> <dependency>
<groupId>com.core</groupId> <groupId>com.core</groupId>

View File

@@ -18,6 +18,10 @@
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.alibaba.fastjson2</groupId> <groupId>com.alibaba.fastjson2</groupId>

View File

@@ -0,0 +1,59 @@
package com.openhis.template.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Data
@Accessors(chain = true)
@TableName("adm_doctor_phrase")
@EqualsAndHashCode(callSuper = false)
public class DoctorPhrase {
/** id */
private Integer id;
/** 短语编码 */
private String phraseCode;
/** 模板名称 */
private String phraseName;
/** 模板级别1-个人 2-科室 3-全院) */
private Integer phraseType;
/** 业务分类(主诉/现病史等) */
private String phraseCategory;
/** 模板内容 */
private String phraseContent;
/** 所属医生ID */
private Integer staffId;
/** 所属科室编码 */
private String deptCode;
/** 排序号 */
private Integer sortNo;
/** 启用状态0-停用 1-启用) */
private Integer enableFlag;
/** 创建人ID */
private Integer creatorId;
/** 审核人ID */
private Integer auditorId;
/** 审核时间 */
private LocalDateTime auditTime;
/** 创建时间 */
private LocalDateTime createTime;
/** 更新时间 */
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,9 @@
package com.openhis.template.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.template.domain.DoctorPhrase;
import org.springframework.stereotype.Repository;
@Repository
public interface DoctorPhraseMapper extends BaseMapper<DoctorPhrase> {
}

View File

@@ -0,0 +1,7 @@
package com.openhis.template.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.template.domain.DoctorPhrase;
public interface IDoctorPhraseService extends IService<DoctorPhrase> {
}

View File

@@ -0,0 +1,12 @@
package com.openhis.template.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.openhis.template.domain.DoctorPhrase;
import com.openhis.template.mapper.DoctorPhraseMapper;
import com.openhis.template.service.IDoctorPhraseService;
import org.springframework.stereotype.Service;
@Service
public class DoctorPhraseServiceImpl extends ServiceImpl<DoctorPhraseMapper, DoctorPhrase> implements IDoctorPhraseService {
}

View File

@@ -38,7 +38,7 @@
<!-- override dependency version --> <!-- override dependency version -->
<tomcat.version>9.0.96</tomcat.version> <tomcat.version>9.0.96</tomcat.version>
<logback.version>1.2.13</logback.version> <logback.version>1.2.13</logback.version>
<lombok.version>1.18.38</lombok.version> <lombok.version>1.18.26</lombok.version>
<mybatis-plus.version>3.5.3</mybatis-plus.version> <mybatis-plus.version>3.5.3</mybatis-plus.version>
<flowable.version>6.8.0</flowable.version> <flowable.version>6.8.0</flowable.version>
<postgresql.version>42.2.27</postgresql.version> <postgresql.version>42.2.27</postgresql.version>