|
|
@ -31,6 +31,7 @@ import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author AUSU |
|
|
@ -110,6 +111,9 @@ public class WisdomCarService implements IWisdomCarService { |
|
|
|
hospitalMember = hospitalMembers.get(0); |
|
|
|
long incr = redisUtil.incr("hospital_" + hospitalMember.getHospitalId().toString(), 1L); |
|
|
|
patient.setMedicalRecordNum(String.valueOf(incr)); |
|
|
|
}else { |
|
|
|
long incr = redisUtil.incr("hospital_", 1L); |
|
|
|
patient.setMedicalRecordNum(String.valueOf(incr)); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotNull(param.getPatientName())){ |
|
|
|
patient.setName(param.getPatientName()); |
|
|
@ -167,6 +171,21 @@ public class WisdomCarService implements IWisdomCarService { |
|
|
|
long currentTime = System.currentTimeMillis(); |
|
|
|
//正在值班的医生(0-急诊护士,1-急诊医生,2-专科医生,3-分诊台)
|
|
|
|
List<HospitalMember> doctor = hospitalWrokingDao.findWorkingDoctor(hospitalMembers.get(0).getHospitalId(),currentTime); |
|
|
|
//查看正在值班的医生是否包含创建者
|
|
|
|
boolean flag = doctor.stream().anyMatch(dc -> dc.getUserId().equals(userId)); |
|
|
|
if (!flag){ |
|
|
|
HospitalMemberExample memberExample = new HospitalMemberExample(); |
|
|
|
memberExample.createCriteria().andUserIdEqualTo(userId); |
|
|
|
List<HospitalMember> member = hospitalMemberDao.selectByExample(memberExample); |
|
|
|
if (CollectionUtil.isNotEmpty(member)){ |
|
|
|
PatientDoctor patientDoctor = new PatientDoctor(); |
|
|
|
patientDoctor.setId(snowflake.nextId()); |
|
|
|
patientDoctor.setDoctorId(member.get(0).getId()); |
|
|
|
patientDoctor.setPatientId(patient.getId()); |
|
|
|
patientDoctorDao.insertSelective(patientDoctor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (HospitalMember member : doctor) { |
|
|
|
MemberRoleDto.MemberForTemplate memberForTemplate = new MemberRoleDto.MemberForTemplate(); |
|
|
|
List<String> roleName = new ArrayList<>(); |
|
|
|