|
|
@@ -148,21 +148,6 @@ export class AggregatedService {
|
|
|
savedVisits = await this.visitRepository.save(visitsToSave);
|
|
|
}
|
|
|
|
|
|
- // 为照片获取文件URL
|
|
|
- for (const photo of savedPhotos) {
|
|
|
- if (photo.fileId) {
|
|
|
- try {
|
|
|
- const file = await this.fileRepository.findOne({ where: { id: photo.fileId } });
|
|
|
- if (file) {
|
|
|
- const url = await file.fullUrl;
|
|
|
- (photo as any).fileUrl = url;
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取文件URL失败:', error);
|
|
|
- (photo as any).fileUrl = null;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
// 返回创建的所有信息
|
|
|
return {
|
|
|
@@ -193,20 +178,6 @@ export class AggregatedService {
|
|
|
throw new Error('未找到该残疾人信息');
|
|
|
}
|
|
|
|
|
|
- // 为照片获取文件URL
|
|
|
- if (person.photos) {
|
|
|
- for (const photo of person.photos) {
|
|
|
- if (photo.file) {
|
|
|
- try {
|
|
|
- const url = await photo.file.fullUrl;
|
|
|
- (photo as any).fileUrl = url;
|
|
|
- } catch (error) {
|
|
|
- console.error('获取文件URL失败:', error);
|
|
|
- (photo as any).fileUrl = null;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
return {
|
|
|
personInfo: person,
|
|
|
@@ -310,20 +281,6 @@ export class AggregatedService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- // 为照片获取文件URL
|
|
|
- for (const photo of updatedPerson.photos || []) {
|
|
|
- if (photo.fileId) {
|
|
|
- try {
|
|
|
- const file = await this.fileRepository.findOne({ where: { id: photo.fileId } });
|
|
|
- if (file) {
|
|
|
- const url = await file.fullUrl;
|
|
|
- (photo as any).fileUrl = url;
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取文件URL失败:', error);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
return {
|
|
|
personInfo: updatedPerson,
|