Merge remote-tracking branch 'origin/0418_小程序开发' into dev
This commit is contained in:
commit
5627616a9a
@ -3,7 +3,6 @@ package com.xinelu.manage.mapper.patientinfo;
|
||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
||||
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
||||
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -51,7 +50,15 @@ public interface PatientInfoMapper {
|
||||
* @param patientInfo 患者信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updatePatientInfo(PatientInfo patientInfo);
|
||||
int updatePatientInfoSelective(PatientInfo patientInfo);
|
||||
|
||||
/**
|
||||
* 修改患者信息
|
||||
*
|
||||
* @param patientInfo 患者信息
|
||||
* @return 结果
|
||||
*/
|
||||
int updatePatientInfo(PatientInfo patientInfo);
|
||||
|
||||
/**
|
||||
* 删除患者信息
|
||||
|
||||
@ -1,18 +1,24 @@
|
||||
package com.xinelu.manage.service.patientinfo.impl;
|
||||
|
||||
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
||||
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
|
||||
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||
import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
|
||||
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
||||
import com.xinelu.manage.dto.patientvisitrecord.PatientVisitRecordDto;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||
import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper;
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.service.patientinfo.IPatientInfoService;
|
||||
import com.xinelu.manage.service.patientvisitrecord.IPatientVisitRecordService;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -34,6 +40,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
private ResidentInfoMapper residentInfoMapper;
|
||||
@Resource
|
||||
private IPatientVisitRecordService patientVisitRecordService;
|
||||
@Resource
|
||||
private SignPatientRecordMapper signPatientRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询患者信息
|
||||
@ -125,7 +133,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
patientInfo.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
patientInfo.setUpdateTime(LocalDateTime.now());
|
||||
patientInfo.setDelFlag(0);
|
||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
patientInfoMapper.updatePatientInfoSelective(patientInfo);
|
||||
return patientInfo;
|
||||
}
|
||||
|
||||
@ -136,11 +144,18 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deletePatientInfoByIds(Long[] ids) {
|
||||
int flag = 0;
|
||||
for (Long id : ids) {
|
||||
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(id);
|
||||
// 查询关联的就诊记录是否已签约
|
||||
if (patientInfo.getSignPatientRecordId() != null && StringUtils.equals(SignRecordServiceStatusConstants.SERVICE_CENTER, patientInfo.getServiceStatus())) {
|
||||
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(patientInfo.getSignPatientRecordId());
|
||||
if (ObjectUtils.isNotEmpty(signPatientRecord) && Objects.equals(patientInfo.getPatientVisitRecordId(), signPatientRecord.getPatientVisitRecordId()) && signPatientRecord.getDelFlag() == 0) {
|
||||
throw new ServiceException("该居民已签约不能删除该就诊记录!");
|
||||
}
|
||||
}
|
||||
patientVisitRecordService.deletePatientVisitRecordById(patientInfo.getPatientVisitRecordId());
|
||||
// 根据患者最新一条就诊记录修改患者状态
|
||||
PatientVisitRecordDto patientVisitRecordDto = new PatientVisitRecordDto();
|
||||
@ -156,6 +171,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
||||
// 设置patientType
|
||||
patientVisitRecordService.setPatientType(patientInfo, patientVisitRecord);
|
||||
}
|
||||
patientInfo.setPatientType(null);
|
||||
flag += patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
}
|
||||
return flag;
|
||||
|
||||
@ -105,7 +105,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
|
||||
preHospitalization.setCreateTime(LocalDateTime.now());
|
||||
int flag = preHospitalizationMapper.insertSelective(preHospitalization);
|
||||
patientInfo.setPatientPreHospitalizationId(preHospitalization.getId());
|
||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
patientInfoMapper.updatePatientInfoSelective(patientInfo);
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
@ -391,7 +391,7 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
// 修改居民信息
|
||||
PatientInfo updInfo = patientInfoList.get(0);
|
||||
BeanUtils.copyBeanProp(updInfo, item);
|
||||
patientMapper.updatePatientInfo(updInfo);
|
||||
patientMapper.updatePatientInfoSelective(updInfo);
|
||||
patientVisitRecord.setPatientId(patientInfoList.get(0).getId());
|
||||
} else {
|
||||
PatientInfo saveInfo = new PatientInfo();
|
||||
|
||||
@ -150,7 +150,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
patient.setSignStatus(SignRecordServiceStatusConstants.IN_SIGN);
|
||||
patient.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_CENTER);
|
||||
patient.setSignTime(LocalDateTime.now());
|
||||
patientInfoMapper.updatePatientInfo(patient);
|
||||
patientInfoMapper.updatePatientInfoSelective(patient);
|
||||
if (flag > 0) {
|
||||
// 保存签约服务包信息
|
||||
SignPatientPackage signPatientPackage = new SignPatientPackage();
|
||||
@ -261,7 +261,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
// 签约信息保存到患者表
|
||||
patient.setSignStatus(patientCancelSignDto.getSignStatus());
|
||||
patient.setServiceStatus(patientCancelSignDto.getServiceStatus());
|
||||
patientInfoMapper.updatePatientInfo(patient);
|
||||
patientInfoMapper.updatePatientInfoSelective(patient);
|
||||
}
|
||||
return signPatientRecordMapper.updateByPrimaryKeySelective(signRecord);
|
||||
}
|
||||
@ -298,7 +298,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
int flag = signPatientRecordMapper.insertSelective(signRecord);
|
||||
if (flag > 0) {
|
||||
patientInfo.setSignPatientRecordId(signRecord.getId());
|
||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
patientInfoMapper.updatePatientInfoSelective(patientInfo);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo">
|
||||
<update id="updatePatientInfoSelective" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo">
|
||||
update patient_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="residentId != null">
|
||||
@ -515,6 +515,55 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updatePatientInfo" parameterType="com.xinelu.manage.domain.patientinfo.PatientInfo">
|
||||
update patient_info
|
||||
set resident_id = #{residentId},
|
||||
patient_name = #{patientName},
|
||||
patient_phone = #{patientPhone},
|
||||
family_member_phone = #{familyMemberPhone},
|
||||
birth_date = #{birthDate},
|
||||
card_no = #{cardNo},
|
||||
sex = #{sex},
|
||||
address = #{address},
|
||||
patient_type = #{patientType},
|
||||
sign_status = #{signStatus},
|
||||
sign_patient_record_id = #{signPatientRecordId},
|
||||
service_status = #{serviceStatus},
|
||||
sign_time = #{signTime},
|
||||
visit_method = #{visitMethod},
|
||||
attending_physician_id = #{attendingPhysicianId},
|
||||
attending_physician_name = #{attendingPhysicianName},
|
||||
main_diagnosis = #{mainDiagnosis},
|
||||
hospital_agency_id = #{hospitalAgencyId},
|
||||
hospital_agency_name = #{hospitalAgencyName},
|
||||
campus_agency_id = #{campusAgencyId},
|
||||
campus_agency_name = #{campusAgencyName},
|
||||
department_id = #{departmentId},
|
||||
department_name = #{departmentName},
|
||||
ward_id = #{wardId},
|
||||
ward_name = #{wardName},
|
||||
responsible_nurse = #{responsibleNurse},
|
||||
patient_visit_record_id = #{patientVisitRecordId},
|
||||
visit_serial_number = #{visitSerialNumber},
|
||||
admission_time = #{admissionTime},
|
||||
discharge_time = #{dischargeTime},
|
||||
patient_pre_hospitalization_id = #{patientPreHospitalizationId},
|
||||
appointment_treatment_group = #{appointmentTreatmentGroup},
|
||||
registration_no = #{registrationNo},
|
||||
registration_date = #{registrationDate},
|
||||
appointment_date = #{appointmentDate},
|
||||
in_hospital_number = #{inHospitalNumber},
|
||||
visit_date = #{visitDate},
|
||||
discharge_method = #{dischargeMethod},
|
||||
patient_source = #{patientSource},
|
||||
surgical_name = #{surgicalName},
|
||||
del_flag = #{delFlag},
|
||||
create_by = #{createBy},
|
||||
create_time = #{createTime},
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="deletePatientInfoById" parameterType="Long">
|
||||
update patient_info set del_flag = 1
|
||||
where id = #{id}
|
||||
|
||||
@ -102,8 +102,8 @@
|
||||
<if test="patientName != null">patient_name,</if>
|
||||
<if test="patientPhone != null">patient_phone,</if>
|
||||
<if test="cardNo != null">card_no,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="birthDate != null">birth_date,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="birthDate != null">birth_date,</if>
|
||||
<if test="signTime != null">sign_time,</if>
|
||||
<if test="hospitalAgencyId != null">hospital_agency_id,</if>
|
||||
<if test="hospitalAgencyName != null">hospital_agency_name,</if>
|
||||
@ -113,9 +113,10 @@
|
||||
<if test="departmentName != null">department_name,</if>
|
||||
<if test="wardId != null">ward_id,</if>
|
||||
<if test="wardName != null">ward_name,</if>
|
||||
<if test="patientVisitRecordId != null">patient_visit_record_id,</if>
|
||||
<if test="visitSerialNumber != null">visit_serial_number,</if>
|
||||
<if test="visitMethod != null">visit_method,</if>
|
||||
<if test="inHospitalNumber != null">in_hospital_number,</if>
|
||||
<if test="inHospitalNumber != null">in_hospital_number,</if>
|
||||
<if test="signDiagnosis != null">sign_diagnosis,</if>
|
||||
<if test="reviewDiagnosis != null">review_diagnosis,</if>
|
||||
<if test="serviceStatus != null">service_status,</if>
|
||||
@ -126,8 +127,8 @@
|
||||
<if test="billingDoctorName != null">billing_doctor_name,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="paymentStatus != null">payment_status,</if>
|
||||
<if test="healthManageId != null">health_manage_id,</if>
|
||||
<if test="healthManageName != null">health_manage_name,</if>
|
||||
<if test="healthManageId != null">health_manage_id,</if>
|
||||
<if test="healthManageName != null">health_manage_name,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@ -140,8 +141,8 @@
|
||||
<if test="patientName != null">#{patientName,jdbcType=VARCHAR},</if>
|
||||
<if test="patientPhone != null">#{patientPhone,jdbcType=VARCHAR},</if>
|
||||
<if test="cardNo != null">#{cardNo,jdbcType=VARCHAR},</if>
|
||||
<if test="sex != null">#{sex,jdbcType=VARCHAR},</if>
|
||||
<if test="birthDate != null">#{birthDate,jdbcType=DATE},</if>
|
||||
<if test="sex != null">#{sex,jdbcType=VARCHAR},</if>
|
||||
<if test="birthDate != null">#{birthDate,jdbcType=DATE},</if>
|
||||
<if test="signTime != null">#{signTime,jdbcType=TIMESTAMP},</if>
|
||||
<if test="hospitalAgencyId != null">#{hospitalAgencyId,jdbcType=BIGINT},</if>
|
||||
<if test="hospitalAgencyName != null">#{hospitalAgencyName,jdbcType=VARCHAR},</if>
|
||||
@ -151,9 +152,10 @@
|
||||
<if test="departmentName != null">#{departmentName,jdbcType=VARCHAR},</if>
|
||||
<if test="wardId != null">#{wardId,jdbcType=BIGINT},</if>
|
||||
<if test="wardName != null">#{wardName,jdbcType=VARCHAR},</if>
|
||||
<if test="patientVisitRecordId != null">#{patientVisitRecordId,jdbcType=BIGINT},</if>
|
||||
<if test="visitSerialNumber != null">#{visitSerialNumber,jdbcType=VARCHAR},</if>
|
||||
<if test="visitMethod != null">#{visitMethod,jdbcType=VARCHAR},</if>
|
||||
<if test="inHospitalNumber != null">#{inHospitalNumber,jdbcType=VARCHAR},</if>
|
||||
<if test="inHospitalNumber != null">#{inHospitalNumber,jdbcType=VARCHAR},</if>
|
||||
<if test="signDiagnosis != null">#{signDiagnosis,jdbcType=VARCHAR},</if>
|
||||
<if test="reviewDiagnosis != null">#{reviewDiagnosis,jdbcType=VARCHAR},</if>
|
||||
<if test="serviceStatus != null">#{serviceStatus,jdbcType=VARCHAR},</if>
|
||||
@ -164,8 +166,8 @@
|
||||
<if test="billingDoctorName != null">#{billingDoctorName,jdbcType=VARCHAR},</if>
|
||||
<if test="price != null">#{price,jdbcType=DECIMAL},</if>
|
||||
<if test="paymentStatus != null">#{paymentStatus,jdbcType=VARCHAR},</if>
|
||||
<if test="healthManageId != null">#{healthManageId,jdbcType=BIGINT},</if>
|
||||
<if test="healthManageName != null">#{healthManageName,jdbcType=VARCHAR},</if>
|
||||
<if test="healthManageId != null">#{healthManageId,jdbcType=BIGINT},</if>
|
||||
<if test="healthManageName != null">#{healthManageName,jdbcType=VARCHAR},</if>
|
||||
<if test="delFlag != null">#{delFlag,jdbcType=TINYINT},</if>
|
||||
<if test="createBy != null">#{createBy,jdbcType=VARCHAR},</if>
|
||||
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||
@ -221,6 +223,9 @@
|
||||
<if test="wardName != null">
|
||||
ward_name = #{wardName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="patientVisitRecordId != null">
|
||||
patient_visit_record_id = #{patientVisitRecordId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="visitSerialNumber != null">
|
||||
visit_serial_number = #{visitSerialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@ -302,6 +307,7 @@
|
||||
department_name = #{departmentName,jdbcType=VARCHAR},
|
||||
ward_id = #{wardId,jdbcType=BIGINT},
|
||||
ward_name = #{wardName,jdbcType=VARCHAR},
|
||||
patient_visit_record_id = #{patientVisitRecordId,jdbcType=BIGINT},
|
||||
visit_serial_number = #{visitSerialNumber,jdbcType=VARCHAR},
|
||||
visit_method = #{visitMethod,jdbcType=VARCHAR},
|
||||
in_hospital_number = #{inHospitalNumber,jdbcType=VARCHAR},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.xinelu.mobile.controller.homepage;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -22,7 +22,7 @@ public class HomePageController {
|
||||
private HomePageService homePageService;
|
||||
|
||||
@GetMapping("/myFollowUp")
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
public TableDataInfo myFollowUp(Long residentId) {
|
||||
return homePageService.myFollowUp(residentId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.xinelu.mobile.service.homepage;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
|
||||
public interface HomePageService {
|
||||
|
||||
AjaxResult myFollowUp(Long residentId);
|
||||
TableDataInfo myFollowUp(Long residentId);
|
||||
}
|
||||
@ -1,14 +1,18 @@
|
||||
package com.xinelu.mobile.service.homepage.Impl;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.common.utils.PageServiceUtil;
|
||||
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -18,16 +22,23 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
|
||||
@Resource
|
||||
private HomePageMapper homePageMapper;
|
||||
@Resource
|
||||
private PageServiceUtil pageServiceUtil;
|
||||
|
||||
@Override
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
public TableDataInfo myFollowUp(Long residentId) {
|
||||
pageServiceUtil.startPage();
|
||||
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo());
|
||||
if (CollectionUtils.isEmpty(myFollowUpList)) {
|
||||
return pageServiceUtil.getDataTable(new ArrayList<>());
|
||||
}
|
||||
for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
|
||||
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
|
||||
myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay()));
|
||||
}
|
||||
myFollowUpVO.setRouteNodeName((myFollowUpVO.getRouteNodeName() == null ? "出院后" : myFollowUpVO.getRouteNodeName()) + myFollowUpVO.getRouteNodeDay());
|
||||
myFollowUpVO.setRouteNodeName("出院后第" + myFollowUpVO.getRouteNodeDay() + "天");
|
||||
}
|
||||
return AjaxResult.success(myFollowUpList);
|
||||
myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed());
|
||||
return pageServiceUtil.getDataTable(myFollowUpList);
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
spmrn.route_node_name,
|
||||
IFNULL( spmrn.route_node_day,0) routeNodeDay,
|
||||
pi.discharge_time,
|
||||
IF(pter.id==NULL,0,1) sign
|
||||
IF(pter.id=NULL,0,1) sign
|
||||
FROM patient_info pi
|
||||
LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id
|
||||
LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id
|
||||
|
||||
@ -47,7 +47,7 @@ public class SignPackageExpireTask {
|
||||
patientInfo.setId(sign.getPatientId());
|
||||
patientInfo.setSignStatus(SignRecordServiceStatusConstants.EXPIRE_SIGN);
|
||||
patientInfo.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_END);
|
||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
||||
patientInfoMapper.updatePatientInfoSelective(patientInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user