导入当月处理

This commit is contained in:
zhangheng 2025-01-06 13:28:33 +08:00
parent 55fea1032f
commit fed6999a00
3 changed files with 15 additions and 13 deletions

View File

@ -65,13 +65,13 @@ public class ImportDownloadController {
break;
case Constants.PATIENT_INFO_IMPORT: // 门诊患者
//本地服务
//file = ResourceUtils.getFile("classpath:template/OutpatientFollowUpRecords.xlsx");
file = ResourceUtils.getFile("classpath:template/OutpatientFollowUpRecords.xlsx");
//线上服务
Resource resource = new ClassPathResource("classpath:template/OutpatientFollowUpRecords.xlsx");
String filePath= this.getClass().getClassLoader().getResource("classpath:template/OutpatientFollowUpRecords.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
// Resource resource = new ClassPathResource("classpath:template/OutpatientFollowUpRecords.xlsx");
// String filePath= this.getClass().getClassLoader().getResource("classpath:template/OutpatientFollowUpRecords.xlsx").getFile();
// file= new File(filePath);
// // 通过流讲文件复制到file中
// FileUtils.copyToFile(resource.getInputStream(), file);
break;
}
if (Objects.isNull(file)) {

View File

@ -420,13 +420,6 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
continue;
}
}
//同一手机号每月可最多拔打xx次
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount)) {
List<PatientInfo> collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
continue;
}
}
//判断是否有科室名称或别名一致
patientInfoImport.setSn(sn);
patientInfoImport.setCreateBy(SecurityUtils.getUsername());
@ -456,6 +449,13 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
}
}
}
//同一手机号每月可最多拔打xx次
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount)) {
List<PatientInfo> 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;
}
}
}
//无科室名返回数据
DeptAliasVO deptAliasVO = new DeptAliasVO();

View File

@ -886,6 +886,7 @@
select
pii.patient_name,
pii.patient_phone,
pi.department_id,
(select count(1) FROM sign_patient_manage_route_node a
LEFT JOIN sign_patient_manage_route b ON a.manage_route_id = b.id
LEFT JOIN patient_info c ON c.id = b.patient_id
@ -896,6 +897,7 @@
AND a.sn IS NOT NULL
AND c.sn IS NOT NULL
AND d.patient_phone = pi.patient_phone
AND c.department_id = pi.department_id
AND date_format(a.node_finish_date,'%y%m%d') &gt;= #{startDate}
AND date_format(a.node_finish_date,'%y%m%d') &lt;= #{endDate})
countPhone