解决合并冲突

This commit is contained in:
2025-12-10 14:20:24 +08:00
parent e1385cb3e6
commit 18f6a845e6
804 changed files with 61881 additions and 13577 deletions

View File

@@ -0,0 +1,86 @@
package com.openhis.web.nenu.appservice;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.web.nenu.dto.GfRatioApplicationDefinitionSelectDto;
import com.openhis.web.nenu.dto.GfRatioApplicationPrintDto;
import com.openhis.web.nenu.dto.GfRatioApplicationProcessDto;
import com.openhis.web.nenu.dto.GfRatioApplicationRecordDto;
/**
* 公费医疗-比例调整申请记录 AppService
*
* @author Thanking
* @date 2025-10-21
*/
public interface IGfRatioApplicationRecordAppService {
/**
* 查询比例调整申请记录分页
*
* @param searchParam 查询参数
* @param printable 申请单是否可打印
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 比例调整申请记录分页
*/
R<IPage<GfRatioApplicationRecordDto>> getPage(GfRatioApplicationRecordDto searchParam, String printable,
String searchKey, Integer pageNo, Integer pageSize);
/**
* 查询比例调整申请记录详情
*
* @param id ID
* @return 比例调整申请记录详情
*/
R<GfRatioApplicationRecordDto> getDetail(Long id);
/**
* 创建比例调整申请
*
* @param gfRatioApplicationRecordDto 比例调整申请记录Dto
* @return 结果
*/
R<?> add(GfRatioApplicationRecordDto gfRatioApplicationRecordDto);
/**
* 取消比例调整申请
*
* @param id ID
* @return 结果
*/
R<?> cancel(Long id);
/**
* 处理比例调整申请
*
* @param gfRatioApplicationProcessDto 比例调整申请处理Dto
* @return 结果
*/
R<?> process(GfRatioApplicationProcessDto gfRatioApplicationProcessDto);
/**
* 查询申请项目选择弹窗分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param itemType 项目分类
* @param pageNo 页码
* @param pageSize 行数
* @return 申请项目选择弹窗分页
*/
R<IPage<GfRatioApplicationDefinitionSelectDto>> getDefinitionSelectPage(
GfRatioApplicationDefinitionSelectDto searchParam, String searchKey, Integer itemType, Integer pageNo,
Integer pageSize);
/**
* 查询申请单打印列表
*
* @param ids 多个ID逗号拼接
* @return 申请单打印列表
*/
R<List<GfRatioApplicationPrintDto>> getPrintList(String ids);
}

View File

@@ -0,0 +1,45 @@
package com.openhis.web.nenu.appservice;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.nenu.dto.GfTypeRatioDto;
import com.openhis.web.nenu.dto.GfIndividualRatioDto;
/**
* 公费医疗-自付比例管理 AppService
*
* @author Thanking
* @date 2025-10-21
*/
public interface IGfRatioManageAppService {
/**
* 查询大项比例列表
*
* @return 大项比例列表
*/
R<List<GfTypeRatioDto>> getTypeRatioList();
/**
* 保存大项比例列表
*
* @param typeRatioList 大项比例列表
* @return 结果
*/
R<?> saveTypeRatioList(List<GfTypeRatioDto> typeRatioList);
/**
* 查询单项比例分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 单项比例分页
*/
R<IPage<GfIndividualRatioDto>> getIndividualRatioPage(GfIndividualRatioDto searchParam, String searchKey,
Integer pageNo, Integer pageSize);
}

View File

@@ -0,0 +1,77 @@
package com.openhis.web.nenu.appservice;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.web.nenu.dto.GfStudentListDto;
/**
* 公费医疗-学生名单管理 AppService
*
* @author Thanking
* @date 2025-10-21
*/
public interface IGfStudentListAppService {
/**
* 查询学生名单分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 学生名单分页
*/
R<IPage<GfStudentListDto>> getPage(GfStudentListDto searchParam, String searchKey, Integer pageNo,
Integer pageSize);
/**
* 查询学生名单详情
*
* @param id ID
* @return 学生名单详情
*/
R<GfStudentListDto> getDetail(Long id);
/**
* 添加学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
R<?> add(GfStudentListDto gfStudentListDto);
/**
* 编辑学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
R<?> edit(GfStudentListDto gfStudentListDto);
/**
* 删除学生名单
*
* @param id ID
* @return 结果
*/
R<?> delete(Long id);
/**
* 导入学生名单
*
* @param file 文件
* @return 结果
*/
R<?> importData(MultipartFile file);
/**
* 获取导入模板
*
* @param response 响应
*/
void importTemplate(HttpServletResponse response);
}

View File

@@ -0,0 +1,572 @@
package com.openhis.web.nenu.appservice.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.enums.DeleteFlag;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.DateUtils;
import com.core.common.utils.SecurityUtils;
import com.openhis.administration.domain.ChargeItemDefinition;
import com.openhis.administration.service.IChargeItemDefinitionService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.enums.*;
import com.openhis.common.enums.ybenums.YbChrgitmLv;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.medication.domain.MedicationDefinition;
import com.openhis.medication.service.IMedicationDefinitionService;
import com.openhis.nenu.domain.GfRatio;
import com.openhis.nenu.domain.GfRatioApplication;
import com.openhis.nenu.service.IGfRatioApplicationService;
import com.openhis.nenu.service.IGfRatioService;
import com.openhis.web.nenu.appservice.IGfRatioApplicationRecordAppService;
import com.openhis.web.nenu.dto.GfRatioApplicationDefinitionSelectDto;
import com.openhis.web.nenu.dto.GfRatioApplicationPrintDto;
import com.openhis.web.nenu.dto.GfRatioApplicationProcessDto;
import com.openhis.web.nenu.dto.GfRatioApplicationRecordDto;
import com.openhis.web.nenu.mapper.GfRatioApplicationRecordAppMapper;
import com.openhis.workflow.domain.ActivityDefinition;
import com.openhis.workflow.service.IActivityDefinitionService;
/**
* 公费医疗-比例调整申请记录 AppServiceImpl
*
* @author Thanking
* @date 2025-10-21
*/
@Service
public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicationRecordAppService {
@Autowired
private IGfRatioService gfRatioService;
@Autowired
private IGfRatioApplicationService gfRatioApplicationService;
@Autowired
private IMedicationDefinitionService medicationDefinitionService;
@Autowired
private IActivityDefinitionService activityDefinitionService;
@Autowired
private IChargeItemDefinitionService chargeItemDefinitionService;
@Autowired
private GfRatioApplicationRecordAppMapper gfRatioApplicationRecordAppMapper;
@Autowired
private AssignSeqUtil assignSeqUtil;
/**
* 查询比例调整申请记录分页
*
* @param searchParam 查询参数
* @param printable 申请单是否可打印
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 比例调整申请记录分页
*/
@Override
public R<IPage<GfRatioApplicationRecordDto>> getPage(GfRatioApplicationRecordDto searchParam, String printable,
String searchKey, Integer pageNo, Integer pageSize) {
// 构造查询条件
QueryWrapper<GfRatioApplicationRecordDto> queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam, searchKey,
new HashSet<>(Set.of("application_no", "bus_no", "name", "py_str", "wb_str", "yb_no")), null);
// 可打印筛选
if (Whether.YES.getCode().equals(printable)) {
queryWrapper.eq("application_status", GfApplicationStatus.PROCESSING.getValue()).eq("final_approval_result",
GfApplicationStatus.PROCESSING.getValue());
}
// 查询比例调整申请记录分页
IPage<GfRatioApplicationRecordDto> page = gfRatioApplicationRecordAppMapper
.selectGfRatioApplicationRecordPage(new Page<>(pageNo, pageSize), queryWrapper);
for (GfRatioApplicationRecordDto r : page.getRecords()) {
// 翻译非字典枚举
GfItemType gfItemType = GfItemType.getByValue(r.getItemType());
if (gfItemType != null) {
r.setItemTypeName(gfItemType.getInfo());
}
}
return R.ok(page);
}
/**
* 查询比例调整申请记录详情
*
* @param id ID
* @return 比例调整申请记录详情
*/
@Override
public R<GfRatioApplicationRecordDto> getDetail(Long id) {
// 查询比例调整申请记录详情
GfRatioApplication gfRatioApplication = gfRatioApplicationService.getById(id);
if (gfRatioApplication == null) {
return R.fail();
}
// 定义返回Dto
GfRatioApplicationRecordDto gfRatioApplicationRecordDto = new GfRatioApplicationRecordDto();
String defTableName = CommonConstants.TableName.MED_MEDICATION_DEFINITION;
String chrgitmLv = YbChrgitmLv.SELF_PAY.getCode();
String ybNo = null;
if (GfItemType.MEDICATION.getValue().equals(gfRatioApplication.getItemType())) {
// 如果是药品,获取并设置药品定义信息
MedicationDefinition medicationDefinition =
medicationDefinitionService.getById(gfRatioApplication.getDefinitionId());
if (medicationDefinition != null) {
gfRatioApplicationRecordDto.setBusNo(medicationDefinition.getBusNo())
.setName(medicationDefinition.getName()).setYbNo(medicationDefinition.getYbNo())
// 公费项目分类:药品
.setItemTypeName(GfItemType.MEDICATION.getInfo());
chrgitmLv =
Optional.of(medicationDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue()).toString();
ybNo = medicationDefinition.getYbNo();
}
} else if (GfItemType.ACTIVITY.getValue().equals(gfRatioApplication.getItemType())) {
// 如果是诊疗,获取并设置诊疗定义信息
ActivityDefinition activityDefinition =
activityDefinitionService.getById(gfRatioApplication.getDefinitionId());
if (activityDefinition != null) {
gfRatioApplicationRecordDto.setBusNo(activityDefinition.getBusNo())
.setName(activityDefinition.getName()).setYbNo(activityDefinition.getYbNo())
// 公费项目分类:诊疗
.setItemTypeName(GfItemType.ACTIVITY.getInfo());
chrgitmLv =
Optional.of(activityDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue()).toString();
ybNo = activityDefinition.getYbNo();
}
defTableName = CommonConstants.TableName.WOR_ACTIVITY_DEFINITION;
}
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByCode(chrgitmLv);
// 查询原支付比例
Pair<Pair<BigDecimal, BigDecimal>, BigDecimal> oldRatiosAndPrice =
this.getOldRatiosAndPrice(gfRatioApplication.getDefinitionId(), defTableName, chrgitmLv);
// Dto赋值返回
gfRatioApplicationRecordDto.setId(gfRatioApplication.getId()).setApplicationNo(gfRatioApplication.getBusNo())
.setItemType(gfRatioApplication.getItemType())
// 医保编号
.setYbNo(ybNo)
// 医保等级名称
.setChrgitmLvName(ybChrgitmLv == null ? null : ybChrgitmLv.getInfo())
.setApplicationRatio(gfRatioApplication.getApplicationRatio())
.setOldRatio(oldRatiosAndPrice.getLeft().getLeft()).setTotalPrice(oldRatiosAndPrice.getRight())
// 价格差:计算得出
.setPriceDiff(oldRatiosAndPrice.getLeft().getLeft() != null
&& gfRatioApplication.getApplicationRatio() != null && oldRatiosAndPrice.getRight() != null
? gfRatioApplication.getApplicationRatio().subtract(oldRatiosAndPrice.getLeft().getLeft())
.multiply(oldRatiosAndPrice.getRight()).divide(new BigDecimal(100), RoundingMode.UNNECESSARY)
: null)
.setTwiceRatio(gfRatioApplication.getTwiceRatio()).setOldTwiceRatio(oldRatiosAndPrice.getLeft().getRight())
.setStartDate(gfRatioApplication.getStartDate()).setEndDate(gfRatioApplication.getEndDate())
.setApplicationStatus(gfRatioApplication.getApplicationStatus())
.setApplicant(gfRatioApplication.getApplicant()).setApplicationTime(gfRatioApplication.getApplicationTime())
.setApplicationReason(gfRatioApplication.getApplicationReason())
.setInitialApprover(gfRatioApplication.getInitialApprover())
.setInitialApprovalResult(gfRatioApplication.getInitialApprovalResult())
.setInitialApprovalTime(gfRatioApplication.getInitialApprovalTime())
.setInitialApprovalOpinion(gfRatioApplication.getInitialApprovalOpinion())
.setFinanceApprover(gfRatioApplication.getFinanceApprover())
.setFinanceApprovalResult(gfRatioApplication.getFinanceApprovalResult())
.setFinanceApprovalTime(gfRatioApplication.getFinanceApprovalTime())
.setFinanceApprovalOpinion(gfRatioApplication.getFinanceApprovalOpinion())
.setFinalRecorder(gfRatioApplication.getFinalRecorder())
.setFinalApprovalResult(gfRatioApplication.getFinalApprovalResult())
.setFinalRecordTime(gfRatioApplication.getFinalRecordTime())
.setFinalApprovalOpinion(gfRatioApplication.getFinalApprovalOpinion());
return R.ok(gfRatioApplicationRecordDto);
}
/**
* 创建比例调整申请
*
* @param gfRatioApplicationRecordDto 比例调整申请记录Dto
* @return 结果
*/
@Override
public R<?> add(GfRatioApplicationRecordDto gfRatioApplicationRecordDto) {
// 查询指定项目现行比例
List<GfRatio> gfRatioList = gfRatioService.list(new LambdaQueryWrapper<GfRatio>()
.eq(GfRatio::getDefinitionId, gfRatioApplicationRecordDto.getDefinitionId())
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
// 验证时间是否重叠
if (!gfRatioList.isEmpty()) {
for (GfRatio r : gfRatioList) {
if (!r.getStartDate().after(gfRatioApplicationRecordDto.getEndDate())
&& !r.getEndDate().before(gfRatioApplicationRecordDto.getStartDate())) {
return R.fail("该项目此次申请的开始结束时间与现行比例开始结束时间有重叠,请确认");
}
}
}
// 创建申请
GfRatioApplication gfRatioApplication = new GfRatioApplication()
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.GF_RATIO_APPLICATION.getPrefix(), 4))
.setItemType(gfRatioApplicationRecordDto.getItemType())
.setApplicationRatio(gfRatioApplicationRecordDto.getApplicationRatio())
.setTwiceRatio(gfRatioApplicationRecordDto.getTwiceRatio())
.setStartDate(gfRatioApplicationRecordDto.getStartDate())
// 结束时间调整为当天23点59分59秒
.setEndDate(DateUtils.addSeconds(DateUtils.addDays(gfRatioApplicationRecordDto.getEndDate(), 1), -1))
// 申请状态:处理中
.setApplicationStatus(GfApplicationStatus.PROCESSING.getValue()).setApplicant(SecurityUtils.getNickName())
.setApplicationTime(DateUtils.getNowDate())
.setApplicationReason(gfRatioApplicationRecordDto.getApplicationReason())
// 测算通过or驳回处理中
.setInitialApprovalResult(GfApplicationStatus.PROCESSING.getValue())
.setDefinitionId(gfRatioApplicationRecordDto.getDefinitionId());
gfRatioApplicationService.save(gfRatioApplication);
return R.ok();
}
/**
* 取消比例调整申请
*
* @param id ID
* @return 结果
*/
@Override
public R<?> cancel(Long id) {
// 存在验证
GfRatioApplication gfRatioApplication = gfRatioApplicationService.getById(id);
if (gfRatioApplication == null) {
return R.fail("申请不存在");
}
// 状态验证
if (!GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getApplicationStatus())
&& !GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getInitialApprovalResult())) {
return R.fail("该申请已不可取消");
}
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(), new LambdaUpdateWrapper<GfRatioApplication>()
// 申请状态:取消
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.CANCELLED.getValue())
// 测算通过or驳回NULL
.set(GfRatioApplication::getInitialApprovalResult, null).eq(GfRatioApplication::getId, id));
return null;
}
/**
* 处理比例调整申请
*
* @param gfRatioApplicationProcessDto 比例调整申请处理Dto
* @return 结果
*/
@Override
public R<?> process(GfRatioApplicationProcessDto gfRatioApplicationProcessDto) {
// 存在验证
GfRatioApplication gfRatioApplication = gfRatioApplicationService.getById(gfRatioApplicationProcessDto.getId());
if (gfRatioApplication == null) {
return R.fail("申请不存在");
}
// 状态验证
if (GfApplicationStatus.APPROVED.getValue().equals(gfRatioApplication.getApplicationStatus())) {
return R.fail("该申请已被通过,无需处理");
}
if (GfApplicationStatus.REJECTED.getValue().equals(gfRatioApplication.getApplicationStatus())) {
return R.fail("该申请已被驳回,不可处理");
}
if (GfApplicationStatus.CANCELLED.getValue().equals(gfRatioApplication.getApplicationStatus())) {
return R.fail("该申请已被取消,不可处理");
}
// 根据执行操作的角色分别处理
String loginUserName = SecurityUtils.getNickName();
Date now = DateUtils.getNowDate();
// 【测算盈亏】
if (GfApprovalRole.INITIAL_APPROVER.getValue().equals(gfRatioApplicationProcessDto.getApprovalRole())) {
if (!GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getInitialApprovalResult())) {
return R.fail("该节点已被处理,不可再处理");
}
// 申请通过
if (GfApplicationStatus.APPROVED.getValue().equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(),
new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getInitialApprover, loginUserName)
// 测算通过or驳回通过
.set(GfRatioApplication::getInitialApprovalResult, GfApplicationStatus.APPROVED.getValue())
.set(GfRatioApplication::getInitialApprovalTime, now)
.set(GfRatioApplication::getInitialApprovalOpinion,
gfRatioApplicationProcessDto.getApprovalOpinion())
// 财务科通过or驳回处理中
.set(GfRatioApplication::getFinanceApprovalResult, GfApplicationStatus.PROCESSING.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
// 申请驳回
} else if (GfApplicationStatus.REJECTED.getValue()
.equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(),
new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getInitialApprover, loginUserName)
// 测算通过or驳回驳回
.set(GfRatioApplication::getInitialApprovalResult, GfApplicationStatus.REJECTED.getValue())
.set(GfRatioApplication::getInitialApprovalTime, now)
.set(GfRatioApplication::getInitialApprovalOpinion,
gfRatioApplicationProcessDto.getApprovalOpinion())
// 申请状态:驳回
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.REJECTED.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
} else {
return R.fail("通过or驳回指定错误");
}
// 【财务科报批】
} else if (GfApprovalRole.FINANCE_APPROVER.getValue().equals(gfRatioApplicationProcessDto.getApprovalRole())) {
if (!GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getFinanceApprovalResult())) {
return R.fail("该节点已被处理,不可再处理");
}
// 申请通过
if (GfApplicationStatus.APPROVED.getValue().equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(),
new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getFinanceApprover, loginUserName)
// 财务科通过or驳回通过
.set(GfRatioApplication::getFinanceApprovalResult, GfApplicationStatus.APPROVED.getValue())
.set(GfRatioApplication::getFinanceApprovalTime, now)
.set(GfRatioApplication::getFinanceApprovalOpinion,
gfRatioApplicationProcessDto.getApprovalOpinion())
// 会议通过or驳回处理中
.set(GfRatioApplication::getFinalApprovalResult, GfApplicationStatus.PROCESSING.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
// 申请驳回
} else if (GfApplicationStatus.REJECTED.getValue()
.equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(),
new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getFinanceApprover, loginUserName)
// 财务科通过or驳回驳回
.set(GfRatioApplication::getFinanceApprovalResult, GfApplicationStatus.REJECTED.getValue())
.set(GfRatioApplication::getFinanceApprovalTime, now)
.set(GfRatioApplication::getFinanceApprovalOpinion,
gfRatioApplicationProcessDto.getApprovalOpinion())
// 申请状态:驳回
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.REJECTED.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
} else {
return R.fail("通过or驳回指定错误");
}
// 【会议结果录入】
} else if (GfApprovalRole.FINAL_RECORDER.getValue().equals(gfRatioApplicationProcessDto.getApprovalRole())) {
if (!GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getFinalApprovalResult())) {
return R.fail("该节点已被处理,不可再处理");
}
// 申请通过
if (GfApplicationStatus.APPROVED.getValue().equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(), new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getFinalRecorder, loginUserName)
// 会议通过or驳回通过
.set(GfRatioApplication::getFinalApprovalResult, GfApplicationStatus.APPROVED.getValue())
.set(GfRatioApplication::getFinalRecordTime, now)
.set(GfRatioApplication::getFinalApprovalOpinion, gfRatioApplicationProcessDto.getApprovalOpinion())
// 申请状态:通过
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.APPROVED.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
// 创建现行自付比例
GfRatio gfRatio = new GfRatio()
// 比例类型:单项比例
.setRatioType(GfRatioType.INDIVIDUAL_RATIO.getValue()).setItemType(gfRatioApplication.getItemType())
.setSelfRatio(gfRatioApplication.getApplicationRatio())
.setTwiceRatio(gfRatioApplication.getTwiceRatio()).setStartDate(gfRatioApplication.getStartDate())
.setEndDate(gfRatioApplication.getEndDate()).setDefinitionId(gfRatioApplication.getDefinitionId());
gfRatioService.save(gfRatio);
// 申请驳回
} else if (GfApplicationStatus.REJECTED.getValue()
.equals(gfRatioApplicationProcessDto.getApprovalResult())) {
// 申请驳回,更新申请记录
gfRatioApplicationService.update(new GfRatioApplication(), new LambdaUpdateWrapper<GfRatioApplication>()
.set(GfRatioApplication::getFinalRecorder, loginUserName)
// 财务科通过or驳回驳回
.set(GfRatioApplication::getFinalApprovalResult, GfApplicationStatus.REJECTED.getValue())
.set(GfRatioApplication::getFinalRecordTime, now)
.set(GfRatioApplication::getFinalApprovalOpinion, gfRatioApplicationProcessDto.getApprovalOpinion())
// 申请状态:驳回
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.REJECTED.getValue())
.eq(GfRatioApplication::getId, gfRatioApplicationProcessDto.getId()));
} else {
return R.fail("通过or驳回指定错误");
}
} else {
return R.fail("角色指定错误");
}
return R.ok();
}
/**
* 查询申请项目选择弹窗分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param itemType 项目分类
* @param pageNo 页码
* @param pageSize 行数
* @return 申请项目选择弹窗分页
*/
@Override
public R<IPage<GfRatioApplicationDefinitionSelectDto>> getDefinitionSelectPage(
GfRatioApplicationDefinitionSelectDto searchParam, String searchKey, Integer itemType, Integer pageNo,
Integer pageSize) {
// 构造查询条件
QueryWrapper<GfRatioApplicationDefinitionSelectDto> queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam,
searchKey, new HashSet<>(Set.of("bus_no", "name", "py_str", "wb_str", "yb_no")), null);
// 查询比例调整申请记录分页
IPage<GfRatioApplicationDefinitionSelectDto> page = gfRatioApplicationRecordAppMapper
.selectGfRatioApplicationDefinitionSelectPage(itemType, new Page<>(pageNo, pageSize), queryWrapper);
// 翻译非字典枚举
for (GfRatioApplicationDefinitionSelectDto dto : page.getRecords()) {
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByValue(dto.getChrgitmLv());
if (ybChrgitmLv != null) {
dto.setChrgitmLvName(ybChrgitmLv.getInfo());
}
}
return R.ok(page);
}
/**
* 查询申请单打印列表
*
* @param ids 多个ID逗号拼接
* @return 申请单打印列表
*/
@Override
public R<List<GfRatioApplicationPrintDto>> getPrintList(String ids) {
// 切割读取多个ID
List<Long> idList;
try {
idList = Arrays.stream(ids.split(",")).map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf)
.collect(Collectors.toList());
} catch (NumberFormatException e) {
return R.fail("传参有误");
}
if (idList.isEmpty()) {
return R.ok(Collections.emptyList());
}
// 查询要打印的申请单
List<GfRatioApplication> applicationList =
gfRatioApplicationService.list(new LambdaQueryWrapper<GfRatioApplication>()
.in(GfRatioApplication::getId, idList).orderByDesc(GfRatioApplication::getId));
if (applicationList.isEmpty()) {
return R.ok(Collections.emptyList());
}
// 循环做出打印信息列表
List<GfRatioApplicationPrintDto> printDtoList = new ArrayList<>();
GfRatioApplicationPrintDto printDto;
for (GfRatioApplication application : applicationList) {
printDto = new GfRatioApplicationPrintDto();
String itemName = "";
String ybLv = YbChrgitmLv.SELF_PAY.getCode();
String defTableName = CommonConstants.TableName.MED_MEDICATION_DEFINITION;
if (GfItemType.MEDICATION.getValue().equals(application.getItemType())) {
// 获取药品名称和医保等级
MedicationDefinition medicationDefinition =
medicationDefinitionService.getById(application.getDefinitionId());
if (medicationDefinition != null) {
itemName = medicationDefinition.getName();
ybLv = Optional.of(medicationDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue())
.toString();
}
} else if (GfItemType.ACTIVITY.getValue().equals(application.getItemType())) {
// 获取诊疗名称和医保等级
ActivityDefinition activityDefinition =
activityDefinitionService.getById(application.getDefinitionId());
if (activityDefinition != null) {
itemName = activityDefinition.getName();
ybLv = Optional.of(activityDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue())
.toString();
}
defTableName = CommonConstants.TableName.WOR_ACTIVITY_DEFINITION;
}
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByCode(ybLv);
// 查询原支付比例和价格(包括二次比例)
Pair<Pair<BigDecimal, BigDecimal>, BigDecimal> oldRatiosAndPrice =
this.getOldRatiosAndPrice(application.getDefinitionId(), defTableName, ybLv);
BigDecimal oldRatio = oldRatiosAndPrice.getLeft().getLeft();
BigDecimal oldTwiceRatio = oldRatiosAndPrice.getLeft().getRight();
BigDecimal totalPrice = oldRatiosAndPrice.getRight();
// 作成返回Dto
printDto.setItemName(itemName)
// 全价
.setTotalPrice(totalPrice == null ? "" : totalPrice.stripTrailingZeros().toPlainString())
// 医保等级
.setChrgitmLv(ybChrgitmLv == null ? "" : ybChrgitmLv.getInfo())
// 原支付比例
.setOldRatio(oldRatio == null ? "" : oldRatio.stripTrailingZeros().toPlainString())
// 新支付比例
.setNewRatio(application.getApplicationRatio() == null ? ""
: application.getApplicationRatio().stripTrailingZeros().toPlainString())
// 价格差
.setPriceDiff(oldRatio != null && application.getApplicationRatio() != null && totalPrice != null
? application.getApplicationRatio().subtract(oldRatio).multiply(totalPrice)
.divide(new BigDecimal(100), RoundingMode.UNNECESSARY).stripTrailingZeros().toPlainString()
: "")
// 原二次支付比例
.setOldTwiceRatio(oldTwiceRatio == null ? "" : oldTwiceRatio.stripTrailingZeros().toPlainString())
// 新二次支付比例
.setNewTwiceRatio(application.getTwiceRatio() == null ? ""
: application.getTwiceRatio().stripTrailingZeros().toPlainString());
printDtoList.add(printDto);
}
return R.ok(printDtoList);
}
/**
* 查询原支付比例和价格(包括二次比例)
*
* @param definitionId 定义ID
* @param definitionTableName 定义表名
* @param ybLv 医保等级
* @return 原支付比例和价格(包括二次比例)
*/
private Pair<Pair<BigDecimal, BigDecimal>, BigDecimal> getOldRatiosAndPrice(Long definitionId,
String definitionTableName, String ybLv) {
BigDecimal oldRatio = null;
BigDecimal price = null;
// 查询费用定价
List<ChargeItemDefinition> chargeItemDefinitionList = chargeItemDefinitionService
.list(new LambdaQueryWrapper<ChargeItemDefinition>().eq(ChargeItemDefinition::getInstanceId, definitionId)
.eq(ChargeItemDefinition::getInstanceTable, definitionTableName)
.orderByDesc(ChargeItemDefinition::getId));
if (!chargeItemDefinitionList.isEmpty()) {
price = chargeItemDefinitionList.get(0).getPrice();
// 查询现行大类比例
List<GfRatio> typeRatioList = gfRatioService
.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getRatioType, GfRatioType.TYPE_RATIO.getValue())
.eq(GfRatio::getYbClass, chargeItemDefinitionList.get(0).getYbType()).eq(GfRatio::getYbLv, ybLv)
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
if (!typeRatioList.isEmpty()) {
oldRatio = typeRatioList.get(0).getSelfRatio();
}
}
// 查询历史小项比例
List<GfRatio> historicalRatioList =
gfRatioService.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getDefinitionId, definitionId)
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByDesc(GfRatio::getId));
BigDecimal oldTwiceRatio = null;
if (!historicalRatioList.isEmpty()) {
GfRatio latestRatio = historicalRatioList.get(0);
Date now = DateUtils.getNowDate();
// 只获取还在生效中的历史小项比例
if (latestRatio.getStartDate().before(now) && latestRatio.getEndDate().after(now)) {
oldRatio = latestRatio.getSelfRatio();
oldTwiceRatio = latestRatio.getTwiceRatio();
}
}
return Pair.of(Pair.of(oldRatio, oldTwiceRatio), price);
}
}

View File

@@ -0,0 +1,123 @@
package com.openhis.web.nenu.appservice.impl;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.enums.DeleteFlag;
import com.openhis.common.enums.GfItemType;
import com.openhis.common.enums.GfRatioType;
import com.openhis.common.enums.ybenums.YbChrgitmLv;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.nenu.domain.GfRatio;
import com.openhis.nenu.dto.GfTypeRatioDto;
import com.openhis.nenu.service.IGfRatioService;
import com.openhis.web.nenu.appservice.IGfRatioManageAppService;
import com.openhis.web.nenu.dto.GfIndividualRatioDto;
import com.openhis.web.nenu.mapper.GfRatioManageAppMapper;
/**
* 公费医疗-自付比例管理 AppServiceImpl
*
* @author Thanking
* @date 2025-10-21
*/
@Service
public class GfRatioManageAppServiceImpl implements IGfRatioManageAppService {
@Autowired
private IGfRatioService gfRatioService;
@Autowired
private GfRatioManageAppMapper gfRatioManageAppMapper;
/**
* 查询大项比例列表
*
* @return 大项比例列表
*/
@Override
public R<List<GfTypeRatioDto>> getTypeRatioList() {
return R.ok(gfRatioService.getTypeRatioList());
}
/**
* 保存大项比例列表
*
* @param typeRatioList 大项比例列表
* @return 结果
*/
@Override
public R<?> saveTypeRatioList(List<GfTypeRatioDto> typeRatioList) {
// 查询DB中的所有大项比例
List<GfRatio> gfRatioList = gfRatioService
.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getRatioType, GfRatioType.TYPE_RATIO.getValue())
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
// 做成医保分项+医保等级拼接的Map
Map<String, GfRatio> gfRatioMap =
gfRatioList.stream().collect(Collectors.toMap(e -> e.getYbClass() + e.getYbLv(), Function.identity()));
// 遍历输入项
List<GfRatio> addGfRatioList = new ArrayList<>();
List<GfRatio> editGfRatioList = new ArrayList<>();
for (GfTypeRatioDto dto : typeRatioList) {
if (dto.getSelfRatio() == null) {
continue;
}
GfRatio editGfRatio = gfRatioMap.get(dto.getYbClass() + dto.getYbLv());
if (editGfRatio == null) {
// DB不存在时新增
GfRatio addGfRatio = new GfRatio().setRatioType(GfRatioType.TYPE_RATIO.getValue())
.setYbClass(dto.getYbClass()).setYbLv(dto.getYbLv()).setSelfRatio(dto.getSelfRatio());
addGfRatioList.add(addGfRatio);
} else {
// DB存在时修改
editGfRatio.setSelfRatio(dto.getSelfRatio());
editGfRatioList.add(editGfRatio);
}
}
// 批量DB处理
if (!addGfRatioList.isEmpty()) {
gfRatioService.saveBatch(addGfRatioList);
}
if (!editGfRatioList.isEmpty()) {
gfRatioService.updateBatchById(editGfRatioList);
}
return R.ok();
}
/**
* 查询单项比例分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 单项比例分页
*/
@Override
public R<IPage<GfIndividualRatioDto>> getIndividualRatioPage(GfIndividualRatioDto searchParam, String searchKey,
Integer pageNo, Integer pageSize) {
// 构造查询条件
QueryWrapper<GfIndividualRatioDto> queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam, searchKey,
new HashSet<>(Set.of("bus_no", "name", "py_str", "wb_str", "yb_no")), null);
// 查询单项比例分页
IPage<GfIndividualRatioDto> page =
gfRatioManageAppMapper.selectGfIndividualRatioPage(new Page<>(pageNo, pageSize), queryWrapper);
// 设置公费项目分类名称
for (GfIndividualRatioDto dto : page.getRecords()) {
dto.setItemTypeName(GfItemType.getByValue(dto.getItemType()).getInfo());
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByValue(dto.getChrgitmLv());
if (ybChrgitmLv != null) {
dto.setChrgitmLvName(ybChrgitmLv.getInfo());
}
}
return R.ok(page);
}
}

View File

@@ -0,0 +1,443 @@
package com.openhis.web.nenu.appservice.impl;
import java.time.format.DateTimeParseException;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.enums.DeleteFlag;
import com.core.common.utils.*;
import com.core.common.utils.poi.ExcelUtil;
import com.openhis.administration.domain.Patient;
import com.openhis.administration.domain.PatientStudent;
import com.openhis.administration.service.IPatientService;
import com.openhis.administration.service.IPatientStudentService;
import com.openhis.common.enums.AssignSeqEnum;
import com.openhis.common.enums.PhysicalExamResult;
import com.openhis.common.enums.StudentStatus;
import com.openhis.common.utils.CommonUtil;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.common.utils.IdCardUtil;
import com.openhis.web.nenu.appservice.IGfStudentListAppService;
import com.openhis.web.nenu.dto.GfStudentListDto;
import com.openhis.web.nenu.dto.GfStudentListImportDto;
import com.openhis.web.nenu.mapper.GfStudentListAppMapper;
/**
* 公费医疗-学生名单管理 AppServiceImpl
*
* @author Thanking
* @date 2025-10-21
*/
@Service
public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
@Autowired
private IPatientStudentService patientStudentService;
@Autowired
private IPatientService patientService;
@Autowired
private GfStudentListAppMapper gfStudentListAppMapper;
@Autowired
private AssignSeqUtil assignSeqUtil;
/**
* 查询学生名单分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 学生名单分页
*/
@Override
public R<IPage<GfStudentListDto>> getPage(GfStudentListDto searchParam, String searchKey, Integer pageNo,
Integer pageSize) {
// 构造查询条件
QueryWrapper<GfStudentListDto> queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam, searchKey,
new HashSet<>(Set.of("name", "py_str", "wb_str", "student_id", "id_number")), null);
// 查询学生名单分页
IPage<GfStudentListDto> page =
gfStudentListAppMapper.selectGfStudentListPage(new Page<>(pageNo, pageSize), queryWrapper);
return R.ok(page);
}
/**
* 查询学生名单详情
*
* @param id ID
* @return 学生名单详情
*/
@Override
public R<GfStudentListDto> getDetail(Long id) {
// 查询学生名单详情
PatientStudent patientStudent = patientStudentService.getById(id);
if (patientStudent == null) {
return R.fail();
}
// 返回Dto赋值
GfStudentListDto gfStudentListDto = new GfStudentListDto().setId(patientStudent.getId())
.setName(patientStudent.getName()).setGender(patientStudent.getGender()).setAge(patientStudent.getAge())
.setStudentId(patientStudent.getStudentId()).setIdNumber(patientStudent.getIdNumber())
.setPhone(patientStudent.getPhone()).setCollege(patientStudent.getCollege())
.setMajor(patientStudent.getMajor()).setEducationLevel(patientStudent.getEducationLevel())
.setEnrollmentDate(patientStudent.getEnrollmentDate()).setGraduationDate(patientStudent.getGraduationDate())
.setGrade(patientStudent.getGrade()).setStudyMode(patientStudent.getStudyMode())
.setStudentStatus(patientStudent.getStudentStatus())
.setPhysicalExamResult(patientStudent.getPhysicalExamResult()).setCounselor(patientStudent.getCounselor())
.setCounselorPhone(patientStudent.getCounselorPhone()).setPatientId(patientStudent.getPatientId());
return R.ok(gfStudentListDto);
}
/**
* 添加学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
@Override
public R<?> add(GfStudentListDto gfStudentListDto) {
// 学号重复验证
List<PatientStudent> sameStudentIdStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, gfStudentListDto.getStudentId())
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
if (!sameStudentIdStudents.isEmpty()) {
return R.fail("学号" + gfStudentListDto.getStudentId() + "在系统中已存在");
}
// 学生信息重复校验
List<PatientStudent> sameIdNumberStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, gfStudentListDto.getIdNumber())
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
Long existingPatientId = null;
if (!sameIdNumberStudents.isEmpty()) {
for (PatientStudent ps : sameIdNumberStudents) {
if (!ps.getEnrollmentDate().after(gfStudentListDto.getGraduationDate())
&& !ps.getGraduationDate().before(gfStudentListDto.getEnrollmentDate())) {
return R.fail("该身份证在系统中已录入过学生信息,此次录入的入校离校时间与既存数据有重叠,请确认");
}
}
existingPatientId = sameIdNumberStudents.get(0).getPatientId();
}
// 从身份证中获取生日和年龄
Date birthDate = null;
Integer age = null;
try {
birthDate = IdCardUtil.extractBirthdayFromIdCard(gfStudentListDto.getIdNumber());
age = IdCardUtil.calculateAgeFromIdCard(gfStudentListDto.getIdNumber());
} catch (Exception ignored) {
}
// 生成姓名的拼音码和五笔码
String pyStr = ChineseConvertUtils.toPinyinFirstLetter(gfStudentListDto.getName());
String wbStr = ChineseConvertUtils.toWBFirstLetter(gfStudentListDto.getName());
// 系统中不存在历史学生信息时
if (existingPatientId == null) {
// 判断患者信息是否有重复
List<Patient> sameIdNumberPatients = patientService
.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, gfStudentListDto.getIdNumber())
.eq(Patient::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
if (!sameIdNumberPatients.isEmpty()) {
// 已存在则取存在的
existingPatientId = sameIdNumberPatients.get(0).getId();
} else {
// 不存在则新建患者
Patient patient =
new Patient().setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10))
.setName(gfStudentListDto.getName()).setGenderEnum(gfStudentListDto.getGender())
.setBirthDate(birthDate).setPhone(gfStudentListDto.getPhone())
.setIdCard(gfStudentListDto.getIdNumber()).setPyStr(pyStr).setWbStr(wbStr)
.setOrganizationId(SecurityUtils.getLoginUser().getOrgId());
patientService.save(patient);
existingPatientId = patient.getId();
}
}
// 创建学生信息
PatientStudent patientStudent = new PatientStudent().setName(gfStudentListDto.getName()).setPyStr(pyStr)
.setWbStr(wbStr).setGender(gfStudentListDto.getGender()).setAge(age)
.setStudentId(gfStudentListDto.getStudentId()).setIdNumber(gfStudentListDto.getIdNumber())
.setPhone(gfStudentListDto.getPhone()).setCollege(gfStudentListDto.getCollege())
.setMajor(gfStudentListDto.getMajor()).setEducationLevel(gfStudentListDto.getEducationLevel())
.setEnrollmentDate(gfStudentListDto.getEnrollmentDate())
.setGraduationDate(gfStudentListDto.getGraduationDate()).setGrade(gfStudentListDto.getGrade())
.setStudyMode(gfStudentListDto.getStudyMode()).setStudentStatus(gfStudentListDto.getStudentStatus())
.setPhysicalExamResult(gfStudentListDto.getPhysicalExamResult())
.setCounselor(gfStudentListDto.getCounselor()).setCounselorPhone(gfStudentListDto.getCounselorPhone())
.setPatientId(existingPatientId);
patientStudentService.save(patientStudent);
return R.ok();
}
/**
* 编辑学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
@Override
public R<?> edit(GfStudentListDto gfStudentListDto) {
// 查询学生信息
PatientStudent patientStudent = patientStudentService.getById(gfStudentListDto.getId());
if (patientStudent == null) {
return R.fail("学生信息不存在");
}
// 从身份证中获取生日和年龄
Date birthDate = null;
Integer age = null;
try {
birthDate = IdCardUtil.extractBirthdayFromIdCard(gfStudentListDto.getIdNumber());
age = IdCardUtil.calculateAgeFromIdCard(gfStudentListDto.getIdNumber());
} catch (Exception ignored) {
}
// 生成姓名的拼音码和五笔码
String pyStr = ChineseConvertUtils.toPinyinFirstLetter(gfStudentListDto.getName());
String wbStr = ChineseConvertUtils.toWBFirstLetter(gfStudentListDto.getName());
// 更新学生信息
patientStudentService.update(new LambdaUpdateWrapper<PatientStudent>()
.set(PatientStudent::getName, gfStudentListDto.getName()).set(PatientStudent::getPyStr, pyStr)
.set(PatientStudent::getWbStr, wbStr).set(PatientStudent::getGender, gfStudentListDto.getGender())
.set(PatientStudent::getAge, age).set(PatientStudent::getStudentId, gfStudentListDto.getStudentId())
.set(PatientStudent::getIdNumber, gfStudentListDto.getIdNumber())
.set(PatientStudent::getPhone, gfStudentListDto.getPhone())
.set(PatientStudent::getCollege, gfStudentListDto.getCollege())
.set(PatientStudent::getMajor, gfStudentListDto.getMajor())
.set(PatientStudent::getEducationLevel, gfStudentListDto.getEducationLevel())
.set(PatientStudent::getEnrollmentDate, gfStudentListDto.getEnrollmentDate())
.set(PatientStudent::getGraduationDate, gfStudentListDto.getGraduationDate())
.set(PatientStudent::getGrade, gfStudentListDto.getGrade())
.set(PatientStudent::getStudyMode, gfStudentListDto.getStudyMode())
.set(PatientStudent::getStudentStatus, gfStudentListDto.getStudentStatus())
.set(PatientStudent::getPhysicalExamResult, gfStudentListDto.getPhysicalExamResult())
.set(PatientStudent::getCounselor, gfStudentListDto.getCounselor())
.set(PatientStudent::getCounselorPhone, gfStudentListDto.getCounselorPhone())
.eq(PatientStudent::getId, gfStudentListDto.getId()));
// 同步更新患者信息
patientService.update(new Patient(), new LambdaUpdateWrapper<Patient>()
.set(Patient::getName, gfStudentListDto.getName()).set(Patient::getPyStr, pyStr)
.set(Patient::getWbStr, wbStr).set(Patient::getGenderEnum, gfStudentListDto.getGender())
.set(Patient::getBirthDate, birthDate).set(Patient::getPhone, gfStudentListDto.getPhone())
.set(Patient::getIdCard, gfStudentListDto.getIdNumber()).eq(Patient::getId, patientStudent.getPatientId()));
return R.ok();
}
/**
* 删除学生名单
*
* @param id ID
* @return 结果
*/
@Override
public R<?> delete(Long id) {
patientStudentService.update(new LambdaUpdateWrapper<PatientStudent>()
.set(PatientStudent::getDeleteFlag, DeleteFlag.DELETED.getCode()).eq(PatientStudent::getId, id));
return R.ok();
}
/**
* 导入学生名单
*
* @param file 文件
* @return 结果
*/
@Override
public R<?> importData(MultipartFile file) {
// 读取文件
R<List<GfStudentListImportDto>> readResult =
CommonUtil.readImportedExcelFile(file, GfStudentListImportDto.class);
if (R.SUCCESS != readResult.getCode()) {
return readResult;
}
List<GfStudentListImportDto> importDtoList = readResult.getData();
// 导入信息校验
R<?> validateResult = validateImportDtoList(importDtoList);
if (R.SUCCESS != validateResult.getCode()) {
return validateResult;
}
// 查询机构ID
Long orgId = SecurityUtils.getLoginUser().getOrgId();
for (GfStudentListImportDto importDto : importDtoList) {
// 从身份证中获取生日和年龄
Date birthDate = null;
Integer age = null;
try {
birthDate = IdCardUtil.extractBirthdayFromIdCard(importDto.getIdNumber());
age = IdCardUtil.calculateAgeFromIdCard(importDto.getIdNumber());
} catch (Exception ignored) {
}
// 生成姓名的拼音码和五笔码
String pyStr = ChineseConvertUtils.toPinyinFirstLetter(importDto.getName());
String wbStr = ChineseConvertUtils.toWBFirstLetter(importDto.getName());
// 患者未创建时,创建患者
if (importDto.getPatientId() == null) {
Patient patient =
new Patient().setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10))
.setName(importDto.getName()).setGenderEnum(CommonUtil.tryParseInt(importDto.getGender()))
.setBirthDate(birthDate).setPhone(importDto.getPhone()).setIdCard(importDto.getIdNumber())
.setPyStr(pyStr).setWbStr(wbStr).setOrganizationId(orgId);
patientService.save(patient);
importDto.setPatientId(patient.getId());
}
// 创建学生信息
PatientStudent patientStudent = new PatientStudent().setName(importDto.getName()).setPyStr(pyStr)
.setWbStr(wbStr).setGender(CommonUtil.tryParseInt(importDto.getGender())).setAge(age)
.setStudentId(importDto.getStudentId()).setIdNumber(importDto.getIdNumber())
.setPhone(importDto.getPhone()).setCollege(importDto.getCollege()).setMajor(importDto.getMajor())
.setEducationLevel(CommonUtil.tryParseInt(importDto.getEducationLevel()))
.setEnrollmentDate(importDto.getEnrollmentDate()).setGraduationDate(importDto.getGraduationDate())
.setGrade(importDto.getGrade()).setStudyMode(CommonUtil.tryParseInt(importDto.getStudyMode()))
// 在校状态:在校
.setStudentStatus(StudentStatus.IN_SCHOOL.getValue())
// 体检结果:体检合格
.setPhysicalExamResult(PhysicalExamResult.EXAMINATION_PASSED.getValue())
.setCounselor(importDto.getCounselor()).setCounselorPhone(importDto.getCounselorPhone())
.setPatientId(importDto.getPatientId());
patientStudentService.save(patientStudent);
}
return R.ok();
}
/**
* 获取导入模板
*
* @param response 响应
*/
@Override
public void importTemplate(HttpServletResponse response) {
ExcelUtil<GfStudentListImportDto> util = new ExcelUtil<>(GfStudentListImportDto.class);
util.importTemplateExcel(response, "学生名单");
}
/**
* 导入信息校验
*
* @param importDtoList 学生名单导入数据列表
*/
private R<?> validateImportDtoList(List<GfStudentListImportDto> importDtoList) {
// 字段校验(必填及数值类型)
List<String> fieldValidateMsgList = new ArrayList<>();
for (int i = 0; i < importDtoList.size(); i++) {
GfStudentListImportDto importDto = importDtoList.get(i);
importDto.setLineNumber(i + 2);
List<String> lineValidateMsgList = new ArrayList<>();
if (StringUtils.isEmpty(importDto.getName())) {
lineValidateMsgList.add("姓名必填");
}
if (StringUtils.isEmpty(importDto.getGender())) {
lineValidateMsgList.add("性别必填");
}
if (StringUtils.isEmpty(importDto.getStudentId())) {
lineValidateMsgList.add("学号必填");
}
if (StringUtils.isEmpty(importDto.getIdNumber())) {
lineValidateMsgList.add("身份证号必填");
}
if (StringUtils.isEmpty(importDto.getPhone())) {
lineValidateMsgList.add("电话必填");
}
if (StringUtils.isEmpty(importDto.getCollege())) {
lineValidateMsgList.add("学院必填");
}
if (StringUtils.isEmpty(importDto.getMajor())) {
lineValidateMsgList.add("专业必填");
}
if (StringUtils.isEmpty(importDto.getEducationLevel())) {
lineValidateMsgList.add("学历层次必填");
}
if (StringUtils.isEmpty(importDto.getEnrollmentDateStr())) {
lineValidateMsgList.add("入校时间必填");
}
try {
importDto.setEnrollmentDate(DateUtils.parseDate(importDto.getEnrollmentDateStr()));
} catch (Exception e) {
lineValidateMsgList.add("入校时间格式错误");
}
if (StringUtils.isEmpty(importDto.getGraduationDateStr())) {
lineValidateMsgList.add("离校时间必填");
}
try {
importDto.setGraduationDate(DateUtils.parseDate(importDto.getGraduationDateStr()));
} catch (DateTimeParseException e) {
lineValidateMsgList.add("离校时间格式错误");
}
if (StringUtils.isEmpty(importDto.getGrade())) {
lineValidateMsgList.add("年级必填");
}
if (StringUtils.isEmpty(importDto.getStudyMode())) {
lineValidateMsgList.add("学习形式必填");
}
if (StringUtils.isEmpty(importDto.getCounselor())) {
lineValidateMsgList.add("辅导员必填");
}
if (StringUtils.isEmpty(importDto.getCounselorPhone())) {
lineValidateMsgList.add("辅导员电话必填");
}
if (!lineValidateMsgList.isEmpty()) {
fieldValidateMsgList
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join("", lineValidateMsgList) + "");
}
}
if (!fieldValidateMsgList.isEmpty()) {
return R.fail("导入失败!学生名单填写有误:" + String.join(" ", fieldValidateMsgList) + " ■ ※如遇到模板中不存在的字段,请重新下载模板");
}
// 重复校验(文件行重复)
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
Map<String, List<GfStudentListImportDto>> fileSameStudentIdMap =
importDtoList.stream().collect(Collectors.groupingBy(GfStudentListImportDto::getStudentId));
for (Map.Entry<String, List<GfStudentListImportDto>> entry : fileSameStudentIdMap.entrySet()) {
if (entry.getValue().size() > 1) {
lineRepeatedValidateMsgList
.add("■ 第" + entry.getValue().stream().map(GfStudentListImportDto::getLineNumber).sorted()
.map(Object::toString).collect(Collectors.joining(",")) + "行的学号重复;");
}
}
Map<String, List<GfStudentListImportDto>> fileSameIdNumberMap =
importDtoList.stream().collect(Collectors.groupingBy(GfStudentListImportDto::getIdNumber));
for (Map.Entry<String, List<GfStudentListImportDto>> entry : fileSameIdNumberMap.entrySet()) {
if (entry.getValue().size() > 1) {
lineRepeatedValidateMsgList
.add("■ 第" + entry.getValue().stream().map(GfStudentListImportDto::getLineNumber).sorted()
.map(Object::toString).collect(Collectors.joining(",")) + "行的身份证号重复;");
}
}
if (!lineRepeatedValidateMsgList.isEmpty()) {
return R.fail("导入失败!文件中存在重复数据:" + String.join(" ", lineRepeatedValidateMsgList));
}
// 重复校验(文件与数据库重复)
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
for (GfStudentListImportDto importDto : importDtoList) {
List<PatientStudent> sameStudentIdStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, importDto.getStudentId())
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
if (!sameStudentIdStudents.isEmpty()) {
dbRepeatedValidateMsgList.add("■ 第" + importDto.getLineNumber() + "行的学号在系统中已存在;");
}
List<PatientStudent> sameIdNumberStudents = patientStudentService
.list(new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, importDto.getIdNumber())
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
if (!sameIdNumberStudents.isEmpty()) {
for (PatientStudent ps : sameIdNumberStudents) {
if (!ps.getEnrollmentDate().after(importDto.getGraduationDate())
&& !ps.getGraduationDate().before(importDto.getEnrollmentDate())) {
dbRepeatedValidateMsgList
.add("■ 第" + importDto.getLineNumber() + "行的身份证在系统中已录入过学生信息,此次录入的入校离校时间与既存数据有重叠,请确认;");
}
}
importDto.setPatientId(sameIdNumberStudents.get(0).getPatientId());
}
}
if (!dbRepeatedValidateMsgList.isEmpty()) {
return R.fail("导入失败!系统中存在重复数据:" + String.join(" ", dbRepeatedValidateMsgList));
}
return R.ok();
}
}

View File

@@ -0,0 +1,124 @@
package com.openhis.web.nenu.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.web.nenu.appservice.IGfRatioApplicationRecordAppService;
import com.openhis.web.nenu.dto.GfRatioApplicationDefinitionSelectDto;
import com.openhis.web.nenu.dto.GfRatioApplicationPrintDto;
import com.openhis.web.nenu.dto.GfRatioApplicationProcessDto;
import com.openhis.web.nenu.dto.GfRatioApplicationRecordDto;
/**
* 公费医疗-比例调整申请记录 Controller
*
* @author Thanking
* @date 2025-10-21
*/
@RestController
@RequestMapping("/nenu/gf-ratio-application-record")
public class GfRatioApplicationRecordController {
@Autowired
private IGfRatioApplicationRecordAppService gfRatioApplicationRecordAppService;
/**
* 查询比例调整申请记录分页
*
* @param searchParam 查询参数
* @param printable 申请单是否可打印
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 比例调整申请记录分页
*/
@GetMapping("/page")
public R<IPage<GfRatioApplicationRecordDto>> getPage(GfRatioApplicationRecordDto searchParam,
@RequestParam(value = "printable", defaultValue = "") String printable,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return gfRatioApplicationRecordAppService.getPage(searchParam, printable, searchKey, pageNo, pageSize);
}
/**
* 查询比例调整申请记录详情
*
* @param id ID
* @return 比例调整申请记录详情
*/
@GetMapping("/{id}")
public R<GfRatioApplicationRecordDto> getDetail(@PathVariable(value = "id") Long id) {
return gfRatioApplicationRecordAppService.getDetail(id);
}
/**
* 创建比例调整申请
*
* @param gfRatioApplicationRecordDto 比例调整申请记录Dto
* @return 结果
*/
@PostMapping
public R<?> add(@Validated @RequestBody GfRatioApplicationRecordDto gfRatioApplicationRecordDto) {
return gfRatioApplicationRecordAppService.add(gfRatioApplicationRecordDto);
}
/**
* 取消比例调整申请
*
* @param id ID
* @return 结果
*/
@DeleteMapping("/{id}")
public R<?> cancel(@PathVariable(value = "id") Long id) {
return gfRatioApplicationRecordAppService.cancel(id);
}
/**
* 处理比例调整申请
*
* @param gfRatioApplicationProcessDto 比例调整申请处理Dto
* @return 结果
*/
@PutMapping
public R<?> process(@Validated @RequestBody GfRatioApplicationProcessDto gfRatioApplicationProcessDto) {
return gfRatioApplicationRecordAppService.process(gfRatioApplicationProcessDto);
}
/**
* 查询申请项目选择弹窗分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param itemType 项目分类
* @param pageNo 页码
* @param pageSize 行数
* @return 申请项目选择弹窗分页
*/
@GetMapping("/definition-select-page")
public R<IPage<GfRatioApplicationDefinitionSelectDto>> getDefinitionSelectPage(
GfRatioApplicationDefinitionSelectDto searchParam,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "itemType") Integer itemType,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return gfRatioApplicationRecordAppService.getDefinitionSelectPage(searchParam, searchKey, itemType, pageNo,
pageSize);
}
/**
* 查询申请单打印列表
*
* @param ids 多个ID逗号拼接
* @return 申请单打印列表
*/
@GetMapping("/print-list")
public R<List<GfRatioApplicationPrintDto>> getPrintList(@RequestParam(value = "ids") String ids) {
return gfRatioApplicationRecordAppService.getPrintList(ids);
}
}

View File

@@ -0,0 +1,65 @@
package com.openhis.web.nenu.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.nenu.dto.GfTypeRatioDto;
import com.openhis.web.nenu.appservice.IGfRatioManageAppService;
import com.openhis.web.nenu.dto.GfIndividualRatioDto;
import com.openhis.web.nenu.dto.GfTypeRatioSaveDto;
/**
* 公费医疗-自付比例管理 Controller
*
* @author Thanking
* @date 2025-10-21
*/
@RestController
@RequestMapping("/nenu/gf-ratio-manage")
public class GfRatioManageController {
@Autowired
private IGfRatioManageAppService gfRatioManageAppService;
/**
* 查询大项比例列表
*
* @return 大项比例列表
*/
@GetMapping("/type-ratio-list")
public R<List<GfTypeRatioDto>> getTypeRatioList() {
return gfRatioManageAppService.getTypeRatioList();
}
/**
* 保存大项比例列表
*
* @param gfTypeRatioSaveDto 大项比例保存Dto
* @return 结果
*/
@PutMapping("/type-ratio-list")
public R<?> saveTypeRatioList(@RequestBody GfTypeRatioSaveDto gfTypeRatioSaveDto) {
return gfRatioManageAppService.saveTypeRatioList(gfTypeRatioSaveDto.getTypeRatioList());
}
/**
* 查询单项比例分页
*
* @param searchParam 查询参数
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 单项比例分页
*/
@GetMapping("/individual-ratio-page")
public R<IPage<GfIndividualRatioDto>> getIndividualRatioPage(GfIndividualRatioDto searchParam,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return gfRatioManageAppService.getIndividualRatioPage(searchParam, searchKey, pageNo, pageSize);
}
}

View File

@@ -0,0 +1,108 @@
package com.openhis.web.nenu.controller;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.core.common.core.domain.R;
import com.openhis.web.nenu.appservice.IGfStudentListAppService;
import com.openhis.web.nenu.dto.GfStudentListDto;
/**
* 公费医疗-学生名单管理 Controller
*
* @author Thanking
* @date 2025-10-21
*/
@RestController
@RequestMapping("/nenu/gf-student-list")
public class GfStudentListController {
@Autowired
private IGfStudentListAppService gfStudentListAppService;
/**
* 查询学生名单分页
*
* @param searchKey 模糊查询关键字
* @param pageNo 页码
* @param pageSize 行数
* @return 学生名单分页
*/
@GetMapping("/page")
public R<IPage<GfStudentListDto>> getPage(GfStudentListDto searchParam,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return gfStudentListAppService.getPage(searchParam, searchKey, pageNo, pageSize);
}
/**
* 查询学生名单详情
*
* @param id ID
* @return 学生名单详情
*/
@GetMapping("/{id}")
public R<GfStudentListDto> getDetail(@PathVariable(value = "id") Long id) {
return gfStudentListAppService.getDetail(id);
}
/**
* 添加学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
@PostMapping
public R<?> add(@Validated @RequestBody GfStudentListDto gfStudentListDto) {
return gfStudentListAppService.add(gfStudentListDto);
}
/**
* 编辑学生名单
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
@PutMapping
public R<?> edit(@Validated @RequestBody GfStudentListDto gfStudentListDto) {
return gfStudentListAppService.edit(gfStudentListDto);
}
/**
* 删除学生名单
*
* @param id ID
* @return 结果
*/
@DeleteMapping("/{id}")
public R<?> delete(@PathVariable(value = "id") Long id) {
return gfStudentListAppService.delete(id);
}
/**
* 导入学生名单
*
* @param file 文件
* @return 结果
*/
@PostMapping("/import-data")
public R<?> importData(MultipartFile file) {
return gfStudentListAppService.importData(file);
}
/**
* 获取导入模板
*
* @param response 响应
*/
@PostMapping("/import-template")
public void importTemplate(HttpServletResponse response) {
gfStudentListAppService.importTemplate(response);
}
}

View File

@@ -0,0 +1,73 @@
package com.openhis.web.nenu.dto;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-单项比例Dto
*
* @author Thanking
* @date 2025-10-24
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfIndividualRatioDto {
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 公费项目分类1药品2诊疗 */
private Integer itemType;
/** 公费项目分类名称1药品2诊疗 */
private String itemTypeName;
/** 自付比例 */
private BigDecimal selfRatio;
/** 二次报销的自付比例 */
private BigDecimal twiceRatio;
/** 开始时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startDate;
/** 结束时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/** 项目编号 */
private String busNo;
/** 项目名称 */
private String name;
/** 拼音码 */
private String pyStr;
/** 五笔码 */
private String wbStr;
/** 医保编码 */
private String ybNo;
/** 医保等级 */
private Integer chrgitmLv;
/** 医保等级名称 */
private String chrgitmLvName;
}

View File

@@ -0,0 +1,51 @@
package com.openhis.web.nenu.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-比例调整申请项目定义选择Dto
*
* @author Thanking
* @date 2025-10-29
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfRatioApplicationDefinitionSelectDto {
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 项目编号 */
private String busNo;
/** 项目名称 */
private String name;
/** 拼音码 */
private String pyStr;
/** 五笔码 */
private String wbStr;
/** 医保编码 */
private String ybNo;
/** 医保等级 */
private Integer chrgitmLv;
/** 医保等级名称 */
private String chrgitmLvName;
/** 生产厂家 */
private String manufacturerText;
/** 规格 */
private String totalVolume;
}

View File

@@ -0,0 +1,42 @@
package com.openhis.web.nenu.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-比例调整申请打印Dto
*
* @author Thanking
* @date 2025-10-30
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfRatioApplicationPrintDto {
/** 项目名称 */
private String itemName;
/** 全价 */
private String totalPrice;
/** 医保等级 */
private String chrgitmLv;
/** 原支付比例 */
private String oldRatio;
/** 新支付比例 */
private String newRatio;
/** 价格差 */
private String priceDiff;
/** 原二次支付比例 */
private String oldTwiceRatio;
/** 新二次支付比例 */
private String newTwiceRatio;
}

View File

@@ -0,0 +1,40 @@
package com.openhis.web.nenu.dto;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-比例调整申请处理Dto
*
* @author Thanking
* @date 2025-10-28
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfRatioApplicationProcessDto {
/** ID */
@NotNull(message = "ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 角色 */
@NotNull(message = "角色不能为空")
private Integer approvalRole;
/** 通过or驳回1通过2驳回 */
@NotNull(message = "通过or驳回不能为空")
private Integer approvalResult;
/** 意见 */
@NotNull(message = "意见不能为空")
private String approvalOpinion;
}

View File

@@ -0,0 +1,167 @@
package com.openhis.web.nenu.dto;
import java.math.BigDecimal;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-比例调整申请记录Dto
*
* @author Thanking
* @date 2025-10-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfRatioApplicationRecordDto {
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 申请编号 */
private String applicationNo;
/** 公费项目分类1药品2诊疗 */
@NotNull(message = "项目分类不能为空")
private Integer itemType;
private String itemTypeName;
/** 医保等级名称 */
private String chrgitmLvName;
/** 医保分项 */
private String ybClass;
/** 医保等级 */
private String ybLv;
/** 申请比例 */
@NotNull(message = "申请比例不能为空")
private BigDecimal applicationRatio;
/** 原自付比例 */
private BigDecimal oldRatio;
/** 全价 */
private BigDecimal totalPrice;
/** 价格差 */
private BigDecimal priceDiff;
/** 二次报销的自付比例 */
private BigDecimal twiceRatio;
/** 原二次自付比例 */
private BigDecimal oldTwiceRatio;
/** 开始时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "开始时间不能为空")
private Date startDate;
/** 结束时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "结束时间不能为空")
private Date endDate;
/** 申请状态0处理中1通过2驳回3取消 */
@Dict(dictCode = "application_status")
private Integer applicationStatus;
private String applicationStatus_dictText;
/** 申请人 */
private String applicant;
/** 申请时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applicationTime;
/** 申请原因 */
@NotBlank(message = "申请原因不能为空")
private String applicationReason;
/** 测算盈亏负责人 */
private String initialApprover;
/** 测算通过or驳回0处理中1通过2驳回 */
@Dict(dictCode = "application_status")
private Integer initialApprovalResult;
private String initialApprovalResult_dictText;
/** 测算时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date initialApprovalTime;
/** 测算意见 */
private String initialApprovalOpinion;
/** 财务科负责人 */
private String financeApprover;
/** 财务科通过or驳回0处理中1通过2驳回 */
@Dict(dictCode = "application_status")
private Integer financeApprovalResult;
private String financeApprovalResult_dictText;
/** 报批时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date financeApprovalTime;
/** 报批意见 */
private String financeApprovalOpinion;
/** 会议结果录入人 */
private String finalRecorder;
/** 会议通过or驳回0处理中1通过2驳回 */
@Dict(dictCode = "application_status")
private Integer finalApprovalResult;
private String finalApprovalResult_dictText;
/** 录入时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finalRecordTime;
/** 录入意见 */
private String finalApprovalOpinion;
/** 表id */
@NotNull(message = "定义ID不能为空")
@JsonSerialize(using = ToStringSerializer.class)
private Long definitionId;
/** 项目编号 */
private String busNo;
/** 项目名称 */
private String name;
/** 拼音码 */
private String pyStr;
/** 五笔码 */
private String wbStr;
/** 医保编码 */
private String ybNo;
}

View File

@@ -0,0 +1,120 @@
package com.openhis.web.nenu.dto;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-学生名单Dto
*
* @author Thanking
* @date 2025-10-21
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfStudentListDto {
/** ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/** 姓名 */
@NotBlank(message = "姓名不能为空")
private String name;
/** 拼音码 */
private String pyStr;
/** 五笔码 */
private String wbStr;
/** 性别 */
@Dict(dictCode = "sys_user_sex")
@NotNull(message = "性别不能为空")
private Integer gender;
private String gender_dictText;
/** 年龄 */
private Integer age;
/** 学号 */
@NotBlank(message = "学号不能为空")
private String studentId;
/** 身份证号 */
@NotBlank(message = "身份证号不能为空")
private String idNumber;
/** 电话 */
@NotBlank(message = "电话不能为空")
private String phone;
/** 学院 */
@NotBlank(message = "学院不能为空")
private String college;
/** 专业 */
@NotBlank(message = "专业不能为空")
private String major;
/** 学历层次0预科生1本科生2硕士研究生3博士研究生 */
@Dict(dictCode = "education_level")
@NotNull(message = "学历层次不能为空")
private Integer educationLevel;
private String educationLevel_dictText;
/** 入校时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "入校时间不能为空")
private Date enrollmentDate;
/** 离校时间 */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "离校时间不能为空")
private Date graduationDate;
/** 年级 */
@NotBlank(message = "年级不能为空")
private String grade;
/** 学习形式1全日制2非全日制 */
@Dict(dictCode = "study_mode")
@NotNull(message = "学习形式不能为空")
private Integer studyMode;
private String studyMode_dictText;
/** 在校状态0在校1休学2离校 */
@Dict(dictCode = "student_status")
private Integer studentStatus;
private String studentStatus_dictText;
/** 体检结果0未体检1体检不合格2体检合格 */
@Dict(dictCode = "physical_exam_result")
private Integer physicalExamResult;
private String physicalExamResult_dictText;
/** 辅导员 */
private String counselor;
/** 辅导员电话 */
private String counselorPhone;
/** 患者ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
}

View File

@@ -0,0 +1,81 @@
package com.openhis.web.nenu.dto;
import java.util.Date;
import com.core.common.annotation.Excel;
import lombok.Data;
/**
* 公费医疗-学生名单导入Dto
*
* @author Thanking
* @date 2025-10-21
*/
@Data
public class GfStudentListImportDto {
/** 行号 */
private Integer lineNumber;
/** 患者ID */
private Long patientId;
/** 姓名 */
@Excel(name = "姓名", prompt = "必填")
private String name;
/** 性别 */
@Excel(name = "性别", prompt = "必填", readConverterExp = "0=男性,1=女性,2=未知", combo = "男性,女性,未知")
private String gender;
/** 学号 */
@Excel(name = "学号", prompt = "必填")
private String studentId;
/** 身份证号 */
@Excel(name = "身份证号", prompt = "必填")
private String idNumber;
/** 电话 */
@Excel(name = "电话", prompt = "必填")
private String phone;
/** 学院 */
@Excel(name = "学院", prompt = "必填")
private String college;
/** 专业 */
@Excel(name = "专业", prompt = "必填")
private String major;
/** 学历层次0预科生1本科生2硕士研究生3博士研究生 */
@Excel(name = "学历层次", prompt = "必填", dictType = "education_level", comboReadDict = true)
private String educationLevel;
/** 入校时间 */
@Excel(name = "入校时间", prompt = "必填格式yyyy-MM-dd", dateFormat = "yyyy-MM-dd")
private String enrollmentDateStr;
private Date enrollmentDate;
/** 离校时间 */
@Excel(name = "离校时间", prompt = "必填格式yyyy-MM-dd", dateFormat = "yyyy-MM-dd")
private String graduationDateStr;
private Date graduationDate;
/** 年级 */
@Excel(name = "年级", prompt = "必填")
private String grade;
/** 学习形式1全日制2非全日制 */
@Excel(name = "学习形式", prompt = "必填", dictType = "study_mode", comboReadDict = true)
private String studyMode;
/** 辅导员 */
@Excel(name = "辅导员")
private String counselor;
/** 辅导员电话 */
@Excel(name = "辅导员电话")
private String counselorPhone;
}

View File

@@ -0,0 +1,24 @@
package com.openhis.web.nenu.dto;
import java.util.List;
import com.openhis.nenu.dto.GfTypeRatioDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 公费医疗-大项比例保存Dto
*
* @author Thanking
* @date 2025-10-24
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class GfTypeRatioSaveDto {
/** 大项比例列表 */
private List<GfTypeRatioDto> typeRatioList;
}

View File

@@ -0,0 +1,45 @@
package com.openhis.web.nenu.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.nenu.dto.GfRatioApplicationDefinitionSelectDto;
import com.openhis.web.nenu.dto.GfRatioApplicationRecordDto;
/**
* 公费医疗-比例调整申请记录 Mapper
*
* @author Thanking
* @date 2025-10-27
*/
@Repository
public interface GfRatioApplicationRecordAppMapper {
/**
* 查询比例调整申请记录分页
*
* @param page 分页参数
* @param queryWrapper 查询条件
* @return 比例调整申请记录分页
*/
IPage<GfRatioApplicationRecordDto> selectGfRatioApplicationRecordPage(
@Param("page") Page<GfRatioApplicationRecordDto> page,
@Param(Constants.WRAPPER) QueryWrapper<GfRatioApplicationRecordDto> queryWrapper);
/**
* 查询申请项目选择弹窗分页
*
* @param itemType 项目分类
* @param page 分页参数
* @param queryWrapper 查询条件
* @return 申请项目选择弹窗分页
*/
IPage<GfRatioApplicationDefinitionSelectDto> selectGfRatioApplicationDefinitionSelectPage(
@Param("itemType") Integer itemType, @Param("page") Page<GfRatioApplicationDefinitionSelectDto> page,
@Param(Constants.WRAPPER) QueryWrapper<GfRatioApplicationDefinitionSelectDto> queryWrapper);
}

View File

@@ -0,0 +1,31 @@
package com.openhis.web.nenu.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.nenu.dto.GfIndividualRatioDto;
/**
* 公费医疗-自付比例管理 Mapper
*
* @author Thanking
* @date 2025-10-24
*/
@Repository
public interface GfRatioManageAppMapper {
/**
* 查询单项比例分页
*
* @param page 分页参数
* @param queryWrapper 查询条件
* @return 单项比例分页
*/
IPage<GfIndividualRatioDto> selectGfIndividualRatioPage(@Param("page") Page<GfIndividualRatioDto> page,
@Param(Constants.WRAPPER) QueryWrapper<GfIndividualRatioDto> queryWrapper);
}

View File

@@ -0,0 +1,31 @@
package com.openhis.web.nenu.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.nenu.dto.GfStudentListDto;
/**
* 公费医疗-学生名单管理 Mapper
*
* @author Thanking
* @date 2025-10-21
*/
@Repository
public interface GfStudentListAppMapper {
/**
* 查询学生名单分页
*
* @param page 分页参数
* @param queryWrapper 查询条件
* @return 学生名单分页
*/
IPage<GfStudentListDto> selectGfStudentListPage(@Param("page") Page<GfStudentListDto> page,
@Param(Constants.WRAPPER) QueryWrapper<GfStudentListDto> queryWrapper);
}