患者导入新加字段
This commit is contained in:
parent
6ea34e60fb
commit
c2b432351e
@ -0,0 +1,29 @@
|
|||||||
|
package com.xinelu.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 患者导入完成情况
|
||||||
|
* @Author zh
|
||||||
|
* @Date 2024-03-19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum ImportStatusEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成
|
||||||
|
*/
|
||||||
|
FINISHED("FINISHED"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未完成
|
||||||
|
*/
|
||||||
|
UNFINISHED("UNFINISHED"),
|
||||||
|
;
|
||||||
|
|
||||||
|
final private String info;
|
||||||
|
|
||||||
|
ImportStatusEnum(String info) {
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -72,6 +72,12 @@ public class PatientInfoImportMain extends BaseEntity {
|
|||||||
@Excel(name = "已随访人数")
|
@Excel(name = "已随访人数")
|
||||||
private Long followupCount;
|
private Long followupCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者导入情况:FINISHED:已完成;UNFINISHED:未完成;NULL表示未完成
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "患者导入情况")
|
||||||
|
@Excel(name = "患者导入情况")
|
||||||
|
private String importStatus;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@ -66,4 +66,12 @@ public interface PatientInfoImportMainMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deletePatientInfoImportMainByIds(Long[] ids);
|
int deletePatientInfoImportMainByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据修改患者导入记录
|
||||||
|
*
|
||||||
|
* @param patientInfoImportMain 患者导入记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updatePatientInfoImportMainImportStatus(PatientInfoImportMain patientInfoImportMain);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.xinelu.common.constant.HttpStatus;
|
|||||||
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.domain.entity.SysUser;
|
import com.xinelu.common.core.domain.entity.SysUser;
|
||||||
|
import com.xinelu.common.enums.ImportStatusEnum;
|
||||||
import com.xinelu.common.enums.PatientSourceEnum;
|
import com.xinelu.common.enums.PatientSourceEnum;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.BaseUtil;
|
import com.xinelu.common.utils.BaseUtil;
|
||||||
@ -345,7 +346,6 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
if (Objects.isNull(agency) || StringUtils.isEmpty(agency.getNodeType())) {
|
if (Objects.isNull(agency) || StringUtils.isEmpty(agency.getNodeType())) {
|
||||||
return AjaxResult.error("该账号无所属医院信息,请先配置该账号所属的医院信息!");
|
return AjaxResult.error("该账号无所属医院信息,请先配置该账号所属的医院信息!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果要导入的数据列表为空,直接返回
|
//如果要导入的数据列表为空,直接返回
|
||||||
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
|
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
|
||||||
return AjaxResult.error("导入数据列表不能为空!" );
|
return AjaxResult.error("导入数据列表不能为空!" );
|
||||||
@ -468,6 +468,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
patientInfoImportMain.setHospitalAgencyId(agency.getId());
|
patientInfoImportMain.setHospitalAgencyId(agency.getId());
|
||||||
patientInfoImportMain.setFileName(fileName);
|
patientInfoImportMain.setFileName(fileName);
|
||||||
patientInfoImportMain.setHospitalAgencyName(agency.getAgencyName());
|
patientInfoImportMain.setHospitalAgencyName(agency.getAgencyName());
|
||||||
|
patientInfoImportMain.setImportStatus(ImportStatusEnum.UNFINISHED.getInfo());
|
||||||
patientInfoImportMainMapper.insertPatientInfoImportMain(patientInfoImportMain);
|
patientInfoImportMainMapper.insertPatientInfoImportMain(patientInfoImportMain);
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
@ -549,6 +550,10 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
}
|
}
|
||||||
|
PatientInfoImportMain patientInfoImportMainSn = new PatientInfoImportMain();
|
||||||
|
patientInfoImportMainSn.setSn(sn);
|
||||||
|
patientInfoImportMainSn.setImportStatus(ImportStatusEnum.FINISHED.getInfo());
|
||||||
|
patientInfoImportMainMapper.updatePatientInfoImportMain(patientInfoImportMainSn);
|
||||||
String msg = "已完成数据导入!导入成功" + patientInfoImportList.size() + "条记录,失败0条记录";
|
String msg = "已完成数据导入!导入成功" + patientInfoImportList.size() + "条记录,失败0条记录";
|
||||||
if (list.size() != patientInfoImportList.size()) {
|
if (list.size() != patientInfoImportList.size()) {
|
||||||
int i = list.size() - patientInfoImportList.size();
|
int i = list.size() - patientInfoImportList.size();
|
||||||
@ -650,6 +655,10 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
if (patientVisitRecordCount <= 0) {
|
if (patientVisitRecordCount <= 0) {
|
||||||
return AjaxResult.error("已完成数据导入!导入成功0条记录;失败" + patientInfoImportVO.getCount() + "条记录。");
|
return AjaxResult.error("已完成数据导入!导入成功0条记录;失败" + patientInfoImportVO.getCount() + "条记录。");
|
||||||
}
|
}
|
||||||
|
PatientInfoImportMain patientInfoImportMainSn = new PatientInfoImportMain();
|
||||||
|
patientInfoImportMainSn.setSn(patientInfoImportVO.getSn());
|
||||||
|
patientInfoImportMainSn.setImportStatus(ImportStatusEnum.FINISHED.getInfo());
|
||||||
|
patientInfoImportMainMapper.updatePatientInfoImportMain(patientInfoImportMainSn);
|
||||||
String msg = "已完成数据导入!导入成功" + patientInfoImports.size() + "条记录;失败0条记录";
|
String msg = "已完成数据导入!导入成功" + patientInfoImports.size() + "条记录;失败0条记录";
|
||||||
if (patientInfoImportVO.getCount() != patientInfoImports.size()) {
|
if (patientInfoImportVO.getCount() != patientInfoImports.size()) {
|
||||||
int minus = patientInfoImportVO.getCount() - patientInfoImports.size();
|
int minus = patientInfoImportVO.getCount() - patientInfoImports.size();
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xinelu.manage.vo.patientinfoimportmain;
|
|||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
import com.xinelu.common.core.domain.BaseEntity;
|
import com.xinelu.common.core.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -68,4 +69,10 @@ public class PatientInfoImportMainVO extends BaseEntity {
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate importTimeEnd;
|
private LocalDate importTimeEnd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者导入情况:FINISHED:已完成;UNFINISHED:未完成;NULL表示未完成
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "患者导入情况")
|
||||||
|
@Excel(name = "患者导入情况")
|
||||||
|
private String importStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
<result property="fileName" column="file_name"/>
|
<result property="fileName" column="file_name"/>
|
||||||
<result property="followupStatus" column="followup_status"/>
|
<result property="followupStatus" column="followup_status"/>
|
||||||
<result property="followupCount" column="followup_count"/>
|
<result property="followupCount" column="followup_count"/>
|
||||||
|
<result property="importStatus" column="import_status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap type="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO" id="PatientInfoImportVOResult">
|
<resultMap type="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO" id="PatientInfoImportVOResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
@ -25,9 +26,10 @@
|
|||||||
<result property="patientCount" column="patient_count"/>
|
<result property="patientCount" column="patient_count"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_date"/>
|
<result property="createTime" column="create_date"/>
|
||||||
|
<result property="importStatus" column="import_status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="selectPatientInfoImportMainVo">
|
<sql id="selectPatientInfoImportMainVo">
|
||||||
select id, sn, create_time, create_by, hospital_agency_id, hospital_agency_name, file_name, followup_status, followup_count from patient_info_import_main
|
select id, sn, create_time, create_by, hospital_agency_id, hospital_agency_name, file_name, followup_status, followup_count, import_status from patient_info_import_main
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectPatientInfoImportMainList" parameterType="PatientInfoImportMain" resultMap="PatientInfoImportMainResult">
|
<select id="selectPatientInfoImportMainList" parameterType="PatientInfoImportMain" resultMap="PatientInfoImportMainResult">
|
||||||
@ -51,6 +53,9 @@
|
|||||||
<if test="followupCount != null ">
|
<if test="followupCount != null ">
|
||||||
and followup_count = #{followupCount}
|
and followup_count = #{followupCount}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="importStatus != null ">
|
||||||
|
and import_status = #{importStatus}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="GetPatientInfoImport" resultType="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO"
|
<select id="GetPatientInfoImport" resultType="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO"
|
||||||
@ -60,6 +65,7 @@
|
|||||||
|
|
||||||
select p.*,(select count(1) from patient_info_import pii where pii.sn=p.sn) as patient_count from patient_info_import_main p
|
select p.*,(select count(1) from patient_info_import pii where pii.sn=p.sn) as patient_count from patient_info_import_main p
|
||||||
<where>
|
<where>
|
||||||
|
p.import_status = 'FINISHED'
|
||||||
<if test="importTimeStart != null">
|
<if test="importTimeStart != null">
|
||||||
and date_format(p.create_time,'%y%m%d') >= date_format(#{importTimeStart}, '%y%m%d')
|
and date_format(p.create_time,'%y%m%d') >= date_format(#{importTimeStart}, '%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
@ -105,6 +111,8 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="followupCount != null">followup_count,
|
<if test="followupCount != null">followup_count,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="importStatus != null">import_status,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="sn != null">#{sn},
|
<if test="sn != null">#{sn},
|
||||||
@ -123,6 +131,8 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="followupCount != null">#{followupCount},
|
<if test="followupCount != null">#{followupCount},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="importStatus != null">#{importStatus},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -153,6 +163,9 @@
|
|||||||
<if test="followupCount != null">followup_count =
|
<if test="followupCount != null">followup_count =
|
||||||
#{followupCount},
|
#{followupCount},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="importStatus != null">import_status =
|
||||||
|
#{importStatus},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -167,4 +180,35 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="updatePatientInfoImportMainImportStatus" parameterType="PatientInfoImportMain">
|
||||||
|
update patient_info_import_main
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="createTime != null">create_time =
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">create_by =
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="hospitalAgencyId != null">hospital_agency_id =
|
||||||
|
#{hospitalAgencyId},
|
||||||
|
</if>
|
||||||
|
<if test="hospitalAgencyName != null">hospital_agency_name =
|
||||||
|
#{hospitalAgencyName},
|
||||||
|
</if>
|
||||||
|
<if test="fileName != null">file_name =
|
||||||
|
#{fileName},
|
||||||
|
</if>
|
||||||
|
<if test="followupStatus != null">followup_status =
|
||||||
|
#{followupStatus},
|
||||||
|
</if>
|
||||||
|
<if test="followupCount != null">followup_count =
|
||||||
|
#{followupCount},
|
||||||
|
</if>
|
||||||
|
<if test="importStatus != null">import_status =
|
||||||
|
#{importStatus},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
where sn = #{sn}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user