96-门诊医生站会诊申请确认界面和97-门诊会诊申请管理界面全部功能。

This commit is contained in:
weixin_45799331
2026-02-11 14:16:30 +08:00
parent 3ab7ea1898
commit 1747291f41
67 changed files with 213 additions and 6087 deletions

View File

@@ -1,24 +0,0 @@
package com.openhis.clinical.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.clinical.domain.InfectiousCard;
/**
* 传染病报卡表 Service接口
*/
public interface IInfectiousCardService extends IService<InfectiousCard> {
/**
* 保存传染病报告卡
* @param infectiousCard 传染病报告卡对象
* @return 保存结果
*/
boolean saveInfectiousCard(InfectiousCard infectiousCard);
/**
* 生成下一个卡片编号
* @param orgCode 医疗机构编码
* @return 下一个卡片编号(机构编码+YYYYMMDD+4位流水号
*/
String generateNextCardNo(String orgCode);
}

View File

@@ -1,67 +0,0 @@
package com.openhis.clinical.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.openhis.clinical.domain.InfectiousCard;
import com.openhis.clinical.mapper.InfectiousCardMapper;
import com.openhis.clinical.service.IInfectiousCardService;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* 传染病报卡表 Service实现
*/
@Service
public class InfectiousCardServiceImpl extends ServiceImpl<InfectiousCardMapper, InfectiousCard> implements IInfectiousCardService {
@Override
public String generateNextCardNo(String orgCode) {
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
String prefix = orgCode + dateStr;
// --- MyBatis-Plus Lambda 重构部分开始 ---
InfectiousCard maxCardEntity = this.lambdaQuery()
.select(InfectiousCard::getCardNo) // 只查询编号列
.likeRight(InfectiousCard::getCardNo, prefix) // 匹配前缀 (prefix%)
.orderByDesc(InfectiousCard::getCardNo) // 按编号降序
.last("LIMIT 1") // 取最大的一条
.one(); // 获取单条实体
String maxCardNo = (maxCardEntity != null) ? maxCardEntity.getCardNo() : null;
// --- 重构部分结束 ---
int nextSerial = 1;
if (maxCardNo != null && maxCardNo.length() >= 4) {
String lastFour = maxCardNo.substring(maxCardNo.length() - 4);
try {
nextSerial = Integer.parseInt(lastFour) + 1;
} catch (NumberFormatException e) {
// 流水号解析失败使用默认值1
}
}
return prefix + String.format("%04d", nextSerial);
}
@Override
public boolean saveInfectiousCard(InfectiousCard infectiousCard) {
// 设置默认值
if (infectiousCard.getStatus() == null) {
infectiousCard.setStatus(0);
}
if (infectiousCard.getReportDate() == null) {
infectiousCard.setReportDate(LocalDate.now());
}
if (infectiousCard.getCreateTime() == null) {
infectiousCard.setCreateTime(LocalDateTime.now());
} else {
infectiousCard.setUpdateTime(LocalDateTime.now());
}
return this.saveOrUpdate(infectiousCard);
}
}