From 2eb9d3dd02be3e0c4679cceb1d5bbd698d37aa8f Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 26 Mar 2025 16:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patientinfo/PatientInfoController.java | 4 +- .../patientinfo/IPatientInfoService.java | 2 +- .../impl/PatientInfoServiceImpl.java | 39 ++++++++----------- .../SignPatientManageRouteServiceImpl.java | 6 +-- .../PatientInfoImportMainVO.java | 7 ++++ .../PatientInfoImportMainMapper.xml | 12 ++++-- 6 files changed, 38 insertions(+), 32 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java index 6e08fb32..0a45f9f6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientInfoController.java @@ -134,7 +134,7 @@ public class PatientInfoController extends BaseController { //isDistinct==1,表示自动去重;==0表示不去重; @ApiOperation("患者信息导入") @PostMapping("/patientUpload") - public AjaxResult patientUpload(MultipartFile file, Integer isDistinct) throws Exception { + public AjaxResult patientUpload(MultipartFile file, Integer isDistinct,String importName) throws Exception { //判断excel里面是否有数据/文件格式 if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) { return AjaxResult.error("请选择需要导入的文件!"); @@ -146,7 +146,7 @@ public class PatientInfoController extends BaseController { } ExcelUtil util = new ExcelUtil<>(PatientInfoImport.class); List list = util.importExcel(file.getInputStream()); - return patientInfoService.patientUpload(list, isDistinct, filename); + return patientInfoService.patientUpload(list, isDistinct, filename,importName); } @ApiOperation("未识别科室名称导入") diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java index c37c669a..51d53947 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java @@ -98,7 +98,7 @@ public interface IPatientInfoService { * filename,附件名称 * @return AjaxResult */ - AjaxResult patientUpload(List list,Integer isDistinct,String filename); + AjaxResult patientUpload(List list,Integer isDistinct,String filename,String importName); /** * 未识别科室名称导入 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java index 31369da5..ac0dccec 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java @@ -345,7 +345,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService { */ @Transactional(rollbackFor = Exception.class) @Override - public AjaxResult patientUpload(List list, Integer isDistinct, String fileName) { + public AjaxResult patientUpload(List list, Integer isDistinct, String fileName ,String importName) { if (CollectionUtils.isNotEmpty(list) && list.size() > 100) { return AjaxResult.error("本次导入表数据超过100人次上限!"); } @@ -369,9 +369,9 @@ public class PatientInfoServiceImpl implements IPatientInfoService { return AjaxResult.error("导入数据列表不能为空!"); } //如果存在 患者姓名或手机号或科室或就诊日期为空的情况,直接返回;(暂时去除时间判断) - List collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getDeptAlias()) || Objects.isNull(item.getVisitDate())).collect(Collectors.toList()); + List collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(collect)) { - return AjaxResult.error("用户信息不完整,科室名称、就诊时间、姓名均不允许为空,请完善后重试;"); + return AjaxResult.error("用户信息不完整,姓名均不允许为空,请完善后重试;"); } //存在手机号格式不正确的情况,直接返回 // List regexPhoneList = list.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).collect(Collectors.toList()); @@ -430,26 +430,26 @@ public class PatientInfoServiceImpl implements IPatientInfoService { continue; } } + //同一手机号每月可最多拔打xx次 + if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) { + List collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) { + continue; + } + } //判断是否有科室名称或别名一致 patientInfoImport.setSn(sn); patientInfoImport.setCreateBy(SecurityUtils.getUsername()); patientInfoImport.setCreateTime(LocalDateTime.now()); patientInfoImport.setHospitalAgencyId(agency.getId()); patientInfoImport.setHospitalAgencyName(agency.getAgencyName()); - //医院有科室且名称一致塞值,不一致取数据返回,医院没科室科室数据返回 + //医院有科室且名称一致塞值,不一致不动 if (CollectionUtils.isNotEmpty(departmentList)) { Department equalsDepartment = departmentList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getDeptAlias().equals(item.getDepartmentName())).findFirst().orElse(new Department()); //科室名称一致塞值 if (Objects.nonNull(equalsDepartment.getId())) { patientInfoImport.setDepartmentId(equalsDepartment.getId()); patientInfoImport.setDepartmentName(equalsDepartment.getDepartmentName()); - //同一手机号每月可最多拔打xx次 - if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) { - List collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) { - continue; - } - } patientInfoImportList.add(patientInfoImport); continue; //科室别名一致塞值 @@ -461,13 +461,6 @@ public class PatientInfoServiceImpl implements IPatientInfoService { if (StringUtils.isNotBlank(s)) { patientInfoImport.setDepartmentId(containsDepartment.getId()); patientInfoImport.setDepartmentName(containsDepartment.getDepartmentName()); - //同一手机号每月可最多拔打xx次 - if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) { - List collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) { - continue; - } - } patientInfoImportList.add(patientInfoImport); continue; } @@ -480,6 +473,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService { deptAliasVO.setDeptAlias(patientInfoImport.getDeptAlias()); deptAliasVOS.add(deptAliasVO); // patientInfoImportList为总数据,新增patient_info_import需要 + patientInfoImport.setDepartmentName(patientInfoImport.getDeptAlias()); patientInfoImportList.add(patientInfoImport); } if (CollectionUtils.isEmpty(patientInfoImportList)) { @@ -511,13 +505,14 @@ public class PatientInfoServiceImpl implements IPatientInfoService { patientInfoImportMain.setFileName(fileName); patientInfoImportMain.setHospitalAgencyName(agency.getAgencyName()); patientInfoImportMain.setImportStatus(ImportStatusEnum.UNFINISHED.getInfo()); + patientInfoImportMain.setImportName(org.apache.commons.lang3.StringUtils.isNotBlank(importName)?importName : sn); patientInfoImportMainMapper.insertPatientInfoImportMain(patientInfoImportMain); //endregion - //科室名称全符合新增患者表,否则返回数据 - if (CollectionUtils.isNotEmpty(deptAliasVOS)) { - return AjaxResult.error("科室名称不存在", patientInfoImportVO); - } + //科室名称全符合新增患者表,否则返回数据 (简化导入修改) + //if (CollectionUtils.isNotEmpty(deptAliasVOS)) { + //return AjaxResult.error("科室名称不存在", patientInfoImportVO); + //} //region 新增居民表 patientInfoImportList.forEach(item -> { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index a38a760c..902a23e5 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -942,9 +942,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout saveNode.setPhoneTimeInterval(introducedNode.getPhoneTimeInterval()); saveNode.setQuestionInfoId(introducedNode.getQuestionInfoId()); saveNode.setQuestionnaireName(introducedNode.getQuestionnaireName()); - saveNode.setMessagePushSign(introducedNode.getMessagePushSign()); - saveNode.setOfficialPushSign(introducedNode.getOfficialPushSign()); - saveNode.setAppletPushSign(introducedNode.getAppletPushSign()); + saveNode.setMessagePushSign(Objects.isNull(introducedNode.getMessagePushSign()) ? 0 : introducedNode.getMessagePushSign()); + saveNode.setOfficialPushSign(Objects.isNull(introducedNode.getOfficialPushSign()) ? 0 : introducedNode.getOfficialPushSign()); + saveNode.setAppletPushSign(Objects.isNull(introducedNode.getAppletPushSign()) ? 0 : introducedNode.getAppletPushSign()); saveNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo()); saveNode.setRouteCheckDate(LocalDateTime.now()); saveNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimportmain/PatientInfoImportMainVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimportmain/PatientInfoImportMainVO.java index eed0db73..57f5e9d5 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimportmain/PatientInfoImportMainVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimportmain/PatientInfoImportMainVO.java @@ -75,4 +75,11 @@ public class PatientInfoImportMainVO extends BaseEntity { @ApiModelProperty(value = "患者导入情况") @Excel(name = "患者导入情况") private String importStatus; + + /** + * 导入批次名称 + */ + @ApiModelProperty(value = "导入批次名称") + @Excel(name = "导入批次名称") + private String importName; } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimportmain/PatientInfoImportMainMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimportmain/PatientInfoImportMainMapper.xml index f0266de4..93c8e15f 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimportmain/PatientInfoImportMainMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimportmain/PatientInfoImportMainMapper.xml @@ -15,7 +15,7 @@ - + @@ -28,6 +28,7 @@ + select id, sn, create_time, create_by, hospital_agency_id, hospital_agency_name, file_name, followup_status, followup_count, import_status ,import_name from patient_info_import_main @@ -37,7 +38,7 @@ - and sn = #{sn} + and sn like concat('%', #{sn}, '%') and hospital_agency_id = #{hospitalAgencyId} @@ -83,13 +84,16 @@ and p.hospital_agency_id = #{campusAgencyId} - and import_name like concat('%', #{importName}, '%') + and p.import_name like concat('%', #{importName}, '%') + + + and p.sn like concat('%', #{sn}, '%') ${params.dataScope} ORDER BY P.ID DESC - -- GROUP BY p.sn,DATE_FORMAT( p.create_time, '%Y-%m-%d' ),p.create_by + -- GROUP BY p.sn,DATE_FORMAT( p.create_time, '%Y-%m-%d' ),p.create_by