Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/eactive/workspaces/eapim-bundle/bundles/251021/eapim-admin_incremental_2025-09-12.bundle into jenkins_with_weblogic
This commit is contained in:
@@ -71,6 +71,7 @@ public class MonitoringFrontFilter implements Filter {
|
||||
|| uri.indexOf(request.getContextPath() +"/LoginServlet") > -1
|
||||
|| uri.indexOf(request.getContextPath() +"/login/") > -1
|
||||
|| uri.indexOf(request.getContextPath() +"/dashboard") > -1
|
||||
|| uri.indexOf(request.getContextPath() +"/dashmain3.do") > -1
|
||||
|| uri.indexOf(request.getContextPath() + "/loginForm.do") > -1
|
||||
|| uri.indexOf(request.getContextPath() + "/login.do") > -1
|
||||
|| uri.indexOf(request.getContextPath() + "/ssoLogin.do") > -1
|
||||
|
||||
+14
@@ -35,6 +35,20 @@ public class MonitoringPropertyService
|
||||
return property.map(MonitoringProperty::getPrpty2Val).orElse(null);
|
||||
}
|
||||
|
||||
public String getPropertyValue(String prptyGroupName, String prptyName, String defaultValue) {
|
||||
MonitoringPropertyId id = new MonitoringPropertyId();
|
||||
id.setPrptyGroupName(prptyGroupName);
|
||||
id.setPrptyName(prptyName);
|
||||
|
||||
Optional<MonitoringProperty> property = repository.findById(id);
|
||||
if (property.isPresent() && !property.get().getPrpty2Val().isEmpty()) {
|
||||
return property.get().getPrpty2Val();
|
||||
} else {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Iterable<MonitoringProperty> findAllByIdPrptyName(String prptyName) {
|
||||
BooleanExpression predicate = QMonitoringProperty.monitoringProperty.id.prptyName.eq(prptyName);
|
||||
return repository.findAll(predicate);
|
||||
|
||||
+4
-2
@@ -7,6 +7,7 @@ import com.eactive.apim.portal.approval.entity.Approval;
|
||||
import com.eactive.apim.portal.approval.service.ApprovalDeployException;
|
||||
import com.eactive.apim.portal.approval.statemachine.listener.ApprovalListener;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||
import com.eactive.apim.portal.template.service.MessageSendService;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
@@ -97,7 +98,6 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
|
||||
@Override
|
||||
public void execute(Approval approval, Map<String, Object> option1) throws ApprovalDeployException {
|
||||
|
||||
Optional<AppRequest> optRequest = appRequestRepository.findAppRequestByApproval(approval);
|
||||
|
||||
AppRequest appRequest = optRequest.orElseGet(null);
|
||||
@@ -135,7 +135,8 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
recipient.setUserId(appRequest.getApproval().getRequester().getEmailAddr());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("apiKey", appRequest.getClientName());
|
||||
messageSendService.sendMessage("APP_REGISTER_APPROVED", recipient, params);
|
||||
// messageSendService.sendMessage("APP_REGISTER_APPROVED", recipient, params);
|
||||
messageSendService.sendMessage(MessageCode.APP_REGISTER_APPROVED, recipient, params);
|
||||
}
|
||||
|
||||
private String determineAction(AppRequestType type) {
|
||||
@@ -159,6 +160,7 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
}
|
||||
|
||||
private void syncTargetServer(String server, String action, CredentialUI credentialUI) throws ApprovalDeployException {
|
||||
//TODO: Proxy 제거 작업 필요
|
||||
|
||||
// 프록시를 통한 스테이징 서버 호출 추가
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
|
||||
+42
-34
@@ -9,6 +9,7 @@ import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.OrgStatus;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||
import com.eactive.apim.portal.template.service.MessageSendService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService;
|
||||
@@ -87,7 +88,7 @@ public class PortalUserApprovalListener implements ApprovalListener {
|
||||
portalOrg.setOrgStatus(OrgStatus.ACTIVE);
|
||||
portalOrgService.save(portalOrg);
|
||||
|
||||
syncStaging(portalOrgUIMapper.toVo(portalOrg));
|
||||
// syncStaging(portalOrgUIMapper.toVo(portalOrg));
|
||||
sendApprovalResult(portalUser);
|
||||
}
|
||||
|
||||
@@ -96,42 +97,49 @@ public class PortalUserApprovalListener implements ApprovalListener {
|
||||
recipient.setPhone(portalUser.getMobileNumber());
|
||||
recipient.setUserId(portalUser.getEmailAddr());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
messageSendService.sendMessage("USER_REGISTER_APPROVED", recipient, params);
|
||||
messageSendService.sendMessage(MessageCode.MANAGER_WITH_ORG_REGISTER_APPROVED, recipient, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 광주은행에서는 사용하지 않음. (개발/운영 완전 분리)
|
||||
* @param portalOrgUI
|
||||
* @throws ApprovalDeployException
|
||||
*/
|
||||
private void syncStaging(PortalOrgUI portalOrgUI) throws ApprovalDeployException {
|
||||
// 프록시를 통한 스테이징 서버 호출 추가
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
String apiKey = properties.get("apiKey");
|
||||
String proxyUrl = properties.get("portal.url");
|
||||
String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000");
|
||||
String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json";
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.set("X-API-KEY", apiKey);
|
||||
headers.set("target_host", "stg");
|
||||
headers.set("action", "insert");
|
||||
|
||||
portalOrgUI.setCompRegFile(null);
|
||||
HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers);
|
||||
|
||||
try {
|
||||
ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange(
|
||||
proxyEndpoint,
|
||||
HttpMethod.POST,
|
||||
request,
|
||||
String.class
|
||||
);
|
||||
|
||||
if (!response.getStatusCode().is2xxSuccessful()) {
|
||||
logger.error("Failed to sync with staging server. Status: {}, Body: {}", response.getStatusCode(), response.getBody());
|
||||
throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to sync with staging server. {}", e.getMessage());
|
||||
throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
|
||||
}
|
||||
throw new RuntimeException("Unable use this method(syncStaging())");
|
||||
|
||||
// // 프록시를 통한 스테이징 서버 호출 추가
|
||||
// Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
// String apiKey = properties.get("apiKey");
|
||||
// String proxyUrl = properties.get("portal.url");
|
||||
// String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000");
|
||||
// String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json";
|
||||
//
|
||||
// HttpHeaders headers = new HttpHeaders();
|
||||
// headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
// headers.set("X-API-KEY", apiKey);
|
||||
// headers.set("target_host", "stg");
|
||||
// headers.set("action", "insert");
|
||||
//
|
||||
// portalOrgUI.setCompRegFile(null);
|
||||
// HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers);
|
||||
//
|
||||
// try {
|
||||
// ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange(
|
||||
// proxyEndpoint,
|
||||
// HttpMethod.POST,
|
||||
// request,
|
||||
// String.class
|
||||
// );
|
||||
//
|
||||
// if (!response.getStatusCode().is2xxSuccessful()) {
|
||||
// logger.error("Failed to sync with staging server. Status: {}, Body: {}", response.getStatusCode(), response.getBody());
|
||||
// throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// logger.error("Failed to sync with staging server. {}", e.getMessage());
|
||||
// throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.eactive.eai.rms.onl.apim.template;
|
||||
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.entity.MessageTemplate;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.template.MessageTemplateSearch;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.eactive.eai.custom.kjb.common.spring;
|
||||
package com.eactive.ext.kjb.spring;
|
||||
|
||||
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.eactive.ext.kjb.ums;
|
||||
|
||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Service
|
||||
@Transactional(transactionManager = "transactionManagerForEMS")
|
||||
@Slf4j
|
||||
public class KjbUmsService extends BaseService {
|
||||
public static final String PROP_GORUP_ID = "Monitoring";
|
||||
public static final String PROP_EAI_BATCH_URL = "kjb.ums.eai_batch.url";
|
||||
public static final String PROP_EAI_BATCH_SEND_DIR = "kjb.ums.eai_batch.send_dir";
|
||||
|
||||
|
||||
private final KjbSafedbWrapper kjbSafedbWrapper;
|
||||
|
||||
private final KjbProperty prop;
|
||||
|
||||
|
||||
@Autowired
|
||||
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
|
||||
MonitoringPropertyService monitoringPropertyService) {
|
||||
this.kjbSafedbWrapper = kjbSafedbWrapper;
|
||||
|
||||
KjbProperty prop = new KjbProperty();
|
||||
prop.setEaiBatchUrl(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_URL, ""));
|
||||
prop.setEaiBatchSendDir(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_SEND_DIR, "/Data/files/send"));
|
||||
|
||||
this.prop = prop;
|
||||
}
|
||||
|
||||
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
|
||||
KjbProperty property) {
|
||||
this.kjbSafedbWrapper = kjbSafedbWrapper;
|
||||
this.prop = property;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
if (prop.getEaiBatchUrl().isEmpty()) {
|
||||
log.warn("{} 가 설정되지 않음. 실제 EAI 배치 연동 없이 동작함", PROP_EAI_BATCH_URL);
|
||||
}
|
||||
|
||||
log.info("EAI Batch URL: {}", prop.getEaiBatchUrl());
|
||||
log.info("EAI Batch Send Dir: {}", prop.getEaiBatchSendDir());
|
||||
|
||||
|
||||
// 디렉토리 검사(쓰기 권한 포함)
|
||||
Path sendDirPath = Paths.get(prop.getEaiBatchSendDir());
|
||||
if (!sendDirPath.toFile().exists()) {
|
||||
// 생성 시도
|
||||
boolean created = sendDirPath.toFile().mkdirs();
|
||||
if (!created) {
|
||||
log.error("EAI_BATCH_SEND_DIR 디렉토리를 생성할 수 없음: {}", prop.getEaiBatchSendDir());
|
||||
throw new IllegalStateException("EAI_BATCH_SEND_DIR 디렉토리를 생성할 수 없음: " + prop.getEaiBatchSendDir());
|
||||
}
|
||||
}
|
||||
|
||||
if (!sendDirPath.toFile().isDirectory()) {
|
||||
log.error("EAI_BATCH_SEND_DIR 가 디렉토리가 아님: {}", prop.getEaiBatchSendDir());
|
||||
throw new IllegalStateException("EAI_BATCH_SEND_DIR 가 디렉토리가 아님: " + prop.getEaiBatchSendDir());
|
||||
}
|
||||
|
||||
if (!sendDirPath.toFile().canWrite()) {
|
||||
log.error("EAI_BATCH_SEND_DIR 에 쓰기 권한이 없음: {}", prop.getEaiBatchSendDir());
|
||||
throw new IllegalStateException("EAI_BATCH_SEND_DIR 에 쓰기 권한이 없음: " + prop.getEaiBatchSendDir());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void sendEmail(MessageRequest messageRequest) {
|
||||
log.debug("sendEmail() called - EAI_BATCH_URL: {}, EAI_BATCH_SEND_DIR: {}", prop.getEaiBatchUrl(), prop.getEaiBatchSendDir());
|
||||
log.debug("MessageRequest ID: {}, Email: {}", messageRequest.getId(), messageRequest.getEmail());
|
||||
|
||||
|
||||
if (StringUtils.isEmpty(messageRequest.getId())) {
|
||||
log.warn("MessageRequest ID is empty");
|
||||
throw new IllegalArgumentException("MessageRequest ID is required");
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(messageRequest.getEmail())) {
|
||||
log.warn("MessageRequest Email is empty for ID: {}", messageRequest.getId());
|
||||
throw new IllegalArgumentException("MessageRequest Email is required for ID: " + messageRequest.getId());
|
||||
}
|
||||
|
||||
|
||||
String filename = "EMAIL_" + messageRequest.getId() + ".json";
|
||||
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("EMAIL", kjbSafedbWrapper.encryptNotRnnoString(messageRequest.getEmail()));
|
||||
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonString = gson.toJson(jsonObject);
|
||||
byte[] jsonBytes = null;
|
||||
|
||||
try {
|
||||
jsonBytes = jsonString.getBytes("euc-kr");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
}
|
||||
|
||||
log.debug("Generated JSON({} bytes): {}", jsonBytes.length, jsonString);
|
||||
log.debug("euc-kr first 10 bytes: {}...", Arrays.toString(Arrays.copyOfRange(jsonBytes, 0, 10)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user