|
@@ -111,8 +111,7 @@ export class AggregatedService {
|
|
|
let savedBankCards: DisabledBankCard[] = [];
|
|
let savedBankCards: DisabledBankCard[] = [];
|
|
|
if (processedBankCards.length > 0) {
|
|
if (processedBankCards.length > 0) {
|
|
|
const cardsToSave = processedBankCards.map(card => {
|
|
const cardsToSave = processedBankCards.map(card => {
|
|
|
- const { file, bankName, ...cardData } = card;
|
|
|
|
|
- return this.bankCardRepository.create({ ...cardData, personId });
|
|
|
|
|
|
|
+ return this.bankCardRepository.create({ ...card, personId });
|
|
|
});
|
|
});
|
|
|
savedBankCards = await this.bankCardRepository.save(cardsToSave);
|
|
savedBankCards = await this.bankCardRepository.save(cardsToSave);
|
|
|
}
|
|
}
|
|
@@ -121,8 +120,7 @@ export class AggregatedService {
|
|
|
let savedPhotos: DisabledPhoto[] = [];
|
|
let savedPhotos: DisabledPhoto[] = [];
|
|
|
if (photos.length > 0) {
|
|
if (photos.length > 0) {
|
|
|
const photosToSave = photos.map(photo => {
|
|
const photosToSave = photos.map(photo => {
|
|
|
- const { file, ...photoData } = photo;
|
|
|
|
|
- return this.photoRepository.create({ ...photoData, personId, uploadTime: new Date() });
|
|
|
|
|
|
|
+ return this.photoRepository.create({ ...photo, personId, uploadTime: new Date() });
|
|
|
});
|
|
});
|
|
|
savedPhotos = await this.photoRepository.save(photosToSave);
|
|
savedPhotos = await this.photoRepository.save(photosToSave);
|
|
|
}
|
|
}
|
|
@@ -230,8 +228,7 @@ export class AggregatedService {
|
|
|
if (bankCards.length > 0) {
|
|
if (bankCards.length > 0) {
|
|
|
await this.bankCardRepository.delete({ personId });
|
|
await this.bankCardRepository.delete({ personId });
|
|
|
const cardsToSave = bankCards.map(card => {
|
|
const cardsToSave = bankCards.map(card => {
|
|
|
- const { file, bankName, ...cardData } = card;
|
|
|
|
|
- return this.bankCardRepository.create({ ...cardData, personId });
|
|
|
|
|
|
|
+ return this.bankCardRepository.create({ ...card, personId });
|
|
|
});
|
|
});
|
|
|
await this.bankCardRepository.save(cardsToSave);
|
|
await this.bankCardRepository.save(cardsToSave);
|
|
|
}
|
|
}
|
|
@@ -240,8 +237,7 @@ export class AggregatedService {
|
|
|
if (photos.length > 0) {
|
|
if (photos.length > 0) {
|
|
|
await this.photoRepository.delete({ personId });
|
|
await this.photoRepository.delete({ personId });
|
|
|
const photosToSave = photos.map(photo => {
|
|
const photosToSave = photos.map(photo => {
|
|
|
- const { file, ...photoData } = photo;
|
|
|
|
|
- return this.photoRepository.create({ ...photoData, personId, uploadTime: new Date() });
|
|
|
|
|
|
|
+ return this.photoRepository.create({ ...photo, personId, uploadTime: new Date() });
|
|
|
});
|
|
});
|
|
|
await this.photoRepository.save(photosToSave);
|
|
await this.photoRepository.save(photosToSave);
|
|
|
}
|
|
}
|
|
@@ -267,7 +263,7 @@ export class AggregatedService {
|
|
|
// 获取更新后的完整数据
|
|
// 获取更新后的完整数据
|
|
|
const updatedPerson = await this.personRepository.findOne({
|
|
const updatedPerson = await this.personRepository.findOne({
|
|
|
where: { id: personId },
|
|
where: { id: personId },
|
|
|
- relations: ['bankCards', 'bankCards.file', 'bankCards.file.uploadUser', 'photos', 'photos.file', 'photos.file.uploadUser', 'remarks', 'visits']
|
|
|
|
|
|
|
+ relations: ['bankCards', 'bankCards.bankName', 'bankCards.file', 'bankCards.file.uploadUser', 'photos', 'photos.file', 'photos.file.uploadUser', 'remarks', 'visits']
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (!updatedPerson) {
|
|
if (!updatedPerson) {
|