|
|
@@ -264,12 +264,14 @@ public class HisScriptSession {
|
|
|
return null;
|
|
|
}else {
|
|
|
BusPatientEntity patient = patientService
|
|
|
- .getOne(new QueryWrapper<BusPatientEntity>().lambda().eq(BusPatientEntity::getCode, patientCode).eq(BusPatientEntity::getTenantId, hospitalId));
|
|
|
+ .getOne(new QueryWrapper<BusPatientEntity>().lambda().eq(BusPatientEntity::getCode, patientCode)
|
|
|
+ .orderByDesc(BusPatientEntity::getCreateTime)
|
|
|
+ .last("limit 1"));
|
|
|
if(patient!=null){
|
|
|
List<BusClinicEntity> finalSources = sources;
|
|
|
CompletableFuture.runAsync(()->{
|
|
|
- conMixService.insertUniqueCon(finalSources,hospitalId);
|
|
|
- conDoctorService.insertUniqueDoctor(finalSources,hospitalId);
|
|
|
+ conMixService.insertUniqueCon(finalSources,patient.getTenantId());
|
|
|
+ conDoctorService.insertUniqueDoctor(finalSources,patient.getTenantId());
|
|
|
})
|
|
|
.whenComplete((i,e)->{
|
|
|
if(e!=null){
|
|
|
@@ -286,7 +288,7 @@ public class HisScriptSession {
|
|
|
}
|
|
|
String key=
|
|
|
StrUtil.isNullOrUndefined(source.getSurgeryName())?"":source.getSurgeryName()+
|
|
|
- DateUtil.formatDateTime(source.getStartTime());
|
|
|
+ DateUtil.formatDateTime(source.getStartTime());
|
|
|
if(!distinct.containsKey(key)){
|
|
|
distinct.put(key,source);
|
|
|
publish.add(source);
|
|
|
@@ -297,6 +299,7 @@ public class HisScriptSession {
|
|
|
.peek(source->{
|
|
|
source.setTenantId(hospitalId);
|
|
|
if(patient!=null){
|
|
|
+ source.setTenantId(patient.getTenantId());
|
|
|
source.setPatientId(patient.getId());
|
|
|
source.setMonitorType(true);
|
|
|
}else {
|