제어관리 회사코드 저장 안되는 문제 수정
This commit is contained in:
@@ -754,12 +754,19 @@ export class DynamicFormService {
|
||||
|
||||
// 🎯 제어관리 실행 (새로 추가)
|
||||
try {
|
||||
// savedData 또는 insertedRecord에서 company_code 추출
|
||||
const recordCompanyCode =
|
||||
(insertedRecord as Record<string, any>)?.company_code ||
|
||||
dataToInsert.company_code ||
|
||||
"*";
|
||||
|
||||
await this.executeDataflowControlIfConfigured(
|
||||
screenId,
|
||||
tableName,
|
||||
insertedRecord as Record<string, any>,
|
||||
"insert",
|
||||
created_by || "system"
|
||||
created_by || "system",
|
||||
recordCompanyCode
|
||||
);
|
||||
} catch (controlError) {
|
||||
console.error("⚠️ 제어관리 실행 오류:", controlError);
|
||||
@@ -1107,12 +1114,19 @@ export class DynamicFormService {
|
||||
|
||||
// 🎯 제어관리 실행 (UPDATE 트리거)
|
||||
try {
|
||||
// updatedRecord에서 company_code 추출
|
||||
const recordCompanyCode =
|
||||
(updatedRecord as Record<string, any>)?.company_code ||
|
||||
company_code ||
|
||||
"*";
|
||||
|
||||
await this.executeDataflowControlIfConfigured(
|
||||
0, // UPDATE는 screenId를 알 수 없으므로 0으로 설정 (추후 개선 필요)
|
||||
tableName,
|
||||
updatedRecord as Record<string, any>,
|
||||
"update",
|
||||
updated_by || "system"
|
||||
updated_by || "system",
|
||||
recordCompanyCode
|
||||
);
|
||||
} catch (controlError) {
|
||||
console.error("⚠️ 제어관리 실행 오류:", controlError);
|
||||
@@ -1251,12 +1265,17 @@ export class DynamicFormService {
|
||||
try {
|
||||
if (result && Array.isArray(result) && result.length > 0) {
|
||||
const deletedRecord = result[0] as Record<string, any>;
|
||||
// deletedRecord에서 company_code 추출
|
||||
const recordCompanyCode =
|
||||
deletedRecord?.company_code || companyCode || "*";
|
||||
|
||||
await this.executeDataflowControlIfConfigured(
|
||||
0, // DELETE는 screenId를 알 수 없으므로 0으로 설정 (추후 개선 필요)
|
||||
tableName,
|
||||
deletedRecord,
|
||||
"delete",
|
||||
userId || "system"
|
||||
userId || "system",
|
||||
recordCompanyCode
|
||||
);
|
||||
}
|
||||
} catch (controlError) {
|
||||
@@ -1562,7 +1581,8 @@ export class DynamicFormService {
|
||||
tableName: string,
|
||||
savedData: Record<string, any>,
|
||||
triggerType: "insert" | "update" | "delete",
|
||||
userId: string = "system"
|
||||
userId: string = "system",
|
||||
companyCode: string = "*"
|
||||
): Promise<void> {
|
||||
try {
|
||||
console.log(`🎯 제어관리 설정 확인 중... (screenId: ${screenId})`);
|
||||
@@ -1636,6 +1656,7 @@ export class DynamicFormService {
|
||||
buttonId: "save-button",
|
||||
screenId: screenId,
|
||||
userId: userId,
|
||||
companyCode: companyCode,
|
||||
formData: savedData,
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user