PageSourceSearch

https://spp.kr/resources/js/common/commonFunction/CommonBizmatch.js?v=20220406_1

js spp.kr collected 2026-10-08 10:26:06 UTC 116,331 bytes, 2,237 lines download raw bytes

1class CommonBizmatch {
2    /**
3     * 상담 확정시 메세지 및 이메일 전송
4     * @param choiceNo
5     * @param userNo 상담 신청자 user no
6     * @param cnslUserNo 상담 대상 user no
7     * @param callBackFunction
8     */
9    confirmMailSend(choiceNo, userNo, cnslUserNo, callBackFunction = () => {}) {
10        try {
11            const apiList = [
12                // 메세지 API
13                ezpmpcommonUtil.commonFunc.sendModificationMessage(choiceNo),
14                // 이메일 API
15                ezpmpcommonUtil.commonFunc.sendConfirmationMail(choiceNo, userNo, cnslUserNo)
16            ];
17
18            const apiSuccess = (returnValueList) => {
19                if (!!returnValueList) {
20                    const [ returnValue1, returnValue2 ] = returnValueList;
21                    // 응답 성공
22                    if (returnValue1.responseCode === RESPONSVALUE.SUCCESS && returnValue2.responseCode === RESPONSVALUE.SUCCESS) {
23                        callBackFunction();
24                        // 응답 실패
25                    } else if (returnValue1.responseCode === RESPONSVALUE.FAIL || returnValue2.responseCode === RESPONSVALUE.FAIL) {
26                        ezpmpcommonUtil.log.log("log text", "요청 실패");
27                        // 그 외
28                    } else {
29                        ezpmpcommonUtil.log.log("log text", "요청 실패");
30                    }
31                }
32            }
33
34            const apiFail = (returnValue) => {
35                ezpmpcommonUtil.log.log("log text", "요청 실패");
36            }
37
38            const apiError = (returnValue) => {
39                ezpmpcommonUtil.log.log("log text", "요청 실패");
40            }
41
42            ezpmpcommonUtil.apiCall.multCallApi(apiList, apiSuccess, apiFail, apiError, false);
43        } catch(e) {
44            ezpmpcommonUtil.log.log("log text", "요청 실패");
45        }
46
47    }
48
49    /**
50     * 상담 확정 메세지 발송
51     * @param userNo
52     * @param cnslUserNo
53     * @param msgLangCd
54     * @returns {Promise<*>|boolean}
55     */
56    sendModificationMessage(choiceNo, msgLangCd = "KR") {
57        // 상담스케줄 상세선택번호 목록이 존재하지 않으면 메세지 등록 불가
58        /*if (!meetingList || (!!meetingList && meetingList.length === 0)) {
59            return false;
60        }*/
61
62        // 기업당
63        let data = {
64            "projectCd": properties.projectCd,
65            "siteId": properties.siteId,
66            "meetingList": [{
67                "choiceNo": choiceNo
68            }],				// 처리된 미팅 정보 목록 (choiceNo - 스케줄 번호, histNo - 이력번호)
69            "msgLangCd": msgLangCd			// 메세지 언어 코드
70        };
71        try {
72            return ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.consultApi + `/message/meeting`, HTTPMETHOD.POST, data, 'json', false);
73        } catch (e) {
74            ezpmpcommonUtil.log.log("log text", "요청 실패");
75        }
76    }
77
78    /**
79     * 상담 확정 후 메일 발송 (신청자, 상담사 모두 메일 발송)
80     * @param choiceNo 스케줄상세선택번호
81     */
82    sendConfirmationMail(choiceNo, userNo, cnslUserNo, langCd = "KR", cnslLangCd = "KR") {
83        let meetingEmailTitleApplicant = (langCd == 'KR' ? '미팅 확정 안내' : 'The business meeting request is confirmed.');
84        let meetingEmailTitleCounselor = (cnslLangCd == 'KR' ? '미팅 확정 안내' : 'The business meeting request is confirmed.');
85        let sendMailDataAboutApplicant = {};
86        let sendMailDataAboutCounselor = {};
87
88        try {
89            // request parameter
90            const pageInfo = { page: 0, size: 9999 };
91            const mailInfo = { moveUrl: sessionStorage.getItem('siteDomain'), logo: sessionStorage.getItem("siteLogoUrl") };
92            const apiParam1 = {
93                "searchProjectCd": properties.projectCd,
94                "searchSiteId": properties.siteId,
95                "searchDetailCd": 'EMA354,EMB354',
96                "searchDelYn": "N",
97                "searchUseYn": "Y",
98                "searchLangCd": langCd,
99                ...pageInfo
100            }
101            const apiParam2 = {
102                "searchProjectCd": properties.projectCd,
103                "searchSiteId": properties.siteId,
104                "searchDetailCd": 'EMA354,EMB354',
105                "searchDelYn": "N",
106                "searchUseYn": "Y",
107                "searchLangCd": cnslLangCd,
108                ...pageInfo
109            }
110            const apiParam3 = {
111                page: 0,
112                size: 9999,
113                projectCd: properties.projectCd,
114                siteId: properties.siteId,
115                searchChoiceNo: choiceNo, // 미팅시간 조회하려는 스케줄상세선택번호
116                searchGmtNatCd: langCd, //GMT 시간을 조회할때 사용하는 언어코드
117                searchLangCd: langCd
118            };
119            const apiParam4 = {
120                page: 0,
121                size: 9999,
122                projectCd: properties.projectCd,
123                siteId: properties.siteId,
124                searchChoiceNo: choiceNo, // 미팅시간 조회하려는 스케줄상세선택번호
125                searchGmtNatCd: cnslLangCd, //GMT 시간을 조회할때 사용하는 언어코드
126                searchLangCd: cnslLangCd
127            };
128            const apiList = [
129                // 메일 제목 조회
130                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.categoryApi + "/tb/category/detail", HTTPMETHOD.GET, apiParam1, 'json', false),
131                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.categoryApi + "/tb/category/detail", HTTPMETHOD.GET, apiParam2, 'json', false),
132                // 미팅 정보 조회
133                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.consultApi + "/meeting-manage/" + userNo + "/meeting", HTTPMETHOD.GET, apiParam3),
134                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.consultApi + "/meeting-manage/" + cnslUserNo + "/meeting", HTTPMETHOD.GET, apiParam4)
135            ];
136
137            const apiSuccess = (returnValueList) => {
138                if (!!returnValueList) {
139                    const [ mailSubjectForApplicant, mailSubjectForCounselor, meetingManageForApplicant, meetingManageForCounselor ] = returnValueList;
140                    // 응답 성공
141                    if (mailSubjectForApplicant.responseCode === RESPONSVALUE.SUCCESS && mailSubjectForCounselor.responseCode === RESPONSVALUE.SUCCESS
142                        && meetingManageForApplicant.responseCode === RESPONSVALUE.SUCCESS && meetingManageForCounselor.responseCode === RESPONSVALUE.SUCCESS) {
143                        try {
144                            const dateInfo = meetingManageForApplicant.responseData.data.list[0];
145                            const userInfo = dateInfo.meetDetailInfoList[0];
146                            const cnslDateInfo = meetingManageForCounselor.responseData.data.list[0];
147                            const cnslUserInfo = cnslDateInfo.meetDetailInfoList[0];
148                            // 메세지 제목
149                            const mailSubjectForApplicantData = mailSubjectForApplicant.responseData.data.listCategoryDetail.map(item => {
150                                let subject = {};
151
152                                item.masterCd == 'EMA' ? subject.ema = item.value1 : subject.emb = item.value1;
153
154                                return subject;
155                            });
156                            const mailSubjectForCounselorData = mailSubjectForCounselor.responseData.data.listCategoryDetail.map(item => {
157                                let subject = {};
158
159                                item.masterCd == 'EMA' ? subject.ema = item.value1 : subject.emb = item.value1;
160
161                                return subject;
162                            });
163
164
165                            // 신청자에게 메일 발송
166                            sendMailDataAboutApplicant.sendMailKeyValue = {
167                                ...mailInfo,
168                                event: siteNm,
169                                subject1: mailSubjectForApplicantData.ema,
170                                subject2: mailSubjectForApplicantData.emb,
171                                //url: sessionStorage.getItem("addressToContact" + meetingDetail.reqDefaultLang),
172                                detailDt: dateInfo.meetFrDate + " " + dateInfo.meetFrTime,
173                                companyNm: !userInfo.meetCompanyNm ? '' : userInfo.meetCompanyNm,
174                                fullNm: userInfo.meetFullNm
175                            }
176
177                            // 상담자에게 메일 발송
178                            sendMailDataAboutCounselor.sendMailKeyValue = {
179                                ...mailInfo,
180                                event: siteNm,
181                                subject1: mailSubjectForCounselorData.ema,
182                                subject2: mailSubjectForCounselorData.emb,
183                                //url: sessionStorage.getItem("addressToContact" + meetingDetail.cnslDefaultLang),
184                                detailDt: cnslDateInfo.meetFrDateGmt + " " + cnslDateInfo.meetFrTimeGmt,
185                                companyNm: !cnslUserInfo.meetCompanyNm ? '' : cnslUserInfo.meetCompanyNm,
186                                fullNm: cnslUserInfo.meetFullNm
187                            }
188
189                            ezpmpcommonUtil.commonFunc.removeNullValues(sendM
189ailDataAboutApplicant.sendMailKeyValue);
190                            ezpmpcommonUtil.commonFunc.removeNullValues(sendMailDataAboutCounselor.sendMailKeyValue);
191
192                            sendMailDataAboutApplicant.senderNm = siteNm;
193                            sendMailDataAboutCounselor.senderNm = siteNm;
194
195                            const mailParam = {
196                                projectCd: properties.projectCd
197                                , siteId: properties.siteId
198                                , langCd: langCd
199                                , emailTypeCdForTemplate: "EMC354"
200                                , emailTypeCdForSender: "EMC354"
201                                , emailTitle: meetingEmailTitleApplicant
202                                , sendTypeCd: "MDC001"
203                                , keyValue: sendMailDataAboutApplicant.sendMailKeyValue
204                                , senderNm: sendMailDataAboutApplicant.senderNm
205                            };
206
207                            const cnslMailParam = {
208                                projectCd: properties.projectCd
209                                , siteId: properties.siteId
210                                , langCd: cnslLangCd
211                                , emailTypeCdForTemplate: "EMC354"
212                                , emailTypeCdForSender: "EMC354"
213                                , emailTitle: meetingEmailTitleCounselor
214                                , sendTypeCd: "MDC001"
215                                , keyValue: sendMailDataAboutCounselor.sendMailKeyValue
216                                , senderNm: sendMailDataAboutCounselor.senderNm
217                            };
218
219                            const mailList = [
220                                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.mailingApi + "/mailsend/single/" + userNo, HTTPMETHOD.POST, mailParam),
221                                ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.mailingApi+ "/mailsend/single/" + cnslUserNo, HTTPMETHOD.POST, cnslMailParam)
222                            ];
223
224                            // success function
225                            const mailSuccess = (returnValueList) => {
226                                if (!!returnValueList) {
227                                    const [ returnValue1, returnValue2 ] = returnValueList;
228                                    // 응답 성공
229                                    if (returnValue1.responseCode === RESPONSVALUE.SUCCESS && returnValue2.responseCode === RESPONSVALUE.SUCCESS) {
230                                        // 응답 실패
231                                    } else if (returnValue1.responseCode === RESPONSVALUE.FAIL || returnValue2.responseCode === RESPONSVALUE.FAIL) {
232                                        ezpmpcommonUtil.log.log("log text", "요청 실패");
233                                        // 그 외
234                                    } else {
235                                        ezpmpcommonUtil.log.log("log text", "요청 실패");
236                                    }
237                                }
238                            }
239                            // fail function
240                            const mailFail = (returnValue) => {
241                                ezpmpcommonUtil.log.log("log text", "요청 실패");
242                            }
243                            // error function
244                            const mailError = (returnValue) => {
245                                $.unblockUI();
246                                ezpmpcommonUtil.log.log("log text", "요청 실패");
247                            }
248
249                            // multiCallApi
250                            // api 전부 호출 후 콜백함수 실행
251                            // axios list, callback(success), callback(fail), blockUI 유무(boolean)
252                            ezpmpcommonUtil.apiCall.multCallApi(mail
252List, mailSuccess, mailFail, mailError, false);
253                        } catch(e) {
254                            ezpmpcommonUtil.log.log("log text", "요청 실패");
255                        }
256
257                        // 응답 실패
258                    } else if (returnValue1.responseCode === RESPONSVALUE.FAIL || returnValue2.responseCode === RESPONSVALUE.FAIL) {
259                        ezpmpcommonUtil.log.log("log text", "요청 실패");
260                        // 그 외
261                    } else {
262                        ezpmpcommonUtil.log.log("log text", "요청 실패");
263                    }
264                }
265            }
266
267            const apiFail = (returnValue) => {
268                ezpmpcommonUtil.log.log("log text", "요청 실패");
269            }
270
271            const apiError = (returnValue) => {
272                ezpmpcommonUtil.log.log("log text", "요청 실패");
273            }
274
275            ezpmpcommonUtil.apiCall.multCallApi(apiList, apiSuccess, apiFail, apiError, false);
276        } catch(e) {
277            ezpmpcommonUtil.log.log("log text", "요청 실패");
278        }
279    }
280
281    /**
282     * meetFrDateTime와 meetToDateTime를 조회 후 callbackFunction을 실행
283     * @param choiceNo
284     * @param callbackFunction
285     */
286    searchDetailDt(choiceNo, callbackFunction = () => {}) {
287        try {
288            const apiParam = {
289                projectCd: properties.projectCd,
290                siteId: properties.siteId,
291                choiceNo: choiceNo
292            };
293
294            return ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.consultApi + "/meeting-manage/" + choiceNo, HTTPMETHOD.GET, apiParam)
295                .then((returnValue) => {
296                    if (!!returnValue) {
297                        // 응답 성공
298                        if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
299                            const { meetFrDateTime, meetToDateTime } = returnValue.responseData.data;
300
301                            callbackFunction(meetFrDateTime, meetToDateTime);
302                            // 응답 실패
303                        } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
304                            ezpmpcommonUtil.log.log("log text", "요청 실패");
305                            // 그 외
306                        } else {
307                            ezpmpcommonUtil.log.log("log text", "요청 실패");
308                        }
309                    }
310                });
311        } catch(e) {
312            ezpmpcommonUtil.log.log("log text", "요청 실패");
313        }
314    }
315
316    /**
317     * 상담 수락 대기 메일 발송
318     * 해당 메일 클릭 시 받은 상대방이 상담을 수락하도록 유도
319     * 수락 시 확정대기로 변경됨
320     * @param userNo
321     * @param companyNm
322     * @param fullNm
323     * @param moveUrl
324     * @param inquiryUrl
325     * @param sendMailSubject
326     * @param sendMailSenderName
327     * @param callBackFunction
328     */
329    sendAcceptWaitMail(userNo, companyNm, fullNm, moveUrl, inquiryUrl, sendMailSubject, sendMailSenderName, callBackFunction = () => {}) {
330        try {
331            const sendMailKeyValue = {
332                subject1: sendMailSubject,
333                subject2: siteNm,
334                event: siteNm,
335                companyNm: companyNm,
336                fullNm: fullNm,
337                moveUrl: moveUrl,
338                url: inquiryUrl
339            };
340            const sendMailType = "MDC001";
341            const sendMailTemplate = "EMC47799";
342
343            ezpmpcommonUtil.commonFunc.sendMail(userNo, sendMailSubject, sendMailSenderName, sendMailKeyValue, sendMailTemplate, sendMailType, callBackFunction);
344
345        } catch(e) {
346            ezpmpcommonUtil.log.log("sendAcceptWaitMail", "요청 실패");
347        }
348    }
349
350    /**
351     * 상담 수락 대기 메일 발송 (다중)
352     * @param listParam Array[Object] [{ userNo, companyNm, fullNm, moveUrl, inquiryUrl, sendMailSubject, sendMailSenderName }, ...]
353     * @param sendMailType
354     * @param callBackFunction
355     */
356    sendAcceptWaitMultiMail(listParam, sendMailType = "MDC002", callBackFunction = () => {}) {
357        try {
358            // 이메일 템플릿 코드
359            const sendMailTemplate = "EMC47799";
360            // 보낼 이메일들의 langCd 목록
361            const langCdList = [];
362            // 이메일 전송 parameter
363            const mailParamList = [];
364
365            // langCd 탐색
366            listParam.forEach(mailParam => {
367                // langCd가 없을 경우
368                if ((mailParam.langCd === undefined || mailParam.langCd === null) && !langCdList.includes(defaultLangCd)) {
369                    langCdList.push(defaultLangCd);
370                    // langCd가 있을 경우
371                }
371 else if (!langCdList.includes(mailParam.langCd)) {
372                    langCdList.push(mailParam.langCd);
373                }
374            });
375
376            // 템플릿 검색 후 이메일 전송
377            ezpmpcommonUtil.commonFunc.getTemplateInfo(sendMailTemplate, langCdList, function(templateResult) {
378                listParam.forEach(mailParam => {
379                    // langCd
380                    let mailLangCd = mailParam.langCd ? mailParam.langCd : "KR";
381
382                    // 템플릿이 있어야 전송
383                    // 해당 langCd의 템플릿이 없으면 애초에 전송이 불가능함
384                    if (templateResult.success[mailLangCd] !== undefined && templateResult.success[mailLangCd] !== null) {
385                        const sendMailKeyValue = {
386                            subject1: mailParam.sendMailSubject,
387                            subject2: siteNm,
388                            event: siteNm,
389                            companyNm: mailParam.companyNm,
390                            fullNm: mailParam.fullNm,
391                            moveUrl: mailParam.moveUrl,
392                            url: mailParam.inquiryUrl
393                        };
394                        // mail api param
395                        const apiParam = {
396                            projectCd: properties.projectCd,
397                            siteId: properties.siteId,
398                            langCd: mailLangCd,
399                            userNo: mailParam.userNo,
400                            //emailTitle: mailParam.sendMailSubject,
401                            emailTitle: templateResult.success[mailLangCd].tmplFileNm,
402                            emailTypeCdForSender: sendMailTemplate,
403                            emailTypeCdForTemplate: sendMailTemplate,
404                            sendTypeCd: sendMailType,
405                            keyValue: sendMailKeyValue,
406                            senderNm: mailParam.sendMailSenderName
407                        };
408
409                        mailParamList.push(apiParam);
410                    }
411                });
412
413                // 메일 전송
414                ezpmpcommonUtil.commonFunc.sendMultiMail(mailParamList, callBackFunction);
415            });
416        } catch(e) {
417            ezpmpcommonUtil.log.log("sendAcceptWaitMail", "요청 실패");
418        }
419    }
420
421    /**
422     * 상담 확정 메일 발송
423     * @param choiceNo
424     * @param userNo
425     * @param companyNo
426     * @param companyNm
427     * @param fullNm
428     * @param moveUrl
429     * @param inquiryUrl
430     * @param sendMailSubject
431     * @param sendMailSenderName
432     * @param callBackFunction
433     */
434    sendConfirmMail(choiceNo, userNo, companyNo, companyNm, fullNm, moveUrl, inquiryUrl, sendMailSubject, sendMailSenderName, callBackFunction = () => {}) {
435        try {
436            if (choiceNo !== undefined && choiceNo !== null && choiceNo !== "") {
437                ezpmpcommonUtil.commonFunc.searchDetailDt(choiceNo, function(dateFr, dateTo) {
438                    const sendMailKeyValue = {
439                        subject1: sendMailSubject,
440                        subject2: siteNm,
441                        detailDt: dateFr + " ~ " + dateTo,
442                        event: siteNm,
443                        companyNm: companyNm,
444                        fullNm: fullNm,
445                        moveUrl: moveUrl,
446                        calendarUrl: frontBaseUrl + "/" + properties.projectCd + "/" + properties.siteId + "/bizMatch/meeting/calendar.do?companyNo=" + companyNo,
447                        url: inquiryUrl
448                    };
449                    const sendMailType = "MDC001";
450                    const sendMailTemplate = "EMC34774";
451
452                    ezpmpcommonUtil.commonFunc.sendMail(userNo, sendMailSubject, sendMailSenderName, sendMailKeyValue, sendMailTemplate, sendMailType, callBackFunction);
453                });
454            } else {
455                const sendMailKeyValue = {
456                    subject1: sendMailSubject,
457                    subject2: siteNm,
458                    detailDt: "내 스케줄 확인",
459                    event: siteNm,
460                    companyNm: companyNm,
461                    fullNm: fullNm,
462                    moveUrl: moveUrl,
463                    calendarUrl: frontBaseUrl + "/" + properties.projectCd + "/" + properties.siteId + "/bizMatch/meeting/calendar.do?companyNo=" + companyNo,
464                    url: inquiryUrl
465                };
466                const sendMailType = "MDC001";
467                const sendMailTemplate = "EMC34774";
468
469                ezpmpcommonUtil.commonFunc.sendMail(userNo, sendMailSubject, sendMailSenderName, sendMailKeyValue, sendMailTemplate, sendMailType, callBackFunction);
470            }
471        } catch(e) {
472            ezpmpcommonUtil.log.log("sendAcceptWaitMail", "요청 실패");
473        }
474    }
475
476    /**
477     * 상담 수락 대기 메일 발송 (여러개)
478     * 해당 메일 클릭 시 받은 상대방이 상담을 수락하도록 유도
479     * 수락 시 확정대기로 변경됨
480     * @param listParam Array[Object] [{ choiceNo, userNo, companyNo, companyNm, fullNm, moveUrl, inquiryUrl, sendMailSubject, sendMailSenderName }, ...]
481     * @param sendMailType
482     * @param callBackFunction
483     */
484    sendConfirmMultiMail(listParam, sendMailType = "MDC002", callBackFunction = () => {}) {
485        try {
486            // 이메일 템플릿 코드
487            const sendMailTemplate = "EMC34774";
488            // langCd 기본값
489            const defaultLangCd = getCookie("lang") ? getCookie("lang").toUpperCase() : "KR";
490            // 보낼 이메일들의 langCd 목록
491            const langCdList = [];
492            // 이메일 전송 parameter
493            const mailParamList = [];
494            // 날짜 정보
495            const detailDtApiList = [];
496
497            // langCd 탐색
498            listParam.forEach(mailParam => {
499                // langCd가 없을 경우
500                if ((mailParam.langCd === undefined || mailParam.langCd === null) && !langCdList.includes(defaultLangCd)) {
501                    langCdList.push(defaultLangCd);
502                    // langCd가 있을 경우
503                } else if (!langCdList.includes(mailParam.langCd)) {
504                    langCdList.push(mailParam.langCd);
505                }
506            });
507
508            // 템플릿 검색 후 이메일 전송
509            ezpmpcommonUtil.commonFunc.getTemplateInfo(sendMailTemplate, langCdList, function(templateResult) {
510                // parameter setting
511                listParam.forEach(mailParam => {
512                    // langCd
513                    let mailLangCd = mailParam.langCd ? mailParam.langCd : "KR";
514
515                    // 템플릿이 있어야 전송
516                    // 해당 langCd의 템플릿이 없으면 애초에 전송이 불가능함
517                    if (templateResult.success[mailLangCd] !== undefined && templateResult.success[mailLangCd] !== null) {
518                        // choiceNo가 있다면 detailDt를 검색해야 함
519                        if (mailParam.choiceNo !== undefined && mailParam.choiceNo !== null && mailParam.choiceNo !== "") {
520                            let detailDtApi = ezpmpcommonUtil.commonFunc.searchDetailDt(mailParam.choiceNo, function (dateFr, dateTo) {
521                                // keyValue
522                                const sendMailKeyValue = {
523                                    subject1: mailParam.sendMailSubject,
524                                    subject2: siteNm,
525                                    detailDt: dateFr + " ~ " + dateTo,
526                                    event: siteNm,
527                                    companyNm: mailParam.companyNm,
528                                    fullNm: mailParam.fullNm,
529                                    moveUrl: mailParam.moveUrl,
530                                    calendarUrl: frontBaseUrl + "/" + properties.projectCd + "/" + properties.siteId + "/bizMatch/meeting/calendar.do?companyNo=" + mailParam.companyNo,
531                                    url: mailParam.inquiryUrl
532                                };
533                                // mail api param
534                                const apiParam = {
535                                    projectCd: properties.projectCd,
536                                    siteId: properties.siteId,
537                                    userNo: mailParam.userNo,
538                                    langCd: mailLangCd,
539                                    //emailTitle: mailParam.sendMailSubject,
540                                    emailTitle: templateResult.success[mailLangCd].tmplFileNm,
541                                    emailTypeCdForSender: sendMailTemplate,
542                                    emailTypeCdForTemplate: sendMailTemplate,
543                                    sendTypeCd: sendMailType,
544                                    keyValue: sendMailKeyValue,
545                                    senderNm: mailParam.sendMailSenderName
546                                };
547
548                                mailParamList.push(apiParam);
549                            });
550
551                            detailDtApiList.push(detailDtApi);
552                            // choiceNo가 없다면 detailDt를 검색하지 않음
553                        } else {
554                            const sendMailKeyValue = {
555                                subject1: mailParam.sendMailSubject,
556                                subject2: siteNm,
557                                detailDt: mailLangCd === "KR" ? "내 스케줄 확인" : "Check my schedule",
558                                event: siteNm,
559                                companyNm: mailParam.companyNm,
560                                fullNm: mailParam.fullNm,
561                                moveUrl: mailParam.moveUrl,
562                                calendarUrl: frontBaseUrl + "/" + properties.projectCd + "/" + properties.siteId + "/bizMatch/meeting/calendar.do?companyNo=" + mailParam.companyNo,
563                                url: mailParam.inquiryUrl
564                            };
565                            // mail api param
566                            const apiParam = {
567                                projectCd: properties.projectCd,
568                                siteId: properties.siteId,
569                                userNo: mailParam.userNo,
570                                langCd: mailLangCd,
571                                //emailTitle: mailParam.sendMailSubject,
572                                emailTitle: templateResult.success[mailLangCd].tmplFileNm,
573                                emailTypeCdForSender: sendMailTemplate,
574                                emailTypeCdForTemplate: sendMailTemplate,
575                                sendTypeCd: sendMailType,
576                                keyValue: sendMailKeyValue,
577                                senderNm: mailParam.sendMailSenderName
578                            };
579
580                            mailParamList.push(apiParam);
581                        }
582                    }
583                });
584
585                if (detailDtApiList.length !== 0) {
586                    Promise.all(detailDtApiList)
587                        .then(() => {
588                            ezpmpcommonUtil.commonFunc.sendMultiMail(mailParamList, callBackFunction);
589                        });
590                } else {
591                    ezpmpcommonUtil.commonFunc.sendMultiMail(mailParamList, callBackFunction);
592                }
593            });
594            // 메일 전송
595        } catch(e) {
596            ezpmpcommonUtil.log.log("sendAcceptWaitMail", "요청 실패");
597        }
598    }
599
600    /**
601     * 매칭률 계산
602     * @param schdulNo
603     * @param companyNo
604     * @param cnslCompanyNo
605     * @param langCd
606     * @param typeNmList
607     * @param priorYn
608     * @param wishYn
609     */
610    getMatchScore(schdulNo, companyNo, cnslCompanyNo, langCd, typeNmList = ["companyCategory", "companyDetailCategory", "interestCategoryCompany"], priorYn = "Y", wishYn = "Y") {
611        try {
612            const apiParam = {
613                projectCd: properties.projectCd,
614                siteId: properties.siteId,
615                langCd: langCd,
616                schdulNo: schdulNo,
617                companyNo: companyNo,
618                cnslCompanyNo: cnslCompanyNo,
619                typeNmList: typeNmList,
620                /*userPartCd: userPartCd,*/
621                priorYn: priorYn,
622                wishYn: wishYn,
623                isExcludeStatusCdYn: "N"
624            };
625
626            return ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiPaths.consultApi + `/matching/single/batch`, HTTPMETHOD.POST, apiParam, 'json');
627        } catch(e) {
628            ezpmpcommonUtil.log.log("getMatchScore", "요청 실패");
629        }
630    }
631
632    /**
633     * 매칭률 계산 후 업데이트
634     * @param schdulNo
635     * @param choiceNo
636     * @param companyNo
637     * @param cnslCompanyNo
638     * @param langCd
639     * @param typeNmList
640     * @param priorYn
641     * @param wishYn
642     * @param callbackFunction
643     */
644    updateMatchScore(schdulNo, choiceNo, companyNo, cnslCompanyNo, langCd, typeNmList = ["companyCategory", "companyDetailCategory", "interestCategoryCompany"], priorYn = "Y", wishYn = "Y", callbackFunction = () => {}) {
645        ezpmpcommonUtil.commonFunc.getMatchScore(schdulNo, companyNo, cnslCompanyNo, langCd, typeNmList, priorYn, wishYn)
646            .then(returnValue => {
647                if (!!returnValue) {
648                    // 응답 성공
649                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
650                        if (returnValue.responseData.data.data.matchingList !== undefined
651                            && returnValue.responseData.data.data.matchingList !== null
652                            && returnValue.responseData.data.data.matchingList.length > 0) {
653
654                            const { matchingScore } = returnValue.responseData.data.data.matchingList[0];
655
656                            try {
657                                const apiParam = {
658                                    choiceNo: choiceNo,
659                                    matchingScore: matchingScore
660                                };
661
662                                ezpmpcommonUtil.apiCall.callApi(apiPaths.consultApi + "/matching/single/update", HTTPMETHOD.POST, apiParam, function(returnValue) {
663                                    if (!!returnValue) {
664                                        // 응답 성공
665                                        if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
666                                            callbackFunction();
667                                            // 응답 실패
668                                        } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
669                                            ezpmpcommonUtil.log.log("updateMatchScoreForUpdate", "요청 실패");
670                                            // 그 외
671                                        } else {
672                                            ezpmpcommonUtil.log.log("updateMatchScoreForUpdate", "요청 실패");
673                                        }
674                                    }
675                                });
676                            } catch(e) {
677                                ezpmpcommonUtil.log.log("updateMatchScoreForUpdate", "요청 실패");
678                            }
679                        } else {
680                            callbackFunction();
681                        }
682                        // 응답 실패
683                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
684                        ezpmpcommonUtil.log.log("updateMatchScoreForGet", "요청 실패");
685                        // 그 외
686                    } else {
687                        ezpmpcommonUtil.log.log("updateMatchScoreForGet", "요청 실패");
688                    }
689                }
690            });
691    }
692
693    /**
694     * 스케줄 조회
695     * @param autoMatchNotUseCheck 주선 매칭을 캘린더에 미포함 시킬 지에 대한 여부
696     * @param callbackFunction
697     * @param failFunction
698     */
699    getSchedule(autoMatchNotUseCheck = true, callbackFunction = () => {}, failFunction = () => {}) {
700        try {
701            const schedulePage = 0;
702            const scheduleSize = 9999;
703            // request parameter
704            const apiParam = {
705                searchProjectCd: properties.projectCd,
706                searchSiteId: properties.siteId,
707                searchUseYn: "Y",
708                searchDelYn: "N",
709                page: schedulePage,
710                size: scheduleSize
711            };
712
713            ezpmpcommonUtil.apiCall.callApiAxiosAsync(apiUrls.consultApi + "/tb/schdul", HTTPMETHOD.GET, apiParam, null, false)
714                .then(returnValue => {
715                    if (!!returnValue) {
716                        // 응답 성공
717                        if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
718                            if (returnValue.responseData.data?.totalCount && returnValue.responseData.data?.totalCount > 0) {
719                                const { schdulList } = returnValue.responseData.data;
720
721                                if (schdulList?.length > 0) {
722                                    if (autoMatchNotUseCheck) {
723                                        let autoMatchNotUseSchdulList = schdulList.filter(schdul => schdul?.waitYn === "N");
724
725                                        if (autoMatchNotUseSchdulList?.length > 0) {
726                                            callbackFunction(autoMatchNotUseSchdulList);
727                                        } else {
728                                            failFunction();
729                                        }
730                                    } else {
731                                        callbackFunction(schdulList);
732                                    }
733                                } else {
734                                    failFunction();
735                                }
736                            } else {
737                                failFunction();
738                            }
739                            // 응답 실패
740                        } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
741                            alert(bizMatchingErrorHandle(returnValue.responseData.data?.detailMessage));
742                            ezpmpcommonUtil.log.log("getSchedule", "요청 실패");
743                            // 그 외
744                        } else {
745                            alert(bizMatchingErrorHandle(returnValue.responseData.data?.detailMessage));
746                            ezpmpcommonUtil.log.log("getSchedule", "요청 실패");
747                        }
748                    }
749                });
750        } catch(e) {
751            ezpmpcommonUtil.log.log("getSchedule", "요청 실패");
752        }
753    }
754
755    /**
756     * 진행해야할 일정을 계산하여 반환
757     * @param autoMatchType 매칭 타입 (free: 자율, auto: 주선)
758     * @param dateCriterion 날짜 비교 기준 (apply: 신청일, schdul: 진행일)
759     * @param callback
760     * @param fail
761     */
762    getNowSchedule(autoMatchType = null, dateCriterion = "apply", callback = () => {}, fail = () => {}) {
763        // validation 체크용
764        let dateCriterionList = ["apply", "schdul"];
765        // 시작일 기준
766        let startDateKey = "applyFrDt";
767        // 종료일 기준
768        let endDateKey = "applyToDt";
769
770        if (!dateCriterionList.includes(dateCriterion)) {
771            ezpmpcommonUtil.log.log("getNowSchedule", "잘못된 dateCriterion 변수");
772            return;
773        }
774
775        // 시작일과 종료일 기준 설정
776        switch (dateCriterion) {
777            case "apply":
778                startDateKey = "applyFrDt";
779                endDateKey = "applyToDt";
780                break;
781            case "schdul":
782                startDateKey = "schdulFrDt";
783                endDateKey = "schdulToDt";
784                break;
785        }
786
787        let getScheduleSuccess = (schdulList) => {
788            const nowDate = ezpmpcommonUtil.commonFunc.dateFormat(new Date(), "YYYYMMDD");
789            let useSchdulList = schdulList;
790            // 진행중인 일자만 필터링
791            let inRangeSchdulList = useSchdulList.filter((schdul, index) => {
792                let schdulStartDate = schdul?.[startDateKey];
793                let schdulEndDate = schdul?.[endDateKey];
794
795                return ezpmpcommonUtil.commonFunc.isDateInRange(nowDate, schdulStartDate, schdulEndDate);
796            });
797            let useSchdulForType = {
798                "BTC001": null,
799                "BTC002": null,
800                "BTC003": null
801            }
802            let useSchdulRange = {
803                "BTC001": null,
804                "BTC002": null,
805                "BTC003": null
806            }
807
808            switch (autoMatchType) {
809                // 주선 매칭만 가져올 경우
810                case "auto":
811                    inRangeSchdulList = inRangeSchdulList.filter(schdul => schdul?.waitYn === "Y");
812                    break;
813                // 자율 매칭만 가져올 경우
814                case "free":
815                    inRangeSchdulList = inRangeSchdulList.filter(schdul => schdul?.waitYn === "N");
816                    break;
817            }
818
819            if (inRangeSchdulList?.length > 1) {
820                let checkIdx = 0;
821                let checkRange = 9999;
822
823                for (let i = 0; i < inRangeSchdulList.length; i++) {
824                    let schdulStartDate;
825                    let schdulEndDate;
826                    let schdulRange;
827
828                    // 시작일과 종료일 기록
829                    schdulStartDate = inRangeSchdulList[i]?.[startDateKey];
830                    schdulEndDate = inRangeSchdulList[i]?.[endDateKey];
831
832                    // 일자가 없는 일정이 포함되었으면 처리 실패 로직 분기
833                    if (!schdulStartDate || !schdulEndDate) {
834                        ezpmpcommonUtil.log.log("getNowSchedule", "일자 정보 없음");
835                        fail();
836                        return;
837                    }
838
839                    // 날짜 차이 기록
840                    schdulRange = ezpmpcommonUtil.commonFunc.diffDay(nowDate, schdulStartDate);
841
842                    // 만약 일정의 시작일이 기록된 값보다 더 가깝다면 재할당
843                    // 첫번째꺼는 그냥 넣음
844                    if (i === 0 || schdulRange < checkRange) {
845                        checkIdx = i;
846                    }
847
848                    // 온/오프라인 유형별로 사용할 일정을 저장
849                    // 행사 시작일이 더 가까운 날짜 기준
850                    switch (inRangeSchdulList[i].consultingTypeCd) {
851                        // 온라인
852                        case "BTC001":
853                            if (!useSchdulRange["BTC001"] || schdulRange < useSchdulRange["BTC001"]) {
854                                useSchdulForType["BTC001"] = inRangeSchdulList[i];
855                                useSchdulRange["BTC001"] = schdulRange;
856                            }
857                            break;
858                        // 오프라인
859                        case "BTC002":
860                            if (!useSchdulRange["BTC002"] || schdulRange < useSchdulRange["BTC002"]) {
861                                useSchdulForType["BTC002"] = inRangeSchdulList[i];
862                                useSchdulRange["BTC002"] = schdulRange;
863                            }
864                            break;
865                        // 온/오프라인
866                        case "BTC003":
867                            if (!useSchdulRange["BTC001"] || schdulRange < useSchdulRange["BTC001"]) {
868                                useSchdulForType["BTC001"] = inRangeSchdulList[i];
869                                useSchdulRange["BTC001"] = schdulRange;
870                            }
871                            if (!useSchdulRange["BTC002"] || schdulRange < useSchdulRange["BTC002"]) {
872                                useSchdulForType["BTC002"] = inRangeSchdulList[i];
873                                useSchdulRange["BTC002"] = schdulRange;
874                            }
875                            if (!useSchdulRange["BTC003"] || schdulRange < useSchdulRange["BTC003"]) {
876                                useSchdulForType["BTC003"] = inRangeSchdulList[i];
877                                useSchdulRange["BTC003"] = schdulRange;
878                            }
879                            break;
880                    }
881                }
882
883                callback(inRangeSchdulList[checkIdx], useSchdulForType);
884            } else if (inRangeSchdulList?.length === 1) {
885                useSchdulForType[inRangeSchdulList[0].consultingTypeCd] = inRangeSchdulList[0];
886                callback(inRangeSchdulList[0], useSchdulForType);
887            } else {
888                fail();
889            }
890        };
891        let getScheduleFail = () => {
892            fail();
893        };
894
895        this.getSchedule(false, getScheduleSuccess, getScheduleFail);
896    }
897
898    /**
899     * 캘린더 일정 탭 만들기
900     * @param calendarTabId 캘린더 탭 element id
901     * @param applyDateCheck 신청 기간 확인 (true: 신청 기간인지 확인함, false: 확인하지 않음)
902     * @param autoMatchNotUseCheck 주선 매칭을 캘린더에 미포함 시킬 지에 대한 여부
903     * @param callbackFunction
904     * @param failFunction
905     */
906    createCalendarTab(calendarTabId, applyDateCheck = true, autoMatchNotUseCheck = true, callbackFunction = () => {}, failFunction = () => {}) {
907        const calendarTab = document.getElementById(calendarTabId);
908
909        if (calendarTab) {
910            // 탭 그리기
911            const createFunction = (schdulList) => {
912                // 활성화된 스케줄 번호
913                let activeSchdulNo;
914
915                calendarTab.innerHTML = "";
916
917                schdulList.map((schedule, idx) => {
918                    let today = ezpmpcommonUtil.commonFunc.getDate();
919                    // 스케줄의 시작일과 종료일 사이에 있을 경우 진행
920                    if (!applyDateCheck
921                        || (ezpmpcommonUtil.commonFunc.isBforeDate(schedule.applyFrDt, today) && ezpmpcommonUtil.commonFunc.isAfterDate(schedule.applyToDt, today))
922                        || ezpmpcommonUtil.commonFunc.isSameDate(schedule.applyFrDt, today)
923                        || ezpmpcommonUtil.commonFunc.isSameDate(schedule.applyToDt, today)) {
924
925                        // li
926                        let tabLiParam = {
927                            "elementType": "li",
928                            "elementData": {
929                                "id": "schdulNo_" + schedule.schdulNo,
930                                "class": !activeSchdulNo ? ["active"] : "",
931                                "name": "scheduleNo",
932                                "value": schedule.schdulNo,
933                                "data-tab": schedule.consultingTypeCd,
934                                "data-disp-conf-only": schedule.dispConfOnly,
935                                "data-wait-yn": schedule.waitYn
936                            }
937                        };
938                        // a
939                        let tabAParam = {
940                            "elementType": "a",
941                            "elementData": {
942                                "href": "javascript:void(0);",
943                                "text": schedule.schdulName
944                            }
945                        }
946
947                        let tabLi = ezpmpcommonUtil.commonFunc.createElementParam(tabLiParam);
948                        let tabA = ezpmpcommonUtil.commonFunc.createElementParam(tabAParam);
949
950                        tabLi.append(tabA);
951                        calendarTab.append(tabLi);
952
953                        if (!activeSchdulNo) {
954                            activeSchdulNo = schedule.schdulNo;
955                        }
956                    }
957                });
958
959                if (activeSchdulNo) {
960                    callbackFunction(schdulList, activeSchdulNo);
961                } else {
962                    failFunction();
963                }
964            };
965
966            ezpmpcommonUtil.commonFunc.getSchedule(autoMatchNotUseCheck, createFunction, failFunction)
967        } else {
968            failFunction();
969            ezpmpcommonUtil.log.log("createCalendarTab", "요청된 element를 찾을 수 없음");
970        }
971    }
972
973    /**
974     * 캘린더 일정표 만들기
975     * @param calendarParams (Object)
976     * schdulNo (Number) 스케줄 번호
977     * detailNo (Number) 일정표에 표시할 현재 일정의 시간 번호
978     * applicantUserNo (Number) 신청자 유저 번호
979     * counselorUserNo (Number) 상담자 유저 번호
980     * timeElementId (String) 왼쪽 시간 정보 element id
981     * subTitleElementId (String) 날짜 위에 있는 기간 정보 element id
982     * calendarElementId (String) 달력이 그려질 element id
983     * searchGmt (String) GMT Time 코드 (KST: GMT069)
984     * blockText (String) 블락일 경우 보여줄 텍스트
985     * confirmedBlockText (String) 상담 확정일 경우 보여줄 텍스트
986     * blockSlotList (Array[Object]) 하드코딩되어 블록될 시간
987     * - ex) blockSlotList = [{ startTime: "2024-09-08 16:00", endTime: "2024-09-08 16:30" }]
988     * searchStatus (Object) 캘린더에 보여줄 statusCd별 text
989     * - ex) searchStatus = { "STS001": "Pending", "STS002": "Confirmed" }
990     * caseText (String) 대기, 확정 등의 미팅이 몇 건 존재하는지 표기할 텍스트
991     * companyNameViewUse (Boolean) true: 1건만 있을 경우 기업명을 노출
992     * @param callbackFunction
993     * @param failFunction
994     */
995    createCalendar(calendarParams, callbackFunction = () => {}, failFunction = () => {}) {
996        const MY_CALENDAR_USER_TYPE_APPLICANT = 1;
997        const MY_CALENDAR_USER_TYPE_COUNSELOR = 2;
998        const MY_CALENDAR_USER_TYPE_OTHER = 3;
999        let myUserType = 0;
1000        let {
1001            schdulNo,
1002            detailNo,
1003            applicantUserNo,
1004            counselorUserNo,
1005            timeElementId = "start_time_list",
1006            subTitleElementId = "calendarSubTitle",
1007            calendarElementId = "schedule_list",
1008            searchGmt = "GMT069",
1009            blockText = "Unavailable Time (Block)",
1010            confirmedBlockText = "Unavailable Time",
1011            blockSlotList = [],
1012            searchStatus,
1013            caseText = "",
1014            companyNameViewUse = false,
1015            meetingPlaceUseText = "미팅 플레이스 사용중",
1016            meetingPlaceNo,
1017            refreshTimeText = "Refresh time",
1018            previousTimeBlock = false,
1019            previousTimeBlockText = "Unavailable Time (Block)"
1020        } = calendarParams;
1021        let callbackParam = {
1022            applicantUserMeetingList: [],
1023            counselorUserMeetingList: [],
1024            meetFrTimeFm: "",
1025            meetToTimeFm: "",
1026            meetingPlaceThisTimeUseCheck: true
1027        };
1028        // 미팅 플레이스의 배정된 날짜 정보 불러오기
1029        let meetingPlaceLoad = (meetingPlaceCallback) => {
1030            // 입력된 미팅 플레이스가 있으면 정보를 불러온 뒤 캘린더를 생성
1031            if (meetingPlaceNo) {
1032                let meetingPlaceParams = {
1033                    page: 0,
1034                    size: 1,
1035                    meetingPlaceNo: meetingPlaceNo,
1036                    delYn: "N",
1037                    useYn: "Y"
1038                }
1039                ezpmpcommonUtil.commonFunc.loadMeetingPlaceList(meetingPlaceParams, meetingPlaceCallback, meetingPlaceCallback);
1040                // 없으면 기존 로직 진행
1041            } else {
1042                meetingPlaceCallback();
1043            }
1044        }
1045
1046        if (!schdulNo) {
1047            ezpmpcommonUtil.log.log("createCalendar", "schdulNo (스케줄 번호) 누락");
1048            return;
1049        }
1050
1051        if (!applicantUserNo) {
1052            ezpmpcommonUtil.log.log("createCalendar", "applicantUserNo (신청자 유저 ë²
1052ˆí˜¸) 누락");
1053            return;
1054        }
1055
1056        if (properties.userNo == applicantUserNo) {
1057            myUserType = MY_CALENDAR_USER_TYPE_APPLICANT;
1058        } else if (counselorUserNo && properties.userNo == counselorUserNo) {
1059            myUserType = MY_CALENDAR_USER_TYPE_COUNSELOR;
1060        } else {
1061            myUserType = MY_CALENDAR_USER_TYPE_OTHER;
1062        }
1063
1064        try {
1065            meetingPlaceLoad(function(meetingPlaceData = null) {
1066                let meetingPlaceUseDateList;
1067                let defaultLangCd = properties.langCd;
1068                let replaceLangCd = "EN";
1069                let searchGmtNatCd = properties.langCd;
1070                let searchStatusArray = searchStatus ? Object.keys(searchStatus) : [];
1071                // 스케줄 조회
1072                let schdulInfoAPI = apiUrls.consultApi + "/tb/schdul/get?page=0&size=9999";
1073                let schdulInfoParam = {
1074                    searchSchdulNo: schdulNo,
1075                    searchProjectCd: properties.projectCd,
1076                    searchSiteId: properties.siteId
1077                };
1078                // 신청자
1079                let applicantUserMeetingAPI = apiUrls.consultApi + "/account-meeting/schdul/" + schdulNo + "/" + applicantUserNo;
1080                let applicantUserMeetingManageAPI = apiUrls.consultApi + "/meeting-manage/" + applicantUserNo + "/meeting";
1081                let applicantUserMeetingParam = {
1082                    projectCd: properties.projectCd,
1083                    siteId: properties.siteId,
1084                    schdulNo: schdulNo,
1085                    selUserNo: applicantUserNo,
1086                    defaultLangCd: defaultLangCd,
1087                    replaceLangCd: replaceLangCd,
1088                    searchGmtNatCd: searchGmtNatCd,
1089                    searchGmt: searchGmt
1090                };
1091                let applicantUserMeetingManageParam = {
1092                    projectCd: properties.projectCd,
1093                    siteId: properties.siteId,
1094                    page: 0,
1095                    size: 9999,
1096                    searchGmt: searchGmt
1097                };
1098
1099                // 미팅플레이스에 배정된 시간 저장
1100                if (meetingPlaceData?.list[0]?.meetingPlaceDetailList[0]?.meetingPlaceDetailSubList.length > 0) {
1101                    meetingPlaceUseDateList = {};
1102
1103                    meetingPlaceData.list[0].meetingPlaceDetailList[0].meetingPlaceDetailSubList.forEach(placeDetailSub => {
1104                        let dateKey = ezpmpcommonUtil.commonFunc.baseDateFormat(placeDetailSub.meetFrDateTimeFm, "YYYY-MM-DD");
1105                        if (meetingPlaceUseDateList[dateKey]) {
1106                            meetingPlaceUseDateList[dateKey] = [...meetingPlaceUseDateList[dateKey], placeDetailSub];
1107                        } else {
1108                            meetingPlaceUseDateList[dateKey] = [placeDetailSub];
1109                        }
1110                    });
1111                }
1112
1113                // 만약 대기/확정을 검색한다면
1114
1115                /**
1116                 * 스케줄 조회 api
1117                 * 신청자와 상담자의 정보를 얻어서 반영
1118                 * 접속자가 신청자일 수도 있고, 상담자일 수도 있기 때문에 취급에 주의가 필요하다
1119                 * STS코드는 statusMap이 null이 아니라면 확인하면 된다
1120                 * 블로킹이 되어있는지 여부는 schdulStatus를 확인하면 된다
1121                 * 블로킹이 되어있다면 response의 미팅 정보에 schdulStatus가 Y로 되어 있을 거다
1122                 * 반대로 블로킹이 안되어있다면 schdulStatus가 N으로 되어 있을 거다
1123                 * 블로킹과 statusMap은 관련이 없다
1124                 * @type {Promise<null>[]}
1125                 */
1126                let apiList = [
1127                    ezpmpcommonUtil.apiCall.callApiAxiosAsync(schdulInfoAPI, HTTPMETHOD.POST, schdulInfoParam),
1128                    ezpmpcommonUtil.apiCall.callApiAxiosAsync(applicantUserMeetingAPI, HTTPMETHOD.POST, applicantUserMeetingParam),
1129                    ezpmpcommonUtil.apiCall.callApiAxiosAsync(applicantUserMeetingManageAPI, HTTPMETHOD.GET, applicantUserMeetingManageParam)
1130                ];
1131
1132                // 상담자도 조회할 시 추가 조회
1133                if (counselorUserNo) {
1134                    // 상담자
1135                    let counselorUserMeetingAPI = apiUrls.consultApi + "/account-meeting/schdul/" + schdulNo + "/" + counselorUserNo;
1136                    let counselorUserMeetingManageAPI = apiUrls.consultApi + "/meeting-manage/" + counselorUserNo + "/meeting";
1137                    let counselorUserMeetingParam = {
1138                        projectCd: properties.projectCd,
1139                        siteId: properties.siteId,
1140                        schdulNo: schdulNo,
1141                        selUserNo: counselorUserNo,
1142                        defaultLangCd: defaultLangCd,
1143                        replaceLangCd: replaceLangCd
1144                    };
1145                    let counselorUserMeetingManageParam = {
1146                        projectCd: properties.projectCd,
1147                        siteId: properties.siteId,
1148                        page: 0,
1149                        size: 9999,
1150                        searchGmt: searchGmt
1151                    };
1152
1153                    apiList.push(ezpmpcommonUtil.apiCall.callApiAxiosAsync(counselorUserMeetingAPI, HTTPMETHOD.POST, counselorUserMeetingParam));
1154                    apiList.push(ezpmpcommonUtil.apiCall.callApiAxiosAsync(counselorUserMeetingManageAPI, HTTPMETHOD.GET, counselorUserMeetingManageParam));
1155                }
1156
1157                // success function
1158                const apiSuccess = (returnValueList) => {
1159                    if (!!returnValueList) {
1160                        // applicantReturnValue: 신청자의 일정 정보
1161                        // applicantManageReturnValue: 신청자가 보유한 일정 목록
1162                        // counselorReturnValue: 상담자의 일정 정보
1163                        // counselorManageReturnValue: 상담자가 보유한 일정 목록
1164                        const [ schdulInfoReturnValue, applicantReturnValue, applicantManageReturnValue, counselorReturnValue, counselorManageReturnValue ] = returnValueList;
1165                        let apiResponseCode = RESPONSVALUE.SUCCESS;
1166
1167                        returnValueList.forEach(returnValue => {
1168                            if (returnValue) {
1169                                // 어느 것이라도 api 호출에 실패한다면
1170                                if (apiResponseCode === RESPONSVALUE.FAIL || returnValue.responseCode === RESPONSVALUE.FAIL) {
1171                                    apiResponseCode = RESPONSVALUE.FAIL;
1172                                    // 실패한 api가 존재하지 않는데 SUCCESS가 아닌 게 끼어있다면
1173                                } else if (returnValue.responseCode !== RESPONSVALUE.SUCCESS) {
1174                                    apiResponseCode = returnValue.responseCode;
1175                                }
1176                            }
1177                        });
1178
1179                        // 성공
1180                        if (apiResponseCode === RESPONSVALUE.SUCCESS) {
1181                            // 시간 목록이 작성될 element
1182                            const startTimeListHTML = document.getElementById(timeElementId);
1183                            // 일정 제목
1184                            const calendarSubTitleHTML = document.getElementById(subTitleElementId);
1185                            // 일정 목록이 작성될 element
1186                            const scheduleListHTML = document.getElementById(calendarElementId);
1187                            // 스케줄 정보
1188                            let schdulInfo = schdulInfoReturnValue?.responseData?.data;
1189                            // 스케줄 정보들
1190                            let { schdulList: schdulDataList } = schdulInfo;
1191                            // 신청자의 정보
1192                            let myMeetingInfo = applicantReturnValue?.responseData?.data;
1193                            // 신청자의 정보들
1194                            let { accountMeetingList: myMeetingList, schdulList, timeList } = myMeetingInfo;
1195                            // 상담자의 정보
1196                            let otherMeetingInfo;
1197                            // 상담자의 정보
1198                            let otherMeetingList;
1199                            // 신청자의 일정 목록
1200                            let calendarMeetingList = {};
1201                            // 상담자의 일정 목록
1202                            let otherCalendarMeetingList = {};
1203                            // refresh time start
1204                            let refreshStartTime;
1205                            // refresh time end
1206                            let refreshEndTime;
1207                            // 현재 시간
1208                            let nowDateTime = ezpmpcommonUtil.commonFunc.dateFormat(new Date(), "YYYY-MM-DD HH:mm");
1209
1210                            // refresh time setting
1211                            if (schdulDataList?.[0]?.refreshStartTime && schdulDataList[0].refreshStartTime.length === 4) {
1212                                refreshStartTime = schdulDataList[0].refreshStartTime.substr(0, 2) + ":" + schdulDataList[0].refreshStartTime.substr(2, 4);
1213                            }
1214                            // refresh time setting
1215                            if (schdulDataList?.[0]?.refreshEndTime && schdulDataList[0].refreshEndTime.length === 4) {
1216                                refreshEndTime = schdulDataList[0].refreshEndTime.substr(0, 2) + ":" + schdulDataList[0].refreshEndTime.substr(2, 4);
1217                            }
1218
1219                            // 신청자의 일정을 조회
1220                            if (applicantManageReturnValue && applicantManageReturnValue?.responseData?.data?.list) {
1221                                applicantManageReturnValue.responseData.data.list.forEach(meeting => {
1222                                    // detailNo에 해당하는 미팅이 저장된게 없다면 status별로 정리해서 넣어줄 양식을 넣어줌
1223                                    if (!calendarMeetingList[meeting?.detailNo]) {
1224                                        calendarMeetingList[meeting?.detailNo] = {};
1225                                    }
1226                                    // 저장된 status가 없다면 status를 넣어줌
1227                                    if (!calendarMeetingList[meeting?.detailNo][meeting?.statusCd]) {
1228                                        calendarMeetingList[meeting?.detailNo][meeting?.statusCd] = [];
1229                                    }
1230
1231                                    // detailNo에 해당하는 status별 미팅을 넣어줌
1232                                    calendarMeetingList[meeting.detailNo][meeting?.statusCd].push(meeting);
1233                                });
1234
1235                                callbackParam.applicantUserMeetingList = calendarMeetingList;
1236                            }
1237
1238                            // 상담자의 정보를 조회했을 경우에만 값을 가져ì˜
1238¤ê¸°
1239                            if (counselorReturnValue) {
1240                                otherMeetingInfo = counselorReturnValue?.responseData?.data;
1241                                otherMeetingList = otherMeetingInfo?.accountMeetingList;
1242
1243                                // 상담자의 일정을 조회
1244                                if (counselorManageReturnValue && counselorManageReturnValue?.responseData?.data?.list) {
1245                                    counselorManageReturnValue.responseData.data.list.forEach(meeting => {
1246                                        // detailNo에 해당하는 미팅이 저장된게 없다면 status별로 정리해서 넣어줄 양식을 넣어줌
1247                                        if (!otherCalendarMeetingList[meeting?.detailNo]) {
1248                                            otherCalendarMeetingList[meeting?.detailNo] = {};
1249                                        }
1250                                        // 저장된 status가 없다면 status를 넣어줌
1251                                        if (!otherCalendarMeetingList[meeting?.detailNo][meeting?.statusCd]) {
1252                                            otherCalendarMeetingList[meeting?.detailNo][meeting?.statusCd] = [];
1253                                        }
1254
1255                                        // detailNo에 해당하는 status별 미팅을 넣어줌
1256                                        otherCalendarMeetingList[meeting.detailNo][meeting?.statusCd].push(meeting);
1257                                    });
1258                                }
1259
1260                                callbackParam.counselorUserMeetingList = otherCalendarMeetingList;
1261                            }
1262
1263                            // element 초기화
1264                            startTimeListHTML.innerHTML = "";
1265                            scheduleListHTML.innerHTML = "";
1266
1267                            // 달력 그리기 시작
1268                            if (myMeetingList && schdulList && timeList) {
1269                                // 날짜별 element 저장
1270                                let calendarElements = {};
1271                                // 일정 정렬
1272                                myMeetingList.sort((a, b) => a.rnum - b.rnum);
1273
1274                                // 상담원 정보가 있다면
1275                                if (otherMeetingList) {
1276                                    otherMeetingList.sort((a, b) => a.rnum - b.rnum);
1277                                }
1278
1279                                // 우선 날짜별로 li 작성
1280                                schdulList.forEach(schdul => {
1281                                    const dateDivParam = {
1282                                        "elementType": "div",
1283                                        "elementData": {
1284                                            "class": "i_date",
1285                                            "text": ezpmpcommonUtil.commonFunc.dateFormat(schdul?.schdulDt, "YYYY-MM-DD ddd", dateLang)
1286                                        }
1287                                    };
1288                                    const itemOlParam = {
1289                                        "elementType": "ol",
1290                                        "elementData": {
1291                                            "class": "i_item_wrap"
1292                                        }
1293                                    };
1294
1295                                    let dateDiv = ezpmpcommonUtil.commonFunc.createElementParam(dateDivParam);
1296                                    let itemOl = ezpmpcommonUtil.commonFunc.createElementParam(itemOlParam);
1297
1298                                    calendarElements[schdul?.schdulDt] = {
1299                                        "dateDiv": dateDiv,
1300                                        "itemOl": itemOl
1301                                    };
1302                                });
1303
1304                                // 달력 제목
1305                                // 일단 기획서대로 날짜를 적기
1306                                if (calendarSubTitleHTML) {
1307                                    calendarSubTitleHTML.innerText = ezpmpcommonUtil.commonFunc.dateFormat(schdulList[0]?.schdulDt, "YYYY-MM-DD ddd", dateLang);
1308
1309                                    if (schdulList.length > 1) {
1310                                        calendarSubTitleHTML.innerText += " ~ ";
1311                                        calendarSubTitleHTML.innerText += ezpmpcommonUtil.commonFunc.dateFormat(schdulList[schdulList.length - 1]?.schdulDt, "YYYY-MM-DD ddd", dateLang);
1312                                    }
1313                                }
1314
1315                                // 일정 정리
1316                                for (let i = 0; i < myMeetingList.length; i++) {
1317                                    // 하드코딩 블락 확인용
1318                                    // true면 "하드코딩에 의해" 블락된 것
1319                                    let blockCheck = false;
1320                                    // refresh time 확인용
1321                                    let refreshCheck = false;
1322                                    // 사용이 가능한지 여부(블록 및 확정에 의한 사용 가능 여부, 하드코딩 아님)
1323                                    let useCheck = true;
1324                                    // 미팅 플레이스에서 사용중인 시간인지 확인용
1325                                    let meetingPlaceUseCheck = false;
1326                                    // 미팅 플레이스에서 사용중인 일정 번호
1327                                    //let meetingPlaceUseChoiceNo = "";
1328                                    // api에서 정리를 해서 보내주고, 정렬도 한번 더 거쳐서 그럴 일이 없겠지만
1329                                    // 만에 하나 두 캘린더가 서로 다른 걸 바라본다면 진행이 되면 안된다
1330                                    if (otherMeetingList && myMeetingList[i]?.detailNo !== otherMeetingList[i]?.detailNo) {
1331                                        failFunction();
1332                                        break;
1333                                    }
1334
1335                                    let itemLiParam = {
1336                                        "elementType": "li",
1337                                        "elementData": {}
1338                                    };
1339                                    let itemDivParam = {
1340                                        "elementType": "div",
1341                                        "elementData": {
1342                                            "class": ["i_item"],
1343                                            "data-place-choice-no": "",
1344                                            "onclick": {
1345                                                "funcName": "clickTimeSlot",
1346                                                "values": myMeetingList[i]?.detailNo
1347                                            }
1348                                        }
1349                                    };
1350                                    let itemTextParam = {
1351                                        "elementType": "span",
1352                                        "elementData": {
1353                                            "id": "slot_" + myMeetingList[i]?.detailNo,
1354                                            "class": "i_txt_01"
1355                                        }
1356                                    };
1357
1358                                    // 하드코딩 블락
1359                                    if (blockSlotList !== undefined && blockSlotList !== null && blockSlotList.length > 0) {
1360                                        for (let blockSlot of blockSlotList) {
1361                                            // 시간 비교
1362                                            if (ezpmpcommonUtil.commonFunc.isOverlap(myMeetingList[i].meetFrDateTimeFm, myMeetingList[i].meetToDateTimeFm, blockSlot.startTime, blockSlot.endTime)) {
1363                                                itemDivParam.elementData.class.push("m_disabled");
1364                                                blockCheck = true;
1365                                                break;
1366                                            }
1367                                        }
1368                                    }
1369
1370                                    // 리플레시 타임 체크
1371                                    if (refreshStartTime && refreshStartTime) {
1372                                        let checkRefreshStartTime = ezpmpcommonUtil.commonFunc.dateFormat(myMeetingList[i].meetFrDateFm + " " + refreshStartTime, "YYYY-MM-DD HH:mm");
1373                                        let checkRefreshEndTime = ezpmpcommonUtil.commonFunc.dateFormat(myMeetingList[i].meetFrDateFm + " " + refreshEndTime, "YYYY-MM-DD HH:mm");
1374
1375                                        // 시간 비교
1376                                        if (ezpmpcommonUtil.commonFunc.isOverlap(myMeetingList[i].meetFrDateTimeFm, myMeetingList[i].meetToDateTimeFm, checkRefreshStartTime, checkRefreshEndTime)) {
1377                                            itemDivParam.elementData.class.push("m_disabled");
1378                                            refreshCheck = true;
1379                                        }
1380                                    }
1381
1382                                    // statusCd 체크
1383                                    if (!blockCheck && !refreshCheck) {
1384                                        // 미팅 플레이스 시간 확인
1385                                        if (meetingPlaceUseDateList && meetingPlaceUseDateList[my
1385MeetingList[i]?.meetFrDateFm]) {
1386                                            meetingPlaceUseDateList[myMeetingList[i]?.meetFrDateFm].forEach(placeUseInfo => {
1387                                                // 미팅 플레이스 시간 비교
1388                                                if (ezpmpcommonUtil.commonFunc.isOverlap(myMeetingList[i].meetFrDateTimeFm, myMeetingList[i].meetToDateTimeFm, placeUseInfo.meetFrDateTimeFm, placeUseInfo.meetToDateTimeFm)) {
1389                                                    meetingPlaceUseCheck = true;
1390                                                    itemDivParam["elementData"]["data-place-choice-no"] = placeUseInfo.choiceNo;
1391                                                }
1392                                            });
1393                                        }
1394
1395                                        // 해당 일정에 있는 미팅일 경우
1396                                        if (myMeetingList[i]?.detailNo === detailNo) {
1397                                            itemDivParam.elementData.class.push("m_empty");
1398                                            itemDivParam.elementData.class.push("on");
1399
1400                                            callbackParam.meetFrTimeFm = myMeetingList[i]?.meetFrTimeFm;
1401                                            callbackParam.meetToTimeFm = myMeetingList[i]?.meetToTimeFm;
1402
1403                                            // 미팅플레이스 번호를 전달받아서 조회했을 때, 이 날짜를 이미 미팅플레이스가 사용중이라면
1404                                            if (meetingPlaceUseCheck) {
1405                                                callbackParam.meetingPlaceThisTimeUseCheck = false;
1406
1407                                                useCheck = false;
1408                                                itemDivParam.elementData.class.push("m_disabled");
1409                                                itemTextParam.elementData.text = meetingPlaceUseText;
1410                                            }
1411                                            // 신청자가 STS002(확정) 건을 가지고 있을 경우
1412                                        } else if (calendarMeetingList[myMeetingList[i]?.detailNo] && calendarMeetingList[myMeetingList[i]?.detailNo]["STS002"]?.length > 0) {
1413                                            useCheck = false;
1414                                            itemDivParam.elementData.class.push("m_disabled");
1415
1416                                            // 만약 자신이 신청자라면 확정일 경우의 텍스트를 보여줌
1417                                            if (myUserType === MY_CALENDAR_USER_TYPE_APPLICANT) {
1418                                                itemTextParam.elementData.text = confirmedBlockText;
1419                                                // 아니라면 단순 블락 텍스트를 보여줌
1420                                            } else {
1421                                                itemTextParam.elementData.text = blockText;
1422                                            }
1423                                            // 신청자의 스케줄이 블락일 경우
1424                                        } else if (myMeetingList[i]?.schdulStatus === "Y") {
1425                                            useCheck = false;
1426                                            itemDivParam.elementData.class.push("m_disabled");
1427                                            itemTextParam.elementData.text = blockText;
1428                                            // 상담원 정보를 받아왔고, 상담원이 STS002(확정) 건을 가지고 있을 경우
1429                                        } else if (otherMeetingList && otherCalendarMeetingList[otherMeetingList[i]?.detailNo] && otherCalendarMeetingList[otherMeetingList[i]?.detailNo]["STS002"]?.length > 0) {
1430                                            useCheck = false;
1431                                            itemDivParam.elementData.class.push("m_disabled");
1432
1433                                            // 만약 자신이 신청자라면 확정일 경우의 텍스트를 보여줌
1434                                            if (myUserType === MY_CALENDAR_USER_TYPE_COUNSELOR) {
1435                                                itemTextParam.elementData.text = confirmedBlockText;
1436                                                // 아니라면 단순 블락 텍스트를 보여줌
1437                                            } else {
1438                                                itemTextParam.elementData.text = blockText;
1439                                            }
1440                                        } else if (otherMeetingList && otherMeetingList[i]?.schdulStatus === "Y") {
1441                                            useCheck = false;
1442                                            itemDivParam.elementData.class.push("m_disabled");
1443                                            itemTextParam.elementData.text = blockText;
1444                                            // 미팅 플레이스를 사용중일 경우
1445                                        } else if (meetingPlaceUseCheck) {
1446                                            useCheck = false;
1447                                            itemDivParam.elementData.class.push("m_disabled");
1448                                            itemTextParam.elementData.text = meetingPlaceUseText;
1449                                        } else if (previousTimeBlock && ezpmpcommonUtil.commonFunc.isBforeDate(myMeetingList[i]?.meetFrDateTimeFm, nowDateTime)) {
1450                                            useCheck = false;
1451                                            itemDivParam.elementData.class.push("m_disabled");
1452                                            itemTextParam.elementData.text = previousTimeBlockText;
1453                                        } else {
1454                                            itemDivParam.elementData.class.push("m_empty");
1455                                        }
1456                                    } else if (blockCheck) {
1457                                        itemTextParam.elementData.text = blockText;
1458                                    } else if (refreshCheck) {
1459                                        itemTextParam.elementData.text = refreshTimeText;
1460                                    }
1461
1462                                    let itemLi = ezpmpcommonUtil.commonFunc.createElementParam(itemLiParam);
1463                                    let itemDiv = ezpmpcommonUtil.commonFunc.createElementParam(itemDivParam);
1464                                    let itemText = ezpmpcommonUtil.commonFunc.createElementParam(itemTextParam);
1465
1466                                    // 매칭 보유시
1467                                    if (searchStatusArray?.length >
1467 0 && calendarMeetingList[myMeetingList[i]?.detailNo]) {
1468                                        let statusText = "";
1469
1470                                        // STS 코드를 탐색하여 각 몇건이 있는지를 보여줌
1471                                        searchStatusArray.forEach(statusCd => {
1472                                            if (companyNameViewUse && calendarMeetingList[myMeetingList[i]?.detailNo][statusCd]?.length === 1) {
1473                                                let meetCompanyName = "";
1474
1475                                                if (statusText !== "") {
1476                                                    statusText += `<br/>`;
1477                                                }
1478
1479                                                calendarMeetingList[myMeetingList[i]?.detailNo][statusCd][0]?.meetDetailInfoList
1480                                                    .forEach((meetDetailInfo, idx) => {
1481                                                        if (idx === 0 || meetDetailInfo?.lengCd === properties.langCd) {
1482                                                            meetCompanyName = meetDetailInfo?.meetCompanyNm;
1483                                                        }
1484                                                    });
1485
1486                                                statusText += "[" + searchStatus[statusCd] + "] " + meetCompanyName;
1487                                            } else if (calendarMeetingList[myMeetingList[i]?.detailNo][statusCd]?.length > 0) {
1488                                                if (statusText !== "") {
1489                                                    statusText += `<br/>`;
1490                                                }
1491
1492                                                //statusText += "[" + searchStatus[statusCd] + "] " + calendarMeetingList[myMeetingList[i]?.detailNo][statusCd].length + caseText;
1493                                                statusText += searchStatus[statusCd] + " " + calendarMeetingList[myMeetingList[i]?.detailNo][statusCd].length + caseText;
1494                                            }
1495                                        });
1496
1497                                        if (statusText) {
1498                                            itemText.style["font-weight"] = "bold";
1499                                            itemText.style["color"] = "black";
1500                                            itemText.innerHTML = statusText;
1501                                        }
1502                                    }
1503
1504                                    itemDiv.appendChild(itemText);
1505                                    itemLi.appendChild(itemDiv);
1506
1507                                    calendarElements[myMeetingList[i]?.meetFrDate].itemOl.appendChild(itemLi);
1508                                }
1509
1510                                // 시간 작성
1511                                // timeList는 카테고리 정보만 불러오니까, gmt 시간으로 변경하려면 리스트를 새로 만들어서 뿌려줘야 됨
1512                                // 해당 정보는 일정 안의 gmt 타임에 들어있지만 gmt 시간을 따로 요청하지 않았을 경우 null로 받아온다
1513                                // 그러니 우선 일정 정보에서 받아오되, gmt 정보가 없을 경우 timeList에서 카테고리값을 받아와서 뿌려주도록 한다
1514                                if (myMeetingList && myMeetingList?.length >= timeList?.length) {
1515                                    for (let i = 0; i < timeList.length; i++) {
1516                                        const timeInfo = myMeetingList[i];
1517                                        let timeText = timeInfo?.meetFrTimeFm + " ~ " + timeInfo?.meetToTimeFm;
1518                                        let timeElementParam = {
1519                                            "elementType": "div",
1520                                            "elementData": {
1521                                                "text": timeText
1522                                            }
1523                                        };
1524                                        let timeElement = ezpmpcommonUtil.commonFunc.createElementParam(timeElementParam);
1525
1526                                        if (myMeetingList[0]?.meetFrTimeGmtFm && myMeetingList[0]?.meetToTimeGmtFm) {
1527                                            let timeGmtText = "(" + timeInfo?.meetFrTimeGmtFm + " ~ " + timeInfo?.meetToTimeGmtFm + ")";
1528
1529                                            timeElement.innerHTML += `<br/>`;
1530                                            timeElement.innerHTML += timeGmtText;
1531                                        }
1532
1533                                        startTimeListHTML.append(timeElement);
1534                                    }
1535                                }
1536
1537                                // 일정 작성
1538                                schdulList.forEach(schdul => {
1539                                    let schdulLiParam = {
1540                                        "elementType": "li",
1541                                        "elementData": {}
1542                                    };
1543                                    let schdulLi = ezpmpcommonUtil.commonFunc.createElementParam(schdulLiParam);
1544
1545                                    schdulLi.append(calendarElements[schdul?.schdulDt].dateDiv);
1546                                    schdulLi.append(calendarElements[schdul?.schdulDt].itemOl);
1547
1548                                    scheduleListHTML.append(schdulLi);
1549                                });
1550                            }
1551
1552                            // callback
1553                            callbackFunction(callbackParam);
1554                            // 실패
1555                        } else if (apiResponseCode === RESPONSVALUE.FAIL) {
1556                            failFunction(apiResponseCode);
1557                            ezpmpcommonUtil.log.log("createCalendar", "api 요청 실패");
1558                            // 그 외
1559                        } else {
1560                            failFunction(apiResponseCode);
1561                            ezpmpcommonUtil.log.log("createCalendar", "api 요청 실패");
1562                        }
1563                    }
1564                }
1565                // fail function
1566                const apiFail = (returnValue) => {
1567                    failFunction(RESPONSVALUE.FAIL);
1568                    ezpmpcommonUtil.log.log("createCalendar", "api 요청 실패");
1569                }
1570                // error function
1571                const apiError = (returnValue) => {
1572                    $.unblockUI();
1573                    failFunction(RESPONSVALUE.ERROR);
1574                    ezpmpcommonUtil.log.log("createCalendar", "api 요청 실패");
1575                }
1576
1577                // multiCallApi
1578                // api 전부 호출 후 콜백함수 실행
1579                // axios list, callback(success), callback(fail), blockUI 유무(boolean)
1580                ezpmpcommonUtil.apiCall.multCallApi(apiList, apiSuccess, apiFail, apiError, false);
1581            });
1582        } catch(e) {
1583            ezpmpcommonUtil.log.log("createCalendar", "일정 불러오기 실패");
1584        }
1585    }
1586
1587    /**
1588     * 현재 날짜에 비즈매칭을 진행할 건지 확인하여 결과에 따라 전달받은 function 실행
1589     * @param commonCode
1590     * @param callbackFunction
1591     * @param failFunction
1592     */
1593    bizmatchUseDateCheck(commonCode, callbackFunction = () => {}, failFunction = () => {}) {
1594        // 비즈매칭을 실행할지 여부
1595        let bizmatchUseCheck = false;
1596        // 비즈매칭 실행 날짜 모음
1597        // key가 공통코드일 경우: 해당하는 기업은 startDate 및 endDate동안 비즈매칭이 가능하다
1598        // key가 free일 경우: 위 기간과 관계없이 비즈매칭이 가능하다
1599        let bizmatchUseDate = {
1600            "KTF": {
1601                "110055": {
1602                    "MAG001": {
1603                        "startDate": "2024-05-06",
1604                        "endDate": "2024-05-19"
1605                    },
1606                    "MAG002": {
1607                        "startDate": "2024-05-06",
1608                        "endDate": "2024-05-19"
1609                    },
1610                    "MAG003": {
1611                        "startDate": "2024-05-06",
1612                        "endDate": "2024-05-19"
1613                    },
1614                    "free": {
1615                        "startDate": "2024-05-20",
1616                        "endDate": "2024-05-24"
1617                    },
1618                    "other": {
1619                        "startDate": "2024-05-25",
1620                        "endDate": "2024-12-31"
1621                    }
1622                }
1623            }
1624        };
1625        let nowDate = ezpmpcommonUtil.commonFunc.baseDateFormat(new Date(), "YYYY-MM-DD");
1626        let freeCheck = false;
1627
1628        if (!!bizmatchUseDate[properties.projectCd] && !!bizmatchUseDate[properties.projectCd][properties.siteId]) {
1629            // 시간 비교
1630            // 비교 후 기간 내라면 bizmatchUseCheck를 true로 바꾼다
1631            const useDateCheckFunction = (nowDate, startDate, endDate) => {
1632                // 시작일과의 비교
1633                let startDateDiff = ezpmpcommonUtil.commonFunc.diffDay(nowDate, startDate);
1634                // 종료일과의 비교
1635                let endDateDiff = ezpmpcommonUtil.commonFunc.diffDay(nowDate, endDate);
1636                // 날짜 비교
1637                // 시작일에서 종료일 사이에 포함이 된다면
1638                if (startDateDiff >= 0 && endDateDiff <= 0) {
1639                    // 비즈매칭을 실행
1640                    bizmatchUseCheck = true;
1641                }
1642            }
1643            let thisSiteBizmatchUseDate = bizmatchUseDate[properties.projectCd][properties.siteId];
1644
1645            // 자유 기간 확인
1646            if (!!thisSiteBizmatchUseDate.free
1647                && !!thisSiteBizmatchUseDate.free.startDate
1648                && !!thisSiteBizmatchUseDate.free.endDate) {
1649                useDateCheckFunction(nowDate, thisSiteBizmatchUseDate.free.startDate, thisSiteBizmatchUseDate.free.endDate);
1650                freeCheck = true;
1651            }
1652
1653            // 해당하는 기업 유형이 있는지 확인
1654            if (!bizmatchUseCheck
1655                && !!thisSiteBizmatchUseDate[commonCode]
1656                && !!thisSiteBizmatchUseDate[commonCode].startDate
1657                && !!thisSiteBizmatchUseDate[commonCode].endDate) {
1658                useDateCheckFunction(nowDate, thisSiteBizmatchUseDate[commonCode].startDate, thisSiteBizmatchUseDate[commonCode].endDate);
1659            }
1660        }
1661
1662        // bizmatchUseCheck이 true라면 callbackFunction을 실행
1663        if (bizmatchUseCheck) {
1664            callbackFunction(freeCheck);
1665            // bizmatchUseCheck이 false라면 failFunction을 실행
1666        } else {
1667            failFunction();
1668        }
1669    }
1670
1671    /**
1672     * 미팅플레이스 등록
1673     * @param companyNo 기업 번호
1674     * @param meetingPlaceType 미팅플레이스 유형 - ex) BTC001 (온라인 상담)
1675     * @param meetingPlaceName 미팅플레이스 이름
1676     * @param callbackFunction 콜백 함수
1677     * @param schdulNo 스케줄 번호
1678     * @param oneToManyFlag 기업당 미팅플레이스 일대다 여부 (false: 1기업당 1미팅 플레이스, true: 1기업당 여러개의 미팅 플레이스)
1679     */
1680    createMeetingPlace(companyNo, meetingPlaceType, meetingPlaceName, callbackFunction = () => {}, schdulNo = 0, oneToManyFlag = false) {
1681        try {
1682            let apiParam = {
1683                "projectCd": properties.projectCd,
1684                "siteId": properties.siteId,
1685                "oneToManyFlag": oneToManyFlag,
1686                "companyNo": companyNo,
1687                "placeType": meetingPlaceType,
1688                "schdulNo": schdulNo,
1689                "meetingTm": "2024-01-01",
1690                "startDt": "2024-01-01",
1691                "startTm": "01:00",
1692                "endDt": "2099-01-01",
1693                "endTm": "23:00",
1694                "refreshTm": "2099-01-01",
1695                "useYn": "Y",
1696                "meetingPlaceDetailList": [
1697                    {
1698                        "placeNm": meetingPlaceName,
1699                        "companyNo": companyNo,
1700                        "timeslotCount": 0,
1701                        "useYn": "Y"
1702                    }
1703                ]
1704            };
1705
1706            ezpmpcommonUtil.apiCall.callApi(apiUrls.consultApi + "/meeting-place/post", HTTPMETHOD.POST, apiParam, function(returnValue) {
1707                if (!!returnValue) {
1708                    // 응답 성공
1709                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
1710                        alert("등록이 완료되었습니다.");
1711                        Layer_CLOSE('#popupMeetingPlace');
1712                        // 응답 실패
1713                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
1714                        ezpmpcommonUtil.log.log("log text", "요청 실패");
1715                        // 그 외
1716                    } else {
1717                        const { detailMessage } = returnValue.responseData;
1718
1719                        if (detailMessage !== undefined && detailMessage !== null) {
1720                            // 비즈매칭 에러 코드에 따른 분기 처리
1721                            switch (detailMessage) {
1722                                case "BIZ027":
1723                                    alert("이미 미팅플레이스를 가지고 있는 기업입니다.");
1724                                    break;
1725                                default:
1726                                    alert("등록에 실패했습니다.\n다시 시도해주세요.");
1727                                    break;
1728                            }
1729                        }
1730                        ezpmpcommonUtil.log.log("log text", "요청 실패");
1731                    }
1732                }
1733            }, null, false);
1734        } catch(e) {
1735            ezpmpcommonUtil.log.log("log text", "요청 실패");
1736        }
1737    }
1738
1739    /**
1740     * 미팅플레이스 멀티 등록
1741     * @param meetingPlaceDataList
1742     * companyNo 기업 번호
1743     * meetingPlaceType 미팅플레이스 유형 - ex) BTC001 (온라인 상담)
1744     * meetingPlaceName 미팅플레이스 이름
1745     * schdulNo 스케줄 번호
1746     * oneToManyFlag 기업당 미팅플레이스 일대다 여부 (false: 1기업당 1미팅 플레이스, true: 1기업당 여러개의 미팅 플레이스)
1747     * publicYn 공용 미팅 플레이스 여부
1748     * @param callbackFunction 콜백 함수
1749     * @param failFunction 실패했을 경우 호출 함수
1750     */
1751    createMultiMeetingPlace(meetingPlaceDataList, callbackFunction = () => {}, failFunction = () => {}) {
1752        try {
1753            let apiList = meetingPlaceDataList.map(meetingPlaceData => {
1754                let apiParam = {
1755                    "projectCd": properties.projectCd,
1756                    "siteId": properties.siteId,
1757                    "oneToManyFlag": meetingPlaceData?.oneToManyFlag ?? false,
1758                    "companyNo": meetingPlaceData?.companyNo ?? null,
1759                    "placeType": meetingPlaceData?.meetingPlaceType ?? "BTC003",
1760                    "schdulNo": meetingPlaceData?.schdulNo ?? 0,
1761                    "meetingTm": "2024-01-01",
1762                    "startDt": "2024-01-01",
1763                    "startTm": "01:00",
1764                    "endDt": "2099-01-01",
1765                    "endTm": "23:00",
1766                    "refreshTm": "2099-01-01",
1767                    "useYn": "Y",
1768                    "meetingPlaceDetailList": [
1769                        {
1770                            "placeNm": meetingPlaceData?.meetingPlaceName ?? "",
1771                            "companyNo": meetingPlaceData?.companyNo ?? null,
1772                            "timeslotCount": 0,
1773                            "useYn": "Y",
1774                            "publicYn": meetingPlaceData?.publicYn ?? "Y"
1775                        }
1776                    ]
1777                };
1778
1779                return ezpmpcommonUtil.apiCall.callApiAxiosAsync(APICALLURL.consultingApi + "/meeting-place/post", HTTPMETHOD.POST, apiParam);
1780            });
1781
1782            const apiSuccess = (returnValueList) => {
1783                let successDataList = [];
1784                let failDataList = [];
1785
1786                returnValueList.forEach((returnValue, idx) => {
1787                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
1788                        successDataList.push(meetingPlaceDataList[idx]);
1789                    } else {
1790                        failDataList.push(meetingPlaceDataList[idx]);
1791                    }
1792                });
1793
1794                callbackFunction({
1795                    successDataList: successDataList,
1796                    failDataList: failDataList,
1797                    returnValueList: returnValueList
1798                });
1799            };
1800
1801            const apiFail = (returnValue) => {
1802                failFunction(returnValue);
1803                ezpmpcommonUtil.log.log("log text", "요청 실패");
1804            }
1805
1806            const apiError = (returnValue) => {
1807                failFunction(returnValue);
1808                ezpmpcommonUtil.log.log("log text", "요청 실패");
1809            }
1810
1811            ezpmpcommonUtil.apiCall.multCallApi(apiList, apiSuccess, apiFail, apiError, false);
1812        } catch(e) {
1813            ezpmpcommonUtil.log.log("log text", "요청 실패");
1814        }
1815    }
1816
1817    /**
1818     * 미팅 플레이스 조회
1819     * @param params 파라미터 목록
1820     * page 페이지 번호
1821     * size 페이지당 조회 수
1822     * meetingPlaceNo 미팅 플레이스 번호
1823     * useYn 사용 여부
1824     * delYn 삭제 여부
1825     * placeType 상담 유형
1826     * userPartCd 기업 유형
1827     * searchType 검색 유형 (SRC001: 기업명, SRC002: 미팅플레이스명, SRC003: 그룹명)
1828     * searchWord 검색 단어
1829     * publicYn 공용 미팅 플레이스 여부 (Y: 공용, N: 기업별)
1830     * @param callbackFunction 성공시 호출 함수
1831     * @param failFunction 실패시 호출 함수
1832     */
1833    loadMeetingPlaceList(params, callbackFunction = () => {}, failFunction = () => {}) {
1834        try {
1835            const {
1836                page = 0,
1837                size = 10,
1838                meetingPlaceNo = null,
1839                useYn = "Y",
1840                delYn = "N",
1841                placeType = null,
1842                userPartCd = "",
1843                searchType = "",
1844                searchWord = "",
1845                publicYn = "Y",
1846                choiceNo = null,
1847                companyNo = null
1848            } = params;
1849            const apiParam = {
1850                projectCd: properties.projectCd,
1851                siteId: properties.siteId,
1852                page: page,
1853                size: size,
1854                meetingPlaceNo: meetingPlaceNo,
1855                useYn: useYn,
1856                delYn: delYn,
1857                placeType: placeType,
1858                userPartCd: userPartCd,
1859                searchType: searchType,
1860                searchWord: searchWord,
1861                publicYn: publicYn,
1862                choiceNo: choiceNo,
1863                companyNo: companyNo
1864            }
1865
1866            ezpmpcommonUtil.apiCall.callApi(apiUrls.consultApi + "/meeting-place/get", HTTPMETHOD.POST, apiParam, function (returnValue) {
1867                if (!!returnValue) {
1868                    // 응답 성공
1869                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
1870                        callbackFunction(returnValue.responseData);
1871                        // 응답 실패
1872                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
1873                        failFunction(returnValue);
1874                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1875                        // 그 외
1876                    } else {
1877                        failFunction(returnValue);
1878                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1879                    }
1880                }
1881            }, null, false);
1882        } catch (e) {
1883            ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1884        }
1885    }
1886
1887    /**
1888     * 미팅 정보를 미팅 플레이스에 등록
1889     *
1890     * 주로 상담 확정시 사용
1891     *
1892     * api 동작 구조
1893     * - 확정된 상담을 미팅 플레이스에 등록
1894     * - 이미 배정이 되었다거나, 모종의 이유로 실패 시 전달된 statusCd로 변경 (이때, 보낸 statusCd가 없다면 STS001로 변경됨)
1895     * @param meetingPlaceDetailNo
1896     * @param choiceNo
1897     * @param companyNo
1898     * @param cnslCompanyNo
1899     * @param reverse
1900     * @param statusCd
1901     * @param finalMsgNo
1902     * @param callback
1903     * @param fail
1904     */
1905    postMeetingPlaceMeetingData(meetingPlaceDetailNo, choiceNo, companyNo, cnslCompanyNo, reverse = false, statusCd = "ST
1905S001", finalMsgNo = null, callback = () => {}, fail = () => {}) {
1906        try {
1907            const apiParam = {
1908                projectCd: properties.projectCd,
1909                siteId: properties.siteId,
1910                meetingPlaceDetailNo: meetingPlaceDetailNo,
1911                choiceNo: choiceNo,
1912                companyNo: reverse ? cnslCompanyNo : companyNo,
1913                cnslCompanyNo: reverse ? companyNo : cnslCompanyNo,
1914                statusCd: statusCd,
1915                finalMsgNo: finalMsgNo,
1916                flag: "N"
1917            };
1918
1919            ezpmpcommonUtil.apiCall.callApi(apiUrls.consultApi + "/meeting-place/detail-sub/post", HTTPMETHOD.POST, apiParam, function (returnValue) {
1920                if (!!returnValue) {
1921                    // 응답 성공
1922                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
1923                        callback(returnValue);
1924                        // 응답 실패
1925                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
1926                        fail(returnValue);
1927                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1928                        // 그 외
1929                    } else {
1930                        fail(returnValue);
1931                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1932                    }
1933                }
1934            }, null, false);
1935        } catch (e) {
1936            ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1937        }
1938    }
1939
1940    /**
1941     * 미팅 플레이스에 등록된 미팅 정보를 삭제
1942     * @param detailSubNoList
1943     * @param callbackFunction
1944     * @param failFunction
1945     */
1946    cancelMeetingPlaceMeetingData(detailSubNoList, callbackFunction = () => {}, failFunction = () => {}) {
1947        try {
1948            if (!detailSubNoList || (Array.isArray(detailSubNoList) && detailSubNoList.length == 0)) {
1949                ezpmpcommonUtil.log.log("cancelMeetingPlaceMeetingData", "detailSubNoList 값이 없음");
1950                return;
1951            }
1952
1953            const apiParam = {
1954                projectCd: properties.projectCd,
1955                siteId: properties.siteId,
1956                detailSubNoList: Array.isArray(detailSubNoList) ? detailSubNoList : [detailSubNoList]
1957            };
1958
1959            ezpmpcommonUtil.apiCall.callApi(apiUrls.consultApi + "/meeting-place/detail-sub/delete", HTTPMETHOD.POST, apiParam, function (returnValue) {
1960                if (!!returnValue) {
1961                    // 응답 성공
1962                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
1963                        callbackFunction(returnValue);
1964                        // 응답 실패
1965                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
1966                        failFunction(returnValue);
1967                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1968                        // 그 외
1969                    } else {
1970                        failFunction(returnValue);
1971                        ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1972                    }
1973                }
1974            }, null, false);
1975        } catch (e) {
1976            failFunction();
1977            ezpmpcommonUtil.log.log("loadMeetingPlaceList", "요청 실패");
1978        }
1979    }
1980
1981    /**
1982     * 배정될 미팅 플레이스 탐색
1983     * meetingPlaceNo 또는 companyNo를 받지 않았다면 choiceNo를 통해서 탐색을 진행
1984     * @param params
1985     * @param findSuccess
1986     * @param findFail
1987     * @param apiFail
1988     */
1989    /*searchUseMeetingPlace(params, findSuccess = () => {}, findFail = () => {}, apiFail = () => {}) {
1990        // params
1991        let {
1992            meetingPlaceNo,
1993            placeType = "BTC003",
1994            choiceNo,
1995            companyNo,
1996        } = params;
1997
1998        // 미팅 플레이스 번호 또는 기업 번호를 받았을 경우
1999        if (meetingPlaceNo || companyNo) {
2000            let loadParam = {
2001                page: 0,
2002                size: 1,
2003                meetingPlaceNo,
2004                placeType,
2005                companyNo
2006            };
2007            // 조회 성공
2008            let loadSuccess = (placeData) => {
2009                const { list } = placeData;
2010
2011                // 미팅 플레이스 정보를 정리
2012                if (list && list.length > 0 && list[0].meetingPlaceDetailList && list[0].meetingPlaceDetailList.length > 0) {
2013                    let meetingPlaceNo = list[0].meetingPlaceNo;
2014                    let meetingPlaceDetailNo = list[0].meetingPlaceDetailList[0].detailNo;
2015
2016                    findSuccess({
2017                        meetingPlaceNo: meetingPlaceNo,
2018                        meetingPlaceDetailNo: meetingPlaceDetailNo
2019                    });
2020                // 온라인 및 오프라인 상담장이 조회되지 않는다면, 온/오프라인 타입을 한번 더 조회
2021                } else if (placeType === "BTC001" || placeType === "BTC002") {
2022                    params.placeType = "BTC003";
2023
2024                    this.searchUseMeetingPlace(params, findSuccess, findFail, api
2024Fail);
2025                // 미팅 플레이스 조회가 되지 않는다면, choiceNo를 통해서 /empty-place/get API를 호출
2026                } else {
2027                    this.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2028                }
2029            };
2030            // 조회 실패
2031            let loadFail = () => {
2032                this.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2033            };
2034
2035            // 미팅 플레이스 탐색
2036            this.loadMeetingPlaceList(loadParam, loadSuccess, loadFail);
2037        } else if (choiceNo) {
2038            ezpmpcommonUtil.commonFunc.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2039        } else {
2040            ezpmpcommonUtil.log.log("searchUseMeetingPlace", "탐색에 필요한 params 정보 없음");
2041            findFail();
2042        }
2043    }*/
2044
2045
2046    /**
2047     * 배정될 미팅 플레이스 탐색
2048     * meetingPlaceNo 또는 companyNo를 받지 않았다면 choiceNo를 통해서 탐색을 진행
2049     * @param params
2050     * @param findSuccess
2051     * @param findFail
2052     * @param apiFail
2053     */
2054    searchUseMeetingPlace(params, findSuccess = () => {}, findFail = () => {}, apiFail = () => {}) {
2055        let {
2056            choiceNo,
2057            companyNo,
2058            cnslCompanyNo,
2059            placeType = "BTC003",
2060            startDate = new Date(),
2061            endDate = new Date(),
2062            offlineCategory,
2063            onlineCategory
2064        } = params;
2065        let checkStartDate = ezpmpcommonUtil.commonFunc.dateFormat(startDate, "YYYY-MM-DD HH:mm");
2066        let checkEndDate = ezpmpcommonUtil.commonFunc.dateFormat(endDate, "YYYY-MM-DD HH:mm");
2067        let reverse = false;
2068
2069        let loadParam = {
2070            page: 0,
2071            size: 9999,
2072            placeType
2073        };
2074
2075        // 기업 번호를 받아왔을 경우
2076        if (offlineCategory !== "BPC001" && (companyNo || cnslCompanyNo)) {
2077            // 조회 성공
2078            let loadSuccess = (placeData) => {
2079                let { list } = placeData;
2080                let placeList = [];
2081
2082                if (list?.length > 0) {
2083                    // 기업 번호와 일치하는 정보 가져오기
2084                    placeList = list.filter(placeData => {
2085                        let { meetingPlaceDetailList } = placeData;
2086                        let placeCompanyNo = meetingPlaceDetailList?.[0]?.companyNo;
2087
2088                        // 기업 정보가 일치하는 미팅 정보만 불러온다
2089                        return placeCompanyNo && (placeCompanyNo == companyNo || placeCompanyNo == cnslCompanyNo) && (placeData.placeType === placeType || placeData.placeType === "BTC003");
2090                    }).filter(placeData => {
2091                        let { meetingPlaceDetailSubList } = placeData.meetingPlaceDetailList[0];
2092
2093                        // 배정된 시간이 있다면, 상담장의 시간들이 사용 가능한지 확인
2094                        if (meetingPlaceDetailSubList?.length > 0) {
2095                            for (let placeDetailSub of meetingPlaceDetailSubList) {
2096                                if (ezpmpcommonUtil.commonFunc.isOverlap(placeDetailSub.meetFrDateTimeFm, placeDetailSub.meetToDateTimeFm, checkStartDate, checkEndDate)) {
2097                                    return false;
2098                                }
2099                            }
2100                        }
2101
2102                        return true;
2103                    });
2104                }
2105
2106                // 기업 상담장 우선 배정
2107                if (placeList?.length > 0) {
2108                    // 만약 리스트가 두개 이상이라면 정렬
2109                    if (placeList.length > 1) {
2110                        let placeTemp;
2111
2112                        for (let i = 0; i < placeList.length - 1; i++) {
2113                            for (let j = 0; j < placeList.length - 1 - i; j++) {
2114                                const PRIORITY_COMPANY_NO = 3;
2115                                const PRIORITY_CNSL_COMPANY_NO = 2;
2116                                const PRIORITY_DEFAULT = 1;
2117
2118                                let priority1 = PRIORITY_DEFAULT;
2119                                let priority2 = PRIORITY_DEFAULT;
2120
2121                                switch (placeList[j].meetingPlaceDetailList[0].companyNo) {
2122                                    case companyNo:
2123                                        priority1 = PRIORITY_COMPANY_NO;
2124                                        break;
2125                                    case cnslCompanyNo:
2126                                        priority1 = PRIORITY_CNSL_COMPANY_NO;
2127                                        break;
2128                                }
2129                                switch (placeList[j + 1].meetingPlaceDetailList[0].companyNo) {
2130                                    case companyNo:
2131                                        priority2 = PRIORITY_COMPANY_NO;
2132                                        break;
2133                                    case cnslCompanyNo:
2134                                        priority2 = PRIORITY_CNSL_COMPANY_NO;
2135                                        break;
2136                                }
2137
2138                                if (priority1 < priority2) {
2139                                    placeTemp        = placeList[j];
2140                                    placeList[j]     = placeList[j + 1];
2141                                    placeList[j + 1] = placeTemp;
2142                                }
2143                            }
2144                        }
2145                    }
2146
2147                    let meetingPlaceNo = placeList[0].meetingPlaceNo;
2148                    let meetingPlaceDetailNo = placeList[0].meetingPlaceDetailList[0].detailNo;
2149
2150                    if (placeList[0].meetingPlaceDetailList[0].companyNo == cnslCompanyNo) {
2151                        reverse = true;
2152                    }
2153
2154                    findSuccess({
2155                        meetingPlaceNo: meetingPlaceNo,
2156                        meetingPlaceDetailNo: meetingPlaceDetailNo,
2157                        reverse: reverse
2158                    });
2159                    // 기업 상담장이 없으면 공용 상담장 배정
2160                } else if (offlineCategory !== "BPC002") {
2161                    this.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2162                } else {
2163                    ezpmpcommonUtil.log.log("searchUseMeetingPlace", "배정 가능한 기업 상담장 없음");
2164                    findFail();
2165                }
2166            };
2167            // 조회 실패
2168            let loadFail = () => {
2169                this.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2170            };
2171
2172            // 미팅 플레이스 탐색
2173            this.loadMeetingPlaceList(loadParam, loadSuccess, loadFail);
2174            // 기업 상담장만 검색하는 경우
2175        } else if (offlineCategory === "BPC002") {
2176            ezpmpcommonUtil.log.log("searchUseMeetingPlace", "배정 가능한 기업 상담장 없음");
2177            findFail();
2178            // 공용 상담장 검색
2179        } else if (choiceNo) {
2180            ezpmpcommonUtil.commonFunc.searchEmptyMeetingPlace(choiceNo, placeType, findSuccess, findFail, apiFail);
2181        } else {
2182            ezpmpcommonUtil.log.log("searchUseMeetingPlace", "탐색에 필요한 params 정보 없음");
2183            findFail();
2184        }
2185    }
2186
2187    /**
2188     * 비어있는 미팅 플레이스 탐색
2189     * @param choiceNo 미팅 번호
2190     * @param placeType 상담 유형
2191     * @param findSuccess 비어있는 장소 탐색 성공
2192     * @param findFail 비어있는 장소가 없을 경우
2193     * @param apiFail api 연결 실패
2194     */
2195    searchEmptyMeetingPlace(choiceNo, placeType, findSuccess = () => {}, findFail = () => {}, apiFail = () => {}) {
2196        try {
2197            const apiParam = {
2198                projectCd: properties.projectCd,
2199                siteId: properties.siteId,
2200                choiceNo: choiceNo,
2201                placeType: placeType
2202            };
2203
2204            ezpmpcommonUtil.apiCall.callApi(apiUrls.consultApi + "/meeting-place/empty-place/get", HTTPMETHOD.POST, apiParam, function (returnValue) {
2205                if (!!returnValue) {
2206                    // 응답 성공
2207                    if (returnValue.responseCode === RESPONSVALUE.SUCCESS) {
2208
2209                        const { meetingPlaceNo, meetingPlaceDetailNo } = returnValue.responseData;
2210
2211                        // 비어있는 미팅 플레이스가 있을 경우
2212                        if (meetingPlaceNo && meetingPlaceDetailNo) {
2213                            findSuccess({
2214                                meetingPlaceNo: meetingPlaceNo,
2215                                meetingPlaceDetailNo: meetingPlaceDetailNo
2216                            });
2217                            // 비어있는 미팅 플레이스가 없을 경우
2218                        } else {
2219                            findFail();
2220                        }
2221                        // 응답 실패
2222                    } else if (returnValue.responseCode === RESPONSVALUE.FAIL) {
2223                        apiFail(returnValue);
2224                        ezpmpcommonUtil.log.log("searchEmptyMeetingPlace", "요청 실패");
2225                        // 그 외
2226                    } else {
2227                        apiFail(returnValue);
2228                        ezpmpcommonUtil.log.log("searchEmptyMeetingPlace", "요청 실패");
2229                    }
2230                }
2231            }, null, false);
2232        } catch (e) {
2233            apiFail(e);
2234            ezpmpcommonUtil.log.log("searchEmptyMeetingPlace", "요청 실패");
2235        }
2236    }
2237}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.