summaryrefslogtreecommitdiff
path: root/lib/vendor-regular-registrations/service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vendor-regular-registrations/service.ts')
-rw-r--r--lib/vendor-regular-registrations/service.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/vendor-regular-registrations/service.ts b/lib/vendor-regular-registrations/service.ts
index 42b43d6f..08e5c9ef 100644
--- a/lib/vendor-regular-registrations/service.ts
+++ b/lib/vendor-regular-registrations/service.ts
@@ -22,7 +22,8 @@ import {
vendorPQSubmissions,
vendorBusinessContacts,
vendorAdditionalInfo,
- basicContractTemplates
+ basicContractTemplates,
+ users
} from "@/db/schema";
import db from "@/db/db";
import { inArray, eq, desc, and, lt } from "drizzle-orm";
@@ -312,7 +313,7 @@ export async function sendMissingContractRequestEmails(vendorIds: number[]) {
const host = headersList.get('host') || 'localhost:3000';
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
const baseUrl = `${protocol}://${host}`;
- const contractManagementUrl = `${baseUrl}/ko/login`; // 실제 기본계약 관리 페이지 URL로 수정 필요
+ const contractManagementUrl = `${baseUrl}/ko/partners/basic-contract`; // 실제 기본계약 관리 페이지 URL로 수정 필요
let successCount = 0;
let errorCount = 0;
@@ -393,7 +394,7 @@ export async function sendAdditionalInfoRequestEmails(vendorIds: number[]) {
const host = headersList.get('host') || 'localhost:3000';
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
const baseUrl = `${protocol}://${host}`;
- const vendorInfoUrl = `${baseUrl}/ko/login`; // 실제 업체정보 관리 페이지 URL로 수정 필요
+ const vendorInfoUrl = `${baseUrl}/ko/partners/info`; // 실제 업체정보 관리 페이지 URL로 수정 필요
let successCount = 0;
let errorCount = 0;
@@ -1280,8 +1281,12 @@ export async function sendRegistrationRequestToMDG(
// 세션 사용자 정보 가져오기
const session = await getServerSession(authOptions);
const userId = session?.user?.id || 'EVCP_USER';
- const userName = session?.user?.name || 'EVCP_USER';
- const userKnoxId = session?.user?.knoxId || 'EVCP_USER';
+ //users table에서 userid로 nonsapuserid 찾기
+ const userResult = await db.query.users.findFirst({
+ where: eq(users.id, Number(userId)),
+ columns: { nonsapUserId: true }
+ });
+ const nonsapUserId = userResult?.nonsapUserId || 'EVCP_USER';
// 등록 정보 조회
const registration = await db
.select()
@@ -1334,7 +1339,7 @@ export async function sendRegistrationRequestToMDG(
IBND_TYPE: 'I',
// 10. ZZREQID: SAP의 USER ID를 보내드리겠습니다. (필수)
- ZZREQID: userKnoxId,
+ ZZREQID: nonsapUserId,
// 11. ADDRNO: I/F정의서에는 필수입력으로 되어 있습니다. -> 빈값으로 처리 (필수)
ADDRNO: '',