|
|
|
@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 耗材字典对照
|
|
|
|
@ -92,6 +93,52 @@ public class UdiContrastService {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isDrugExit(String originUuid,String mainId, String thirdSys) {
|
|
|
|
|
|
|
|
|
|
String deviceRecordKey = null;
|
|
|
|
|
//国家库的key
|
|
|
|
|
if (StrUtil.isNotEmpty(originUuid)) {
|
|
|
|
|
UdiProductEntity udiProductEntity = udiProductService.findOneByOriginUuid(originUuid);
|
|
|
|
|
if (udiProductEntity != null)
|
|
|
|
|
deviceRecordKey = udiProductEntity.getDeviceRecordKey();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(deviceRecordKey) && StrUtil.isNotEmpty(mainId) && StrUtil.isBlank(thirdSys)) {
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceEntities = findDrkByUnion(deviceRecordKey, mainId);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
|
|
|
|
|
return true;
|
|
|
|
|
} else
|
|
|
|
|
return false;
|
|
|
|
|
} else if (StrUtil.isNotEmpty(deviceRecordKey) && StrUtil.isEmpty(mainId)) {
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceEntities = findByDeviceRecordKey(deviceRecordKey);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
|
|
|
|
|
for (UdiRelevanceResponse udiRelevanceEntity : udiRelevanceEntities) {
|
|
|
|
|
if (StrUtil.isEmpty(udiRelevanceEntity.getMainId()) && StrUtil.isNotEmpty(udiRelevanceEntity.getOriginUuid())) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
} else if (StrUtil.isNotEmpty(originUuid) && StrUtil.isNotEmpty(mainId)) {
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceEntities = findByMainId(mainId);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
|
|
|
|
|
for (UdiRelevanceResponse udiRelevanceEntity : udiRelevanceEntities) {
|
|
|
|
|
if (StrUtil.isEmpty(udiRelevanceEntity.getOriginUuid()) && StrUtil.isNotEmpty(udiRelevanceEntity.getMainId())) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
} else if (StrUtil.isNotBlank(deviceRecordKey) && StrUtil.isNotBlank(mainId) && StrUtil.isNotBlank(thirdSys)) {
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceEntities = findByUnion2(deviceRecordKey, mainId, thirdSys);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
|
|
|
|
|
return true;
|
|
|
|
|
} else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<UdiRelevanceResponse> findByUnion2(String deviceRecordKey, String mainId, String thirdSys) {
|
|
|
|
|
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiRelRequest.setMainId(mainId);
|
|
|
|
|