导入简化
This commit is contained in:
parent
63fe18b839
commit
2eb9d3dd02
@ -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<PatientInfoImport> util = new ExcelUtil<>(PatientInfoImport.class);
|
||||
List<PatientInfoImport> list = util.importExcel(file.getInputStream());
|
||||
return patientInfoService.patientUpload(list, isDistinct, filename);
|
||||
return patientInfoService.patientUpload(list, isDistinct, filename,importName);
|
||||
}
|
||||
|
||||
@ApiOperation("未识别科室名称导入")
|
||||
|
||||
@ -98,7 +98,7 @@ public interface IPatientInfoService {
|
||||
* filename,附件名称
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult patientUpload(List<PatientInfoImport> list,Integer isDistinct,String filename);
|
||||
AjaxResult patientUpload(List<PatientInfoImport> list,Integer isDistinct,String filename,String importName);
|
||||
|
||||
/**
|
||||
* 未识别科室名称导入
|
||||
|
||||
@ -345,7 +345,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult patientUpload(List<PatientInfoImport> list, Integer isDistinct, String fileName) {
|
||||
public AjaxResult patientUpload(List<PatientInfoImport> 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<PatientInfoImport> collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getDeptAlias()) || Objects.isNull(item.getVisitDate())).collect(Collectors.toList());
|
||||
List<PatientInfoImport> 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<PatientInfoImport> 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<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;
|
||||
}
|
||||
}
|
||||
//判断是否有科室名称或别名一致
|
||||
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<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;
|
||||
}
|
||||
}
|
||||
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<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;
|
||||
}
|
||||
}
|
||||
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 ->
|
||||
{
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -75,4 +75,11 @@ public class PatientInfoImportMainVO extends BaseEntity {
|
||||
@ApiModelProperty(value = "患者导入情况")
|
||||
@Excel(name = "患者导入情况")
|
||||
private String importStatus;
|
||||
|
||||
/**
|
||||
* 导入批次名称
|
||||
*/
|
||||
@ApiModelProperty(value = "导入批次名称")
|
||||
@Excel(name = "导入批次名称")
|
||||
private String importName;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<result property="followupStatus" column="followup_status"/>
|
||||
<result property="followupCount" column="followup_count"/>
|
||||
<result property="importStatus" column="import_status"/>
|
||||
<result property="importName" column="import_status"/>
|
||||
<result property="importName" column="import_name"/>
|
||||
</resultMap>
|
||||
<resultMap type="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO" id="PatientInfoImportVOResult">
|
||||
<result property="id" column="id"/>
|
||||
@ -28,6 +28,7 @@
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_date"/>
|
||||
<result property="importStatus" column="import_status"/>
|
||||
<result property="importName" column="import_name"/>
|
||||
</resultMap>
|
||||
<sql id="selectPatientInfoImportMainVo">
|
||||
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 @@
|
||||
<include refid="selectPatientInfoImportMainVo"/>
|
||||
<where>
|
||||
<if test="sn != null and sn != ''">
|
||||
and sn = #{sn}
|
||||
and sn like concat('%', #{sn}, '%')
|
||||
</if>
|
||||
<if test="hospitalAgencyId != null ">
|
||||
and hospital_agency_id = #{hospitalAgencyId}
|
||||
@ -83,13 +84,16 @@
|
||||
and p.hospital_agency_id = #{campusAgencyId}
|
||||
</if>
|
||||
<if test="importName != null ">
|
||||
and import_name like concat('%', #{importName}, '%')
|
||||
and p.import_name like concat('%', #{importName}, '%')
|
||||
</if>
|
||||
<if test="sn != null and sn != ''">
|
||||
and p.sn like concat('%', #{sn}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</where>
|
||||
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
|
||||
|
||||
</select>
|
||||
<select id="selectPatientInfoImportMainById" parameterType="Long"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user