提交merge1.3

This commit is contained in:
2025-12-27 15:31:06 +08:00
parent cbd3e7f981
commit 79ea4ed4f7
148 changed files with 6722 additions and 10861 deletions

View File

@@ -26,7 +26,7 @@ public interface IGfStudentListAppService {
* @return 学生名单分页
*/
R<IPage<GfStudentListDto>> getPage(GfStudentListDto searchParam, String searchKey, Integer pageNo,
Integer pageSize);
Integer pageSize);
/**
* 查询学生名单详情
@@ -38,7 +38,7 @@ public interface IGfStudentListAppService {
/**
* 添加学生名单
*
*
* @param gfStudentListDto 学生名单Dto
* @return 结果
*/
@@ -74,13 +74,10 @@ public interface IGfStudentListAppService {
* @param response 响应
*/
void importTemplate(HttpServletResponse response);
<<<<<<< HEAD
=======
/**
* peis数据同步
*/
R<?> synPeis();
>>>>>>> v1.3
}

View File

@@ -5,10 +5,7 @@ import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
<<<<<<< HEAD
=======
import com.core.common.enums.DelFlag;
>>>>>>> v1.3
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -19,10 +16,6 @@ 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;
<<<<<<< HEAD
import com.core.common.enums.DeleteFlag;
=======
>>>>>>> v1.3
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.DateUtils;
import com.core.common.utils.SecurityUtils;
@@ -83,18 +76,18 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
*/
@Override
public R<IPage<GfRatioApplicationRecordDto>> getPage(GfRatioApplicationRecordDto searchParam, String printable,
String searchKey, Integer pageNo, Integer pageSize) {
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);
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());
GfApplicationStatus.PROCESSING.getValue());
}
// 查询比例调整申请记录分页
IPage<GfRatioApplicationRecordDto> page = gfRatioApplicationRecordAppMapper
.selectGfRatioApplicationRecordPage(new Page<>(pageNo, pageSize), queryWrapper);
.selectGfRatioApplicationRecordPage(new Page<>(pageNo, pageSize), queryWrapper);
for (GfRatioApplicationRecordDto r : page.getRecords()) {
// 翻译非字典枚举
GfItemType gfItemType = GfItemType.getByValue(r.getItemType());
@@ -125,68 +118,68 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
String ybNo = null;
if (GfItemType.MEDICATION.getValue().equals(gfRatioApplication.getItemType())) {
// 如果是药品,获取并设置药品定义信息
MedicationDefinition medicationDefinition =
medicationDefinitionService.getById(gfRatioApplication.getDefinitionId());
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();
.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());
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();
.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);
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());
.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);
}
@@ -200,37 +193,33 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
public R<?> add(GfRatioApplicationRecordDto gfRatioApplicationRecordDto) {
// 查询指定项目现行比例
List<GfRatio> gfRatioList = gfRatioService.list(new LambdaQueryWrapper<GfRatio>()
.eq(GfRatio::getDefinitionId, gfRatioApplicationRecordDto.getDefinitionId())
<<<<<<< HEAD
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
.eq(GfRatio::getDefinitionId, gfRatioApplicationRecordDto.getDefinitionId())
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()));
// 验证时间是否重叠
if (!gfRatioList.isEmpty()) {
for (GfRatio r : gfRatioList) {
if (!r.getStartDate().after(gfRatioApplicationRecordDto.getEndDate())
&& !r.getEndDate().before(gfRatioApplicationRecordDto.getStartDate())) {
&& !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());
.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();
}
@@ -250,15 +239,15 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
}
// 状态验证
if (!GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getApplicationStatus())
&& !GfApplicationStatus.PROCESSING.getValue().equals(gfRatioApplication.getInitialApprovalResult())) {
&& !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));
// 申请状态:取消
.set(GfRatioApplication::getApplicationStatus, GfApplicationStatus.CANCELLED.getValue())
// 测算通过or驳回NULL
.set(GfRatioApplication::getInitialApprovalResult, null).eq(GfRatioApplication::getId, id));
return null;
}
@@ -300,32 +289,32 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
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()));
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())) {
.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()));
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驳回指定错误");
}
@@ -340,32 +329,32 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
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()));
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())) {
.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()));
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驳回指定错误");
}
@@ -380,36 +369,36 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
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()));
.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());
// 比例类型:单项比例
.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())) {
.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()));
.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驳回指定错误");
}
@@ -431,14 +420,14 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
*/
@Override
public R<IPage<GfRatioApplicationDefinitionSelectDto>> getDefinitionSelectPage(
GfRatioApplicationDefinitionSelectDto searchParam, String searchKey, Integer itemType, Integer pageNo,
Integer pageSize) {
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);
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);
.selectGfRatioApplicationDefinitionSelectPage(itemType, new Page<>(pageNo, pageSize), queryWrapper);
// 翻译非字典枚举
for (GfRatioApplicationDefinitionSelectDto dto : page.getRecords()) {
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByValue(dto.getChrgitmLv());
@@ -461,7 +450,7 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
List<Long> idList;
try {
idList = Arrays.stream(ids.split(",")).map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf)
.collect(Collectors.toList());
.collect(Collectors.toList());
} catch (NumberFormatException e) {
return R.fail("传参有误");
}
@@ -469,9 +458,9 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
return R.ok(Collections.emptyList());
}
// 查询要打印的申请单
List<GfRatioApplication> applicationList =
gfRatioApplicationService.list(new LambdaQueryWrapper<GfRatioApplication>()
.in(GfRatioApplication::getId, idList).orderByDesc(GfRatioApplication::getId));
List<GfRatioApplication> applicationList
= gfRatioApplicationService.list(new LambdaQueryWrapper<GfRatioApplication>()
.in(GfRatioApplication::getId, idList).orderByDesc(GfRatioApplication::getId));
if (applicationList.isEmpty()) {
return R.ok(Collections.emptyList());
}
@@ -485,52 +474,52 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
String defTableName = CommonConstants.TableName.MED_MEDICATION_DEFINITION;
if (GfItemType.MEDICATION.getValue().equals(application.getItemType())) {
// 获取药品名称和医保等级
MedicationDefinition medicationDefinition =
medicationDefinitionService.getById(application.getDefinitionId());
MedicationDefinition medicationDefinition
= medicationDefinitionService.getById(application.getDefinitionId());
if (medicationDefinition != null) {
itemName = medicationDefinition.getName();
ybLv = Optional.of(medicationDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue())
.toString();
.toString();
}
} else if (GfItemType.ACTIVITY.getValue().equals(application.getItemType())) {
// 获取诊疗名称和医保等级
ActivityDefinition activityDefinition =
activityDefinitionService.getById(application.getDefinitionId());
ActivityDefinition activityDefinition
= activityDefinitionService.getById(application.getDefinitionId());
if (activityDefinition != null) {
itemName = activityDefinition.getName();
ybLv = Optional.of(activityDefinition.getChrgitmLv()).orElse(YbChrgitmLv.SELF_PAY.getValue())
.toString();
.toString();
}
defTableName = CommonConstants.TableName.WOR_ACTIVITY_DEFINITION;
}
YbChrgitmLv ybChrgitmLv = YbChrgitmLv.getByCode(ybLv);
// 查询原支付比例和价格(包括二次比例)
Pair<Pair<BigDecimal, BigDecimal>, BigDecimal> oldRatiosAndPrice =
this.getOldRatiosAndPrice(application.getDefinitionId(), defTableName, 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());
// 全价
.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);
@@ -538,44 +527,36 @@ public class GfRatioApplicationRecordAppServiceImpl implements IGfRatioApplicati
/**
* 查询原支付比例和价格(包括二次比例)
*
*
* @param definitionId 定义ID
* @param definitionTableName 定义表名
* @param ybLv 医保等级
* @return 原支付比例和价格(包括二次比例)
*/
private Pair<Pair<BigDecimal, BigDecimal>, BigDecimal> getOldRatiosAndPrice(Long definitionId,
String definitionTableName, String ybLv) {
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));
.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)
<<<<<<< HEAD
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
.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, DelFlag.NO.getCode()));
if (!typeRatioList.isEmpty()) {
oldRatio = typeRatioList.get(0).getSelfRatio();
}
}
// 查询历史小项比例
List<GfRatio> historicalRatioList =
gfRatioService.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getDefinitionId, definitionId)
<<<<<<< HEAD
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByDesc(GfRatio::getId));
=======
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()).orderByDesc(GfRatio::getId));
>>>>>>> v1.3
List<GfRatio> historicalRatioList
= gfRatioService.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getDefinitionId, definitionId)
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()).orderByDesc(GfRatio::getId));
BigDecimal oldTwiceRatio = null;
if (!historicalRatioList.isEmpty()) {
GfRatio latestRatio = historicalRatioList.get(0);

View File

@@ -12,11 +12,7 @@ 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;
<<<<<<< HEAD
import com.core.common.enums.DeleteFlag;
=======
import com.core.common.enums.DelFlag;
>>>>>>> v1.3
import com.openhis.common.enums.GfItemType;
import com.openhis.common.enums.GfRatioType;
import com.openhis.common.enums.ybenums.YbChrgitmLv;
@@ -62,15 +58,11 @@ public class GfRatioManageAppServiceImpl implements IGfRatioManageAppService {
public R<?> saveTypeRatioList(List<GfTypeRatioDto> typeRatioList) {
// 查询DB中的所有大项比例
List<GfRatio> gfRatioList = gfRatioService
.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getRatioType, GfRatioType.TYPE_RATIO.getValue())
<<<<<<< HEAD
.eq(GfRatio::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
.list(new LambdaQueryWrapper<GfRatio>().eq(GfRatio::getRatioType, GfRatioType.TYPE_RATIO.getValue())
.eq(GfRatio::getDeleteFlag, DelFlag.NO.getCode()));
// 做成医保分项+医保等级拼接的Map
Map<String, GfRatio> gfRatioMap =
gfRatioList.stream().collect(Collectors.toMap(e -> e.getYbClass() + e.getYbLv(), Function.identity()));
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<>();
@@ -82,7 +74,7 @@ public class GfRatioManageAppServiceImpl implements IGfRatioManageAppService {
if (editGfRatio == null) {
// DB不存在时新增
GfRatio addGfRatio = new GfRatio().setRatioType(GfRatioType.TYPE_RATIO.getValue())
.setYbClass(dto.getYbClass()).setYbLv(dto.getYbLv()).setSelfRatio(dto.getSelfRatio());
.setYbClass(dto.getYbClass()).setYbLv(dto.getYbLv()).setSelfRatio(dto.getSelfRatio());
addGfRatioList.add(addGfRatio);
} else {
// DB存在时修改
@@ -111,13 +103,13 @@ public class GfRatioManageAppServiceImpl implements IGfRatioManageAppService {
*/
@Override
public R<IPage<GfIndividualRatioDto>> getIndividualRatioPage(GfIndividualRatioDto searchParam, String searchKey,
Integer pageNo, Integer pageSize) {
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);
new HashSet<>(Set.of("bus_no", "name", "py_str", "wb_str", "yb_no")), null);
// 查询单项比例分页
IPage<GfIndividualRatioDto> page =
gfRatioManageAppMapper.selectGfIndividualRatioPage(new Page<>(pageNo, pageSize), queryWrapper);
IPage<GfIndividualRatioDto> page
= gfRatioManageAppMapper.selectGfIndividualRatioPage(new Page<>(pageNo, pageSize), queryWrapper);
// 设置公费项目分类名称
for (GfIndividualRatioDto dto : page.getRecords()) {
dto.setItemTypeName(GfItemType.getByValue(dto.getItemType()).getInfo());

View File

@@ -1,13 +1,5 @@
package com.openhis.web.nenu.appservice.impl;
<<<<<<< HEAD
import java.time.format.DateTimeParseException;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
=======
import java.io.IOException;
import java.time.format.DateTimeParseException;
import java.util.*;
@@ -34,7 +26,6 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
>>>>>>> v1.3
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@@ -45,11 +36,7 @@ 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;
<<<<<<< HEAD
import com.core.common.enums.DeleteFlag;
=======
import com.core.common.enums.DelFlag;
>>>>>>> v1.3
import com.core.common.utils.*;
import com.core.common.utils.poi.ExcelUtil;
import com.openhis.administration.domain.Patient;
@@ -96,13 +83,13 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
*/
@Override
public R<IPage<GfStudentListDto>> getPage(GfStudentListDto searchParam, String searchKey, Integer pageNo,
Integer pageSize) {
Integer pageSize) {
// 构造查询条件
QueryWrapper<GfStudentListDto> queryWrapper = HisQueryUtils.buildQueryWrapper(searchParam, searchKey,
new HashSet<>(Set.of("name", "py_str", "wb_str", "student_id", "id_number")), null);
new HashSet<>(Set.of("name", "py_str", "wb_str", "student_id", "id_number")), null);
// 查询学生名单分页
IPage<GfStudentListDto> page =
gfStudentListAppMapper.selectGfStudentListPage(new Page<>(pageNo, pageSize), queryWrapper);
IPage<GfStudentListDto> page
= gfStudentListAppMapper.selectGfStudentListPage(new Page<>(pageNo, pageSize), queryWrapper);
return R.ok(page);
}
@@ -121,15 +108,15 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
}
// 返回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());
.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);
}
@@ -143,28 +130,20 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
public R<?> add(GfStudentListDto gfStudentListDto) {
// 学号重复验证
List<PatientStudent> sameStudentIdStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, gfStudentListDto.getStudentId())
<<<<<<< HEAD
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, gfStudentListDto.getStudentId())
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
if (!sameStudentIdStudents.isEmpty()) {
return R.fail("学号" + gfStudentListDto.getStudentId() + "在系统中已存在");
}
// 学生信息重复校验
List<PatientStudent> sameIdNumberStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, gfStudentListDto.getIdNumber())
<<<<<<< HEAD
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, gfStudentListDto.getIdNumber())
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
Long existingPatientId = null;
if (!sameIdNumberStudents.isEmpty()) {
for (PatientStudent ps : sameIdNumberStudents) {
if (!ps.getEnrollmentDate().after(gfStudentListDto.getGraduationDate())
&& !ps.getGraduationDate().before(gfStudentListDto.getEnrollmentDate())) {
&& !ps.getGraduationDate().before(gfStudentListDto.getEnrollmentDate())) {
return R.fail("该身份证在系统中已录入过学生信息,此次录入的入校离校时间与既存数据有重叠,请确认");
}
}
@@ -185,39 +164,35 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
if (existingPatientId == null) {
// 判断患者信息是否有重复
List<Patient> sameIdNumberPatients = patientService
.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, gfStudentListDto.getIdNumber())
<<<<<<< HEAD
.eq(Patient::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(Patient::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, gfStudentListDto.getIdNumber())
.eq(Patient::getDeleteFlag, DelFlag.NO.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());
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);
.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();
}
@@ -248,29 +223,29 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
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()));
.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()));
.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();
}
@@ -283,11 +258,7 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
@Override
public R<?> delete(Long id) {
patientStudentService.update(new LambdaUpdateWrapper<PatientStudent>()
<<<<<<< HEAD
.set(PatientStudent::getDeleteFlag, DeleteFlag.DELETED.getCode()).eq(PatientStudent::getId, id));
=======
.set(PatientStudent::getDeleteFlag, DelFlag.YES.getCode()).eq(PatientStudent::getId, id));
>>>>>>> v1.3
.set(PatientStudent::getDeleteFlag, DelFlag.YES.getCode()).eq(PatientStudent::getId, id));
return R.ok();
}
@@ -300,8 +271,8 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
@Override
public R<?> importData(MultipartFile file) {
// 读取文件
R<List<GfStudentListImportDto>> readResult =
CommonUtil.readImportedExcelFile(file, GfStudentListImportDto.class);
R<List<GfStudentListImportDto>> readResult
= CommonUtil.readImportedExcelFile(file, GfStudentListImportDto.class);
if (R.SUCCESS != readResult.getCode()) {
return readResult;
}
@@ -327,28 +298,28 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
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);
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());
.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();
@@ -431,7 +402,7 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
}
if (!lineValidateMsgList.isEmpty()) {
fieldValidateMsgList
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join("", lineValidateMsgList) + "");
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join("", lineValidateMsgList) + "");
}
}
if (!fieldValidateMsgList.isEmpty()) {
@@ -439,22 +410,22 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
}
// 重复校验(文件行重复)
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
Map<String, List<GfStudentListImportDto>> fileSameStudentIdMap =
importDtoList.stream().collect(Collectors.groupingBy(GfStudentListImportDto::getStudentId));
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(",")) + "行的学号重复;");
.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));
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(",")) + "行的身份证号重复;");
.add("■ 第" + entry.getValue().stream().map(GfStudentListImportDto::getLineNumber).sorted()
.map(Object::toString).collect(Collectors.joining(",")) + "行的身份证号重复;");
}
}
if (!lineRepeatedValidateMsgList.isEmpty()) {
@@ -464,28 +435,20 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
for (GfStudentListImportDto importDto : importDtoList) {
List<PatientStudent> sameStudentIdStudents = patientStudentService.list(
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, importDto.getStudentId())
<<<<<<< HEAD
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getStudentId, importDto.getStudentId())
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
if (!sameStudentIdStudents.isEmpty()) {
dbRepeatedValidateMsgList.add("■ 第" + importDto.getLineNumber() + "行的学号在系统中已存在;");
}
List<PatientStudent> sameIdNumberStudents = patientStudentService
.list(new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, importDto.getIdNumber())
<<<<<<< HEAD
.eq(PatientStudent::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()));
=======
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
>>>>>>> v1.3
.list(new LambdaQueryWrapper<PatientStudent>().eq(PatientStudent::getIdNumber, importDto.getIdNumber())
.eq(PatientStudent::getDeleteFlag, DelFlag.NO.getCode()));
if (!sameIdNumberStudents.isEmpty()) {
for (PatientStudent ps : sameIdNumberStudents) {
if (!ps.getEnrollmentDate().after(importDto.getGraduationDate())
&& !ps.getGraduationDate().before(importDto.getEnrollmentDate())) {
&& !ps.getGraduationDate().before(importDto.getEnrollmentDate())) {
dbRepeatedValidateMsgList
.add("■ 第" + importDto.getLineNumber() + "行的身份证在系统中已录入过学生信息,此次录入的入校离校时间与既存数据有重叠,请确认;");
.add("■ 第" + importDto.getLineNumber() + "行的身份证在系统中已录入过学生信息,此次录入的入校离校时间与既存数据有重叠,请确认;");
}
}
importDto.setPatientId(sameIdNumberStudents.get(0).getPatientId());
@@ -497,8 +460,6 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
return R.ok();
}
<<<<<<< HEAD
=======
@Override
public R<?> synPeis() {
@@ -512,7 +473,6 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
}
//log.info("开始传输学生数据,总记录数: {}", totalCount);
// 2. 分批处理参数
int pageSize = 1000; // 每批大小
int pageNum = 1;
@@ -528,7 +488,7 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
})
.collect(Collectors.toList());
// 3. 分批处理
for (ArrayList<GfStudentPeisDto> list:lists) {
for (ArrayList<GfStudentPeisDto> list : lists) {
//log.info("开始处理第 {}/{} 批", pageNum, totalPages);
PeisStudentPatientDto peisStudentPatientDto = new PeisStudentPatientDto();
@@ -621,7 +581,7 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
CloseableHttpResponse response = null;
// 发送请求
try {
HttpPost httpPost = new HttpPost(TenantOptionUtil.getOptionContent(TenantOptionDict.PEIS_SERVER_URL)+"/wx/auth/syncHisInfo");
HttpPost httpPost = new HttpPost(TenantOptionUtil.getOptionContent(TenantOptionDict.PEIS_SERVER_URL) + "/wx/auth/syncHisInfo");
StringEntity stringEntity = new StringEntity(JSON.toJSONString(peisStudentPatientDto), ContentType.APPLICATION_JSON);
httpPost.setEntity(stringEntity);
// 执行http请求
@@ -645,5 +605,4 @@ public class GfStudentListAppServiceImpl implements IGfStudentListAppService {
// 可以根据业务需求决定是否重试
}
>>>>>>> v1.3
}

View File

@@ -35,9 +35,9 @@ public class GfStudentListController {
*/
@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) {
@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);
}
@@ -105,8 +105,6 @@ public class GfStudentListController {
public void importTemplate(HttpServletResponse response) {
gfStudentListAppService.importTemplate(response);
}
<<<<<<< HEAD
=======
/**
* peis同步
@@ -116,5 +114,4 @@ public class GfStudentListController {
public R<?> synPeis() {
return gfStudentListAppService.synPeis();
}
>>>>>>> v1.3
}

View File

@@ -1,9 +1,6 @@
package com.openhis.web.nenu.mapper;
<<<<<<< HEAD
=======
import com.openhis.web.nenu.dto.GfStudentPeisDto;
>>>>>>> v1.3
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -13,11 +10,8 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.nenu.dto.GfStudentListDto;
<<<<<<< HEAD
=======
import java.util.List;
>>>>>>> v1.3
/**
* 公费医疗-学生名单管理 Mapper
*
@@ -35,16 +29,15 @@ public interface GfStudentListAppMapper {
* @return 学生名单分页
*/
IPage<GfStudentListDto> selectGfStudentListPage(@Param("page") Page<GfStudentListDto> page,
@Param(Constants.WRAPPER) QueryWrapper<GfStudentListDto> queryWrapper);
@Param(Constants.WRAPPER) QueryWrapper<GfStudentListDto> queryWrapper);
<<<<<<< HEAD
=======
/**
* 获取学生名单peis同步列表
*
* @return 学生名单peis同步列表
*/
List<GfStudentPeisDto> getPatientBusNoList(@Param("pageNum")int pageNum, @Param("pageSize")int pageSize);
List<GfStudentPeisDto> getPatientBusNoList(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
/**
* 获取学生名单peis同步列表
*
@@ -59,5 +52,4 @@ public interface GfStudentListAppMapper {
*/
Long getPatientBusNoCount();
>>>>>>> v1.3
}